diff --git a/.agents/skills/cli-api/references/schema.md b/.agents/skills/cli-api/references/schema.md index ee926c43c5..5dedf082a3 100644 --- a/.agents/skills/cli-api/references/schema.md +++ b/.agents/skills/cli-api/references/schema.md @@ -12,8 +12,8 @@ csdk schema list --where.. --orderBy csdk schema list --limit 10 --after csdk schema find-first --where.. csdk schema get --id -csdk schema create --databaseId --name --schemaName [--label ] [--description ] [--smartTags ] [--category ] [--scope ] [--tags ] [--isPublic ] -csdk schema update --id [--databaseId ] [--name ] [--schemaName ] [--label ] [--description ] [--smartTags ] [--category ] [--scope ] [--tags ] [--isPublic ] +csdk schema create --databaseId --name --schemaName [--label ] [--description ] [--smartTags ] [--category ] [--scope ] [--tags ] [--isPublic ] [--apiExposure ] +csdk schema update --id [--databaseId ] [--name ] [--schemaName ] [--label ] [--description ] [--smartTags ] [--category ] [--scope ] [--tags ] [--isPublic ] [--apiExposure ] csdk schema delete --id ``` @@ -58,7 +58,7 @@ csdk schema list --where.id.equalTo --orderBy ID_ASC ### Create a schema ```bash -csdk schema create --databaseId --name --schemaName [--label ] [--description ] [--smartTags ] [--category ] [--scope ] [--tags ] [--isPublic ] +csdk schema create --databaseId --name --schemaName [--label ] [--description ] [--smartTags ] [--category ] [--scope ] [--tags ] [--isPublic ] [--apiExposure ] ``` ### Get a schema by id diff --git a/.agents/skills/cli-compute/SKILL.md b/.agents/skills/cli-compute/SKILL.md new file mode 100644 index 0000000000..b46959280f --- /dev/null +++ b/.agents/skills/cli-compute/SKILL.md @@ -0,0 +1,91 @@ +--- +name: cli-compute +description: CLI tool (csdk) for the compute API — provides CRUD commands for 18 tables and 15 custom operations +--- + +# cli-compute + + + +CLI tool (csdk) for the compute API — provides CRUD commands for 18 tables and 15 custom operations + +## Usage + +```bash +# Context management +csdk context create --endpoint +csdk context use + +# Authentication +csdk auth set-token + +# Config variables +csdk config set +csdk config get + +# CRUD for any table (e.g. get-all-record) +csdk get-all-record list +csdk get-all-record get --id +csdk get-all-record create -- + +# Non-interactive mode (skip all prompts, use flags only) +csdk --no-tty get-all-record list +``` + +## Examples + +### Set up and query + +```bash +csdk context create local --endpoint http://localhost:5000/graphql +csdk context use local +csdk auth set-token +csdk get-all-record list +``` + +### Non-interactive mode (for scripts and CI) + +```bash +csdk --no-tty get-all-record create -- +``` + +## References + +See the `references/` directory for detailed per-entity API documentation: + +- [context](references/context.md) +- [auth](references/auth.md) +- [config](references/config.md) +- [get-all-record](references/get-all-record.md) +- [function-api-binding](references/function-api-binding.md) +- [function-deployment](references/function-deployment.md) +- [function-graph-ref](references/function-graph-ref.md) +- [function-graph-store](references/function-graph-store.md) +- [function-graph-object](references/function-graph-object.md) +- [function-deployment-event](references/function-deployment-event.md) +- [org-function-execution-log](references/org-function-execution-log.md) +- [function-graph-execution-output](references/function-graph-execution-output.md) +- [function-graph-commit](references/function-graph-commit.md) +- [secret-definition](references/secret-definition.md) +- [function-execution-log](references/function-execution-log.md) +- [function-graph-execution-node-state](references/function-graph-execution-node-state.md) +- [function-graph](references/function-graph.md) +- [org-function-invocation](references/org-function-invocation.md) +- [function-invocation](references/function-invocation.md) +- [function-graph-execution](references/function-graph-execution.md) +- [function-definition](references/function-definition.md) +- [read-function-graph](references/read-function-graph.md) +- [validate-function-graph](references/validate-function-graph.md) +- [init-empty-repo](references/init-empty-repo.md) +- [set-data-at-path](references/set-data-at-path.md) +- [import-definitions](references/import-definitions.md) +- [copy-graph](references/copy-graph.md) +- [save-graph](references/save-graph.md) +- [add-edge-and-save](references/add-edge-and-save.md) +- [add-node-and-save](references/add-node-and-save.md) +- [add-edge](references/add-edge.md) +- [add-node](references/add-node.md) +- [import-graph-json](references/import-graph-json.md) +- [insert-node-at-path](references/insert-node-at-path.md) +- [start-execution](references/start-execution.md) +- [provision-bucket](references/provision-bucket.md) diff --git a/.agents/skills/cli-compute/references/add-edge-and-save.md b/.agents/skills/cli-compute/references/add-edge-and-save.md new file mode 100644 index 0000000000..148651f294 --- /dev/null +++ b/.agents/skills/cli-compute/references/add-edge-and-save.md @@ -0,0 +1,19 @@ +# addEdgeAndSave + + + +Execute the addEdgeAndSave mutation + +## Usage + +```bash +csdk add-edge-and-save --input.clientMutationId --input.graphId --input.srcNode --input.srcPort --input.dstNode --input.dstPort --input.message +``` + +## Examples + +### Run addEdgeAndSave + +```bash +csdk add-edge-and-save --input.clientMutationId --input.graphId --input.srcNode --input.srcPort --input.dstNode --input.dstPort --input.message +``` diff --git a/.agents/skills/cli-compute/references/add-edge.md b/.agents/skills/cli-compute/references/add-edge.md new file mode 100644 index 0000000000..680956d4e6 --- /dev/null +++ b/.agents/skills/cli-compute/references/add-edge.md @@ -0,0 +1,19 @@ +# addEdge + + + +Execute the addEdge mutation + +## Usage + +```bash +csdk add-edge --input.clientMutationId --input.databaseId --input.rootHash --input.srcNode --input.srcPort --input.dstNode --input.dstPort --input.context --input.graphName +``` + +## Examples + +### Run addEdge + +```bash +csdk add-edge --input.clientMutationId --input.databaseId --input.rootHash --input.srcNode --input.srcPort --input.dstNode --input.dstPort --input.context --input.graphName +``` diff --git a/.agents/skills/cli-compute/references/add-node-and-save.md b/.agents/skills/cli-compute/references/add-node-and-save.md new file mode 100644 index 0000000000..64db41bd43 --- /dev/null +++ b/.agents/skills/cli-compute/references/add-node-and-save.md @@ -0,0 +1,19 @@ +# addNodeAndSave + + + +Execute the addNodeAndSave mutation + +## Usage + +```bash +csdk add-node-and-save --input.clientMutationId --input.graphId --input.nodeName --input.nodeType --input.props --input.meta --input.message +``` + +## Examples + +### Run addNodeAndSave + +```bash +csdk add-node-and-save --input.clientMutationId --input.graphId --input.nodeName --input.nodeType --input.props --input.meta --input.message +``` diff --git a/.agents/skills/cli-compute/references/add-node.md b/.agents/skills/cli-compute/references/add-node.md new file mode 100644 index 0000000000..39bfc31fa4 --- /dev/null +++ b/.agents/skills/cli-compute/references/add-node.md @@ -0,0 +1,19 @@ +# addNode + + + +Execute the addNode mutation + +## Usage + +```bash +csdk add-node --input.clientMutationId --input.databaseId --input.rootHash --input.nodeName --input.nodeType --input.context --input.graphName --input.props --input.meta +``` + +## Examples + +### Run addNode + +```bash +csdk add-node --input.clientMutationId --input.databaseId --input.rootHash --input.nodeName --input.nodeType --input.context --input.graphName --input.props --input.meta +``` diff --git a/.agents/skills/cli-compute/references/auth.md b/.agents/skills/cli-compute/references/auth.md new file mode 100644 index 0000000000..d24ec20dd5 --- /dev/null +++ b/.agents/skills/cli-compute/references/auth.md @@ -0,0 +1,27 @@ +# Authentication + + + +Manage authentication tokens for csdk + +## Usage + +```bash +csdk auth set-token +csdk auth status +csdk auth logout +``` + +## Examples + +### Authenticate with a token + +```bash +csdk auth set-token eyJhbGciOiJIUzI1NiIs... +``` + +### Check auth status + +```bash +csdk auth status +``` diff --git a/.agents/skills/cli-compute/references/config.md b/.agents/skills/cli-compute/references/config.md new file mode 100644 index 0000000000..cc1c23b7ba --- /dev/null +++ b/.agents/skills/cli-compute/references/config.md @@ -0,0 +1,29 @@ +# Config Variables + + + +Manage per-context key-value configuration variables for csdk + +## Usage + +```bash +csdk config get +csdk config set +csdk config list +csdk config delete +``` + +## Examples + +### Store and retrieve a config variable + +```bash +csdk config set orgId abc-123 +csdk config get orgId +``` + +### List all config variables + +```bash +csdk config list +``` diff --git a/.agents/skills/cli-compute/references/context.md b/.agents/skills/cli-compute/references/context.md new file mode 100644 index 0000000000..704ff09111 --- /dev/null +++ b/.agents/skills/cli-compute/references/context.md @@ -0,0 +1,30 @@ +# Context Management + + + +Manage API endpoint contexts for csdk + +## Usage + +```bash +csdk context create --endpoint +csdk context list +csdk context use +csdk context current +csdk context delete +``` + +## Examples + +### Create and activate a context + +```bash +csdk context create production --endpoint https://api.example.com/graphql +csdk context use production +``` + +### List all contexts + +```bash +csdk context list +``` diff --git a/.agents/skills/cli-compute/references/copy-graph.md b/.agents/skills/cli-compute/references/copy-graph.md new file mode 100644 index 0000000000..99a6e5be68 --- /dev/null +++ b/.agents/skills/cli-compute/references/copy-graph.md @@ -0,0 +1,19 @@ +# copyGraph + + + +Execute the copyGraph mutation + +## Usage + +```bash +csdk copy-graph --input.clientMutationId --input.databaseId --input.graphId --input.name +``` + +## Examples + +### Run copyGraph + +```bash +csdk copy-graph --input.clientMutationId --input.databaseId --input.graphId --input.name +``` diff --git a/.agents/skills/cli-compute/references/function-api-binding.md b/.agents/skills/cli-compute/references/function-api-binding.md new file mode 100644 index 0000000000..24ad80b270 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-api-binding.md @@ -0,0 +1,68 @@ +# functionApiBinding + + + +CRUD operations for FunctionApiBinding records via csdk CLI + +## Usage + +```bash +csdk function-api-binding list +csdk function-api-binding list --where.. --orderBy +csdk function-api-binding list --limit 10 --after +csdk function-api-binding find-first --where.. +csdk function-api-binding get --id +csdk function-api-binding create --functionDefinitionId --apiId [--alias ] [--config ] +csdk function-api-binding update --id [--functionDefinitionId ] [--apiId ] [--alias ] [--config ] +csdk function-api-binding delete --id +``` + +## Examples + +### List functionApiBinding records + +```bash +csdk function-api-binding list +``` + +### List functionApiBinding records with pagination + +```bash +csdk function-api-binding list --limit 10 --offset 0 +``` + +### List functionApiBinding records with cursor pagination + +```bash +csdk function-api-binding list --limit 10 --after +``` + +### Find first matching functionApiBinding + +```bash +csdk function-api-binding find-first --where.id.equalTo +``` + +### List functionApiBinding records with field selection + +```bash +csdk function-api-binding list --select id,id +``` + +### List functionApiBinding records with filtering and ordering + +```bash +csdk function-api-binding list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionApiBinding + +```bash +csdk function-api-binding create --functionDefinitionId --apiId [--alias ] [--config ] +``` + +### Get a functionApiBinding by id + +```bash +csdk function-api-binding get --id +``` diff --git a/.agents/skills/cli-compute/references/function-definition.md b/.agents/skills/cli-compute/references/function-definition.md new file mode 100644 index 0000000000..8de4fc411f --- /dev/null +++ b/.agents/skills/cli-compute/references/function-definition.md @@ -0,0 +1,68 @@ +# functionDefinition + + + +CRUD operations for FunctionDefinition records via csdk CLI + +## Usage + +```bash +csdk function-definition list +csdk function-definition list --where.. --orderBy +csdk function-definition list --limit 10 --after +csdk function-definition find-first --where.. +csdk function-definition get --id +csdk function-definition create --scope --name --taskIdentifier [--description ] [--isInvocable ] [--maxAttempts ] [--priority ] [--queueName ] [--runtime ] [--image ] [--concurrency ] [--scaleMin ] [--scaleMax ] [--timeoutSeconds ] [--resources ] [--isBuiltIn ] [--requiredSecrets ] [--requiredConfigs ] [--requiredBuckets ] [--requiredModels ] [--inputs ] [--outputs ] [--props ] [--volatile ] [--icon ] [--category ] +csdk function-definition update --id [--scope ] [--name ] [--taskIdentifier ] [--description ] [--isInvocable ] [--maxAttempts ] [--priority ] [--queueName ] [--runtime ] [--image ] [--concurrency ] [--scaleMin ] [--scaleMax ] [--timeoutSeconds ] [--resources ] [--isBuiltIn ] [--requiredSecrets ] [--requiredConfigs ] [--requiredBuckets ] [--requiredModels ] [--inputs ] [--outputs ] [--props ] [--volatile ] [--icon ] [--category ] +csdk function-definition delete --id +``` + +## Examples + +### List functionDefinition records + +```bash +csdk function-definition list +``` + +### List functionDefinition records with pagination + +```bash +csdk function-definition list --limit 10 --offset 0 +``` + +### List functionDefinition records with cursor pagination + +```bash +csdk function-definition list --limit 10 --after +``` + +### Find first matching functionDefinition + +```bash +csdk function-definition find-first --where.id.equalTo +``` + +### List functionDefinition records with field selection + +```bash +csdk function-definition list --select id,id +``` + +### List functionDefinition records with filtering and ordering + +```bash +csdk function-definition list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionDefinition + +```bash +csdk function-definition create --scope --name --taskIdentifier [--description ] [--isInvocable ] [--maxAttempts ] [--priority ] [--queueName ] [--runtime ] [--image ] [--concurrency ] [--scaleMin ] [--scaleMax ] [--timeoutSeconds ] [--resources ] [--isBuiltIn ] [--requiredSecrets ] [--requiredConfigs ] [--requiredBuckets ] [--requiredModels ] [--inputs ] [--outputs ] [--props ] [--volatile ] [--icon ] [--category ] +``` + +### Get a functionDefinition by id + +```bash +csdk function-definition get --id +``` diff --git a/.agents/skills/cli-compute/references/function-deployment-event.md b/.agents/skills/cli-compute/references/function-deployment-event.md new file mode 100644 index 0000000000..c670e2b334 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-deployment-event.md @@ -0,0 +1,68 @@ +# functionDeploymentEvent + + + +CRUD operations for FunctionDeploymentEvent records via csdk CLI + +## Usage + +```bash +csdk function-deployment-event list +csdk function-deployment-event list --where.. --orderBy +csdk function-deployment-event list --limit 10 --after +csdk function-deployment-event find-first --where.. +csdk function-deployment-event get --id +csdk function-deployment-event create --deploymentId --eventType --databaseId [--actorId ] [--message ] [--metadata ] +csdk function-deployment-event update --id [--deploymentId ] [--eventType ] [--actorId ] [--message ] [--metadata ] [--databaseId ] +csdk function-deployment-event delete --id +``` + +## Examples + +### List functionDeploymentEvent records + +```bash +csdk function-deployment-event list +``` + +### List functionDeploymentEvent records with pagination + +```bash +csdk function-deployment-event list --limit 10 --offset 0 +``` + +### List functionDeploymentEvent records with cursor pagination + +```bash +csdk function-deployment-event list --limit 10 --after +``` + +### Find first matching functionDeploymentEvent + +```bash +csdk function-deployment-event find-first --where.id.equalTo +``` + +### List functionDeploymentEvent records with field selection + +```bash +csdk function-deployment-event list --select id,id +``` + +### List functionDeploymentEvent records with filtering and ordering + +```bash +csdk function-deployment-event list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionDeploymentEvent + +```bash +csdk function-deployment-event create --deploymentId --eventType --databaseId [--actorId ] [--message ] [--metadata ] +``` + +### Get a functionDeploymentEvent by id + +```bash +csdk function-deployment-event get --id +``` diff --git a/.agents/skills/cli-compute/references/function-deployment.md b/.agents/skills/cli-compute/references/function-deployment.md new file mode 100644 index 0000000000..4e960f6167 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-deployment.md @@ -0,0 +1,68 @@ +# functionDeployment + + + +CRUD operations for FunctionDeployment records via csdk CLI + +## Usage + +```bash +csdk function-deployment list +csdk function-deployment list --where.. --orderBy +csdk function-deployment list --limit 10 --after +csdk function-deployment find-first --where.. +csdk function-deployment get --id +csdk function-deployment create --functionDefinitionId --namespaceId --databaseId [--status ] [--serviceUrl ] [--serviceName ] [--revision ] [--image ] [--concurrency ] [--scaleMin ] [--scaleMax ] [--timeoutSeconds ] [--resources ] [--lastError ] [--lastErrorAt ] [--errorCount ] [--labels ] [--annotations ] +csdk function-deployment update --id [--functionDefinitionId ] [--namespaceId ] [--status ] [--serviceUrl ] [--serviceName ] [--revision ] [--image ] [--concurrency ] [--scaleMin ] [--scaleMax ] [--timeoutSeconds ] [--resources ] [--lastError ] [--lastErrorAt ] [--errorCount ] [--labels ] [--annotations ] [--databaseId ] +csdk function-deployment delete --id +``` + +## Examples + +### List functionDeployment records + +```bash +csdk function-deployment list +``` + +### List functionDeployment records with pagination + +```bash +csdk function-deployment list --limit 10 --offset 0 +``` + +### List functionDeployment records with cursor pagination + +```bash +csdk function-deployment list --limit 10 --after +``` + +### Find first matching functionDeployment + +```bash +csdk function-deployment find-first --where.id.equalTo +``` + +### List functionDeployment records with field selection + +```bash +csdk function-deployment list --select id,id +``` + +### List functionDeployment records with filtering and ordering + +```bash +csdk function-deployment list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionDeployment + +```bash +csdk function-deployment create --functionDefinitionId --namespaceId --databaseId [--status ] [--serviceUrl ] [--serviceName ] [--revision ] [--image ] [--concurrency ] [--scaleMin ] [--scaleMax ] [--timeoutSeconds ] [--resources ] [--lastError ] [--lastErrorAt ] [--errorCount ] [--labels ] [--annotations ] +``` + +### Get a functionDeployment by id + +```bash +csdk function-deployment get --id +``` diff --git a/.agents/skills/cli-compute/references/function-execution-log.md b/.agents/skills/cli-compute/references/function-execution-log.md new file mode 100644 index 0000000000..df50f0dae2 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-execution-log.md @@ -0,0 +1,68 @@ +# functionExecutionLog + + + +CRUD operations for FunctionExecutionLog records via csdk CLI + +## Usage + +```bash +csdk function-execution-log list +csdk function-execution-log list --where.. --orderBy +csdk function-execution-log list --limit 10 --after +csdk function-execution-log find-first --where.. +csdk function-execution-log get --id +csdk function-execution-log create --message --databaseId [--invocationId ] [--taskIdentifier ] [--logLevel ] [--metadata ] [--actorId ] +csdk function-execution-log update --id [--invocationId ] [--taskIdentifier ] [--logLevel ] [--message ] [--metadata ] [--actorId ] [--databaseId ] +csdk function-execution-log delete --id +``` + +## Examples + +### List functionExecutionLog records + +```bash +csdk function-execution-log list +``` + +### List functionExecutionLog records with pagination + +```bash +csdk function-execution-log list --limit 10 --offset 0 +``` + +### List functionExecutionLog records with cursor pagination + +```bash +csdk function-execution-log list --limit 10 --after +``` + +### Find first matching functionExecutionLog + +```bash +csdk function-execution-log find-first --where.id.equalTo +``` + +### List functionExecutionLog records with field selection + +```bash +csdk function-execution-log list --select id,id +``` + +### List functionExecutionLog records with filtering and ordering + +```bash +csdk function-execution-log list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionExecutionLog + +```bash +csdk function-execution-log create --message --databaseId [--invocationId ] [--taskIdentifier ] [--logLevel ] [--metadata ] [--actorId ] +``` + +### Get a functionExecutionLog by id + +```bash +csdk function-execution-log get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph-commit.md b/.agents/skills/cli-compute/references/function-graph-commit.md new file mode 100644 index 0000000000..b33e991b81 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph-commit.md @@ -0,0 +1,68 @@ +# functionGraphCommit + + + +CRUD operations for FunctionGraphCommit records via csdk CLI + +## Usage + +```bash +csdk function-graph-commit list +csdk function-graph-commit list --where.. --orderBy +csdk function-graph-commit list --limit 10 --after +csdk function-graph-commit find-first --where.. +csdk function-graph-commit get --id +csdk function-graph-commit create --databaseId --storeId [--message ] [--parentIds ] [--authorId ] [--committerId ] [--treeId ] [--date ] +csdk function-graph-commit update --id [--message ] [--databaseId ] [--storeId ] [--parentIds ] [--authorId ] [--committerId ] [--treeId ] [--date ] +csdk function-graph-commit delete --id +``` + +## Examples + +### List functionGraphCommit records + +```bash +csdk function-graph-commit list +``` + +### List functionGraphCommit records with pagination + +```bash +csdk function-graph-commit list --limit 10 --offset 0 +``` + +### List functionGraphCommit records with cursor pagination + +```bash +csdk function-graph-commit list --limit 10 --after +``` + +### Find first matching functionGraphCommit + +```bash +csdk function-graph-commit find-first --where.id.equalTo +``` + +### List functionGraphCommit records with field selection + +```bash +csdk function-graph-commit list --select id,id +``` + +### List functionGraphCommit records with filtering and ordering + +```bash +csdk function-graph-commit list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraphCommit + +```bash +csdk function-graph-commit create --databaseId --storeId [--message ] [--parentIds ] [--authorId ] [--committerId ] [--treeId ] [--date ] +``` + +### Get a functionGraphCommit by id + +```bash +csdk function-graph-commit get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph-execution-node-state.md b/.agents/skills/cli-compute/references/function-graph-execution-node-state.md new file mode 100644 index 0000000000..086612504a --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph-execution-node-state.md @@ -0,0 +1,68 @@ +# functionGraphExecutionNodeState + + + +CRUD operations for FunctionGraphExecutionNodeState records via csdk CLI + +## Usage + +```bash +csdk function-graph-execution-node-state list +csdk function-graph-execution-node-state list --where.. --orderBy +csdk function-graph-execution-node-state list --limit 10 --after +csdk function-graph-execution-node-state find-first --where.. +csdk function-graph-execution-node-state get --id +csdk function-graph-execution-node-state create --executionId --databaseId --nodeName [--nodePath ] [--status ] [--startedAt ] [--completedAt ] [--errorCode ] [--errorMessage ] [--outputId ] +csdk function-graph-execution-node-state update --id [--executionId ] [--databaseId ] [--nodeName ] [--nodePath ] [--status ] [--startedAt ] [--completedAt ] [--errorCode ] [--errorMessage ] [--outputId ] +csdk function-graph-execution-node-state delete --id +``` + +## Examples + +### List functionGraphExecutionNodeState records + +```bash +csdk function-graph-execution-node-state list +``` + +### List functionGraphExecutionNodeState records with pagination + +```bash +csdk function-graph-execution-node-state list --limit 10 --offset 0 +``` + +### List functionGraphExecutionNodeState records with cursor pagination + +```bash +csdk function-graph-execution-node-state list --limit 10 --after +``` + +### Find first matching functionGraphExecutionNodeState + +```bash +csdk function-graph-execution-node-state find-first --where.id.equalTo +``` + +### List functionGraphExecutionNodeState records with field selection + +```bash +csdk function-graph-execution-node-state list --select id,id +``` + +### List functionGraphExecutionNodeState records with filtering and ordering + +```bash +csdk function-graph-execution-node-state list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraphExecutionNodeState + +```bash +csdk function-graph-execution-node-state create --executionId --databaseId --nodeName [--nodePath ] [--status ] [--startedAt ] [--completedAt ] [--errorCode ] [--errorMessage ] [--outputId ] +``` + +### Get a functionGraphExecutionNodeState by id + +```bash +csdk function-graph-execution-node-state get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph-execution-output.md b/.agents/skills/cli-compute/references/function-graph-execution-output.md new file mode 100644 index 0000000000..863af1bde6 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph-execution-output.md @@ -0,0 +1,68 @@ +# functionGraphExecutionOutput + + + +CRUD operations for FunctionGraphExecutionOutput records via csdk CLI + +## Usage + +```bash +csdk function-graph-execution-output list +csdk function-graph-execution-output list --where.. --orderBy +csdk function-graph-execution-output list --limit 10 --after +csdk function-graph-execution-output find-first --where.. +csdk function-graph-execution-output get --id +csdk function-graph-execution-output create --databaseId --hash --data +csdk function-graph-execution-output update --id [--databaseId ] [--hash ] [--data ] +csdk function-graph-execution-output delete --id +``` + +## Examples + +### List functionGraphExecutionOutput records + +```bash +csdk function-graph-execution-output list +``` + +### List functionGraphExecutionOutput records with pagination + +```bash +csdk function-graph-execution-output list --limit 10 --offset 0 +``` + +### List functionGraphExecutionOutput records with cursor pagination + +```bash +csdk function-graph-execution-output list --limit 10 --after +``` + +### Find first matching functionGraphExecutionOutput + +```bash +csdk function-graph-execution-output find-first --where.id.equalTo +``` + +### List functionGraphExecutionOutput records with field selection + +```bash +csdk function-graph-execution-output list --select id,id +``` + +### List functionGraphExecutionOutput records with filtering and ordering + +```bash +csdk function-graph-execution-output list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraphExecutionOutput + +```bash +csdk function-graph-execution-output create --databaseId --hash --data +``` + +### Get a functionGraphExecutionOutput by id + +```bash +csdk function-graph-execution-output get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph-execution.md b/.agents/skills/cli-compute/references/function-graph-execution.md new file mode 100644 index 0000000000..95a185fd28 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph-execution.md @@ -0,0 +1,68 @@ +# functionGraphExecution + + + +CRUD operations for FunctionGraphExecution records via csdk CLI + +## Usage + +```bash +csdk function-graph-execution list +csdk function-graph-execution list --where.. --orderBy +csdk function-graph-execution list --limit 10 --after +csdk function-graph-execution find-first --where.. +csdk function-graph-execution get --id +csdk function-graph-execution create --graphId --databaseId --outputNode [--startedAt ] [--invocationId ] [--entityId ] [--outputPort ] [--status ] [--inputPayload ] [--outputPayload ] [--nodeOutputs ] [--executionPlan ] [--currentWave ] [--parentExecutionId ] [--parentNodeName ] [--definitionsCommitId ] [--tickCount ] [--completedAt ] [--maxTicks ] [--maxPendingJobs ] [--timeoutAt ] [--errorCode ] [--errorMessage ] +csdk function-graph-execution update --id [--startedAt ] [--graphId ] [--invocationId ] [--databaseId ] [--entityId ] [--outputNode ] [--outputPort ] [--status ] [--inputPayload ] [--outputPayload ] [--nodeOutputs ] [--executionPlan ] [--currentWave ] [--parentExecutionId ] [--parentNodeName ] [--definitionsCommitId ] [--tickCount ] [--completedAt ] [--maxTicks ] [--maxPendingJobs ] [--timeoutAt ] [--errorCode ] [--errorMessage ] +csdk function-graph-execution delete --id +``` + +## Examples + +### List functionGraphExecution records + +```bash +csdk function-graph-execution list +``` + +### List functionGraphExecution records with pagination + +```bash +csdk function-graph-execution list --limit 10 --offset 0 +``` + +### List functionGraphExecution records with cursor pagination + +```bash +csdk function-graph-execution list --limit 10 --after +``` + +### Find first matching functionGraphExecution + +```bash +csdk function-graph-execution find-first --where.id.equalTo +``` + +### List functionGraphExecution records with field selection + +```bash +csdk function-graph-execution list --select id,id +``` + +### List functionGraphExecution records with filtering and ordering + +```bash +csdk function-graph-execution list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraphExecution + +```bash +csdk function-graph-execution create --graphId --databaseId --outputNode [--startedAt ] [--invocationId ] [--entityId ] [--outputPort ] [--status ] [--inputPayload ] [--outputPayload ] [--nodeOutputs ] [--executionPlan ] [--currentWave ] [--parentExecutionId ] [--parentNodeName ] [--definitionsCommitId ] [--tickCount ] [--completedAt ] [--maxTicks ] [--maxPendingJobs ] [--timeoutAt ] [--errorCode ] [--errorMessage ] +``` + +### Get a functionGraphExecution by id + +```bash +csdk function-graph-execution get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph-object.md b/.agents/skills/cli-compute/references/function-graph-object.md new file mode 100644 index 0000000000..95f78fc084 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph-object.md @@ -0,0 +1,68 @@ +# functionGraphObject + + + +CRUD operations for FunctionGraphObject records via csdk CLI + +## Usage + +```bash +csdk function-graph-object list +csdk function-graph-object list --where.. --orderBy +csdk function-graph-object list --limit 10 --after +csdk function-graph-object find-first --where.. +csdk function-graph-object get --id +csdk function-graph-object create --databaseId [--kids ] [--ktree ] [--data ] +csdk function-graph-object update --id [--databaseId ] [--kids ] [--ktree ] [--data ] +csdk function-graph-object delete --id +``` + +## Examples + +### List functionGraphObject records + +```bash +csdk function-graph-object list +``` + +### List functionGraphObject records with pagination + +```bash +csdk function-graph-object list --limit 10 --offset 0 +``` + +### List functionGraphObject records with cursor pagination + +```bash +csdk function-graph-object list --limit 10 --after +``` + +### Find first matching functionGraphObject + +```bash +csdk function-graph-object find-first --where.id.equalTo +``` + +### List functionGraphObject records with field selection + +```bash +csdk function-graph-object list --select id,id +``` + +### List functionGraphObject records with filtering and ordering + +```bash +csdk function-graph-object list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraphObject + +```bash +csdk function-graph-object create --databaseId [--kids ] [--ktree ] [--data ] +``` + +### Get a functionGraphObject by id + +```bash +csdk function-graph-object get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph-ref.md b/.agents/skills/cli-compute/references/function-graph-ref.md new file mode 100644 index 0000000000..cebef9d679 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph-ref.md @@ -0,0 +1,68 @@ +# functionGraphRef + + + +CRUD operations for FunctionGraphRef records via csdk CLI + +## Usage + +```bash +csdk function-graph-ref list +csdk function-graph-ref list --where.. --orderBy +csdk function-graph-ref list --limit 10 --after +csdk function-graph-ref find-first --where.. +csdk function-graph-ref get --id +csdk function-graph-ref create --name --databaseId --storeId [--commitId ] +csdk function-graph-ref update --id [--name ] [--databaseId ] [--storeId ] [--commitId ] +csdk function-graph-ref delete --id +``` + +## Examples + +### List functionGraphRef records + +```bash +csdk function-graph-ref list +``` + +### List functionGraphRef records with pagination + +```bash +csdk function-graph-ref list --limit 10 --offset 0 +``` + +### List functionGraphRef records with cursor pagination + +```bash +csdk function-graph-ref list --limit 10 --after +``` + +### Find first matching functionGraphRef + +```bash +csdk function-graph-ref find-first --where.id.equalTo +``` + +### List functionGraphRef records with field selection + +```bash +csdk function-graph-ref list --select id,id +``` + +### List functionGraphRef records with filtering and ordering + +```bash +csdk function-graph-ref list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraphRef + +```bash +csdk function-graph-ref create --name --databaseId --storeId [--commitId ] +``` + +### Get a functionGraphRef by id + +```bash +csdk function-graph-ref get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph-store.md b/.agents/skills/cli-compute/references/function-graph-store.md new file mode 100644 index 0000000000..a99871828d --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph-store.md @@ -0,0 +1,68 @@ +# functionGraphStore + + + +CRUD operations for FunctionGraphStore records via csdk CLI + +## Usage + +```bash +csdk function-graph-store list +csdk function-graph-store list --where.. --orderBy +csdk function-graph-store list --limit 10 --after +csdk function-graph-store find-first --where.. +csdk function-graph-store get --id +csdk function-graph-store create --name --databaseId [--hash ] +csdk function-graph-store update --id [--name ] [--databaseId ] [--hash ] +csdk function-graph-store delete --id +``` + +## Examples + +### List functionGraphStore records + +```bash +csdk function-graph-store list +``` + +### List functionGraphStore records with pagination + +```bash +csdk function-graph-store list --limit 10 --offset 0 +``` + +### List functionGraphStore records with cursor pagination + +```bash +csdk function-graph-store list --limit 10 --after +``` + +### Find first matching functionGraphStore + +```bash +csdk function-graph-store find-first --where.id.equalTo +``` + +### List functionGraphStore records with field selection + +```bash +csdk function-graph-store list --select id,id +``` + +### List functionGraphStore records with filtering and ordering + +```bash +csdk function-graph-store list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraphStore + +```bash +csdk function-graph-store create --name --databaseId [--hash ] +``` + +### Get a functionGraphStore by id + +```bash +csdk function-graph-store get --id +``` diff --git a/.agents/skills/cli-compute/references/function-graph.md b/.agents/skills/cli-compute/references/function-graph.md new file mode 100644 index 0000000000..92e2ae6d3b --- /dev/null +++ b/.agents/skills/cli-compute/references/function-graph.md @@ -0,0 +1,68 @@ +# functionGraph + + + +CRUD operations for FunctionGraph records via csdk CLI + +## Usage + +```bash +csdk function-graph list +csdk function-graph list --where.. --orderBy +csdk function-graph list --limit 10 --after +csdk function-graph find-first --where.. +csdk function-graph get --id +csdk function-graph create --databaseId --storeId --entityId --context --name --description --definitionsCommitId --isValid --validationErrors --createdBy +csdk function-graph update --id [--databaseId ] [--storeId ] [--entityId ] [--context ] [--name ] [--description ] [--definitionsCommitId ] [--isValid ] [--validationErrors ] [--createdBy ] +csdk function-graph delete --id +``` + +## Examples + +### List functionGraph records + +```bash +csdk function-graph list +``` + +### List functionGraph records with pagination + +```bash +csdk function-graph list --limit 10 --offset 0 +``` + +### List functionGraph records with cursor pagination + +```bash +csdk function-graph list --limit 10 --after +``` + +### Find first matching functionGraph + +```bash +csdk function-graph find-first --where.id.equalTo +``` + +### List functionGraph records with field selection + +```bash +csdk function-graph list --select id,id +``` + +### List functionGraph records with filtering and ordering + +```bash +csdk function-graph list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionGraph + +```bash +csdk function-graph create --databaseId --storeId --entityId --context --name --description --definitionsCommitId --isValid --validationErrors --createdBy +``` + +### Get a functionGraph by id + +```bash +csdk function-graph get --id +``` diff --git a/.agents/skills/cli-compute/references/function-invocation.md b/.agents/skills/cli-compute/references/function-invocation.md new file mode 100644 index 0000000000..e2f40f4ce8 --- /dev/null +++ b/.agents/skills/cli-compute/references/function-invocation.md @@ -0,0 +1,68 @@ +# functionInvocation + + + +CRUD operations for FunctionInvocation records via csdk CLI + +## Usage + +```bash +csdk function-invocation list +csdk function-invocation list --where.. --orderBy +csdk function-invocation list --limit 10 --after +csdk function-invocation find-first --where.. +csdk function-invocation get --id +csdk function-invocation create --databaseId --taskIdentifier [--actorId ] [--payload ] [--status ] [--result ] [--error ] [--durationMs ] [--jobId ] [--startedAt ] [--completedAt ] [--parentInvocationId ] [--graphExecutionId ] +csdk function-invocation update --id [--actorId ] [--databaseId ] [--taskIdentifier ] [--payload ] [--status ] [--result ] [--error ] [--durationMs ] [--jobId ] [--startedAt ] [--completedAt ] [--parentInvocationId ] [--graphExecutionId ] +csdk function-invocation delete --id +``` + +## Examples + +### List functionInvocation records + +```bash +csdk function-invocation list +``` + +### List functionInvocation records with pagination + +```bash +csdk function-invocation list --limit 10 --offset 0 +``` + +### List functionInvocation records with cursor pagination + +```bash +csdk function-invocation list --limit 10 --after +``` + +### Find first matching functionInvocation + +```bash +csdk function-invocation find-first --where.id.equalTo +``` + +### List functionInvocation records with field selection + +```bash +csdk function-invocation list --select id,id +``` + +### List functionInvocation records with filtering and ordering + +```bash +csdk function-invocation list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionInvocation + +```bash +csdk function-invocation create --databaseId --taskIdentifier [--actorId ] [--payload ] [--status ] [--result ] [--error ] [--durationMs ] [--jobId ] [--startedAt ] [--completedAt ] [--parentInvocationId ] [--graphExecutionId ] +``` + +### Get a functionInvocation by id + +```bash +csdk function-invocation get --id +``` diff --git a/.agents/skills/cli-compute/references/get-all-record.md b/.agents/skills/cli-compute/references/get-all-record.md new file mode 100644 index 0000000000..b9b5a653dd --- /dev/null +++ b/.agents/skills/cli-compute/references/get-all-record.md @@ -0,0 +1,68 @@ +# getAllRecord + + + +CRUD operations for GetAllRecord records via csdk CLI + +## Usage + +```bash +csdk get-all-record list +csdk get-all-record list --where.. --orderBy +csdk get-all-record list --limit 10 --after +csdk get-all-record find-first --where.. +csdk get-all-record get --id +csdk get-all-record create --path --data +csdk get-all-record update --id [--path ] [--data ] +csdk get-all-record delete --id +``` + +## Examples + +### List getAllRecord records + +```bash +csdk get-all-record list +``` + +### List getAllRecord records with pagination + +```bash +csdk get-all-record list --limit 10 --offset 0 +``` + +### List getAllRecord records with cursor pagination + +```bash +csdk get-all-record list --limit 10 --after +``` + +### Find first matching getAllRecord + +```bash +csdk get-all-record find-first --where.id.equalTo +``` + +### List getAllRecord records with field selection + +```bash +csdk get-all-record list --select id,id +``` + +### List getAllRecord records with filtering and ordering + +```bash +csdk get-all-record list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a getAllRecord + +```bash +csdk get-all-record create --path --data +``` + +### Get a getAllRecord by id + +```bash +csdk get-all-record get --id +``` diff --git a/.agents/skills/cli-compute/references/import-definitions.md b/.agents/skills/cli-compute/references/import-definitions.md new file mode 100644 index 0000000000..9c5e98781c --- /dev/null +++ b/.agents/skills/cli-compute/references/import-definitions.md @@ -0,0 +1,19 @@ +# importDefinitions + + + +Execute the importDefinitions mutation + +## Usage + +```bash +csdk import-definitions --input.clientMutationId --input.graphId --input.sourceScopeId --input.sourceCommitId --input.contexts +``` + +## Examples + +### Run importDefinitions + +```bash +csdk import-definitions --input.clientMutationId --input.graphId --input.sourceScopeId --input.sourceCommitId --input.contexts +``` diff --git a/.agents/skills/cli-compute/references/import-graph-json.md b/.agents/skills/cli-compute/references/import-graph-json.md new file mode 100644 index 0000000000..8b5ccdb8b5 --- /dev/null +++ b/.agents/skills/cli-compute/references/import-graph-json.md @@ -0,0 +1,19 @@ +# importGraphJson + + + +Execute the importGraphJson mutation + +## Usage + +```bash +csdk import-graph-json --input.clientMutationId --input.databaseId --input.name --input.graphJson --input.context --input.description --input.entityId --input.createdBy --input.definitionsCommitId +``` + +## Examples + +### Run importGraphJson + +```bash +csdk import-graph-json --input.clientMutationId --input.databaseId --input.name --input.graphJson --input.context --input.description --input.entityId --input.createdBy --input.definitionsCommitId +``` diff --git a/.agents/skills/cli-compute/references/init-empty-repo.md b/.agents/skills/cli-compute/references/init-empty-repo.md new file mode 100644 index 0000000000..22523a8cd8 --- /dev/null +++ b/.agents/skills/cli-compute/references/init-empty-repo.md @@ -0,0 +1,19 @@ +# initEmptyRepo + + + +Execute the initEmptyRepo mutation + +## Usage + +```bash +csdk init-empty-repo --input.clientMutationId --input.sId --input.storeId +``` + +## Examples + +### Run initEmptyRepo + +```bash +csdk init-empty-repo --input.clientMutationId --input.sId --input.storeId +``` diff --git a/.agents/skills/cli-compute/references/insert-node-at-path.md b/.agents/skills/cli-compute/references/insert-node-at-path.md new file mode 100644 index 0000000000..5a9e3b7ba3 --- /dev/null +++ b/.agents/skills/cli-compute/references/insert-node-at-path.md @@ -0,0 +1,19 @@ +# insertNodeAtPath + + + +Execute the insertNodeAtPath mutation + +## Usage + +```bash +csdk insert-node-at-path --input.clientMutationId --input.sId --input.root --input.path --input.data --input.kids --input.ktree +``` + +## Examples + +### Run insertNodeAtPath + +```bash +csdk insert-node-at-path --input.clientMutationId --input.sId --input.root --input.path --input.data --input.kids --input.ktree +``` diff --git a/.agents/skills/cli-compute/references/org-function-execution-log.md b/.agents/skills/cli-compute/references/org-function-execution-log.md new file mode 100644 index 0000000000..4450fc30ca --- /dev/null +++ b/.agents/skills/cli-compute/references/org-function-execution-log.md @@ -0,0 +1,68 @@ +# orgFunctionExecutionLog + + + +CRUD operations for OrgFunctionExecutionLog records via csdk CLI + +## Usage + +```bash +csdk org-function-execution-log list +csdk org-function-execution-log list --where.. --orderBy +csdk org-function-execution-log list --limit 10 --after +csdk org-function-execution-log find-first --where.. +csdk org-function-execution-log get --id +csdk org-function-execution-log create --message [--invocationId ] [--taskIdentifier ] [--logLevel ] [--metadata ] [--actorId ] +csdk org-function-execution-log update --id [--invocationId ] [--taskIdentifier ] [--logLevel ] [--message ] [--metadata ] [--actorId ] +csdk org-function-execution-log delete --id +``` + +## Examples + +### List orgFunctionExecutionLog records + +```bash +csdk org-function-execution-log list +``` + +### List orgFunctionExecutionLog records with pagination + +```bash +csdk org-function-execution-log list --limit 10 --offset 0 +``` + +### List orgFunctionExecutionLog records with cursor pagination + +```bash +csdk org-function-execution-log list --limit 10 --after +``` + +### Find first matching orgFunctionExecutionLog + +```bash +csdk org-function-execution-log find-first --where.id.equalTo +``` + +### List orgFunctionExecutionLog records with field selection + +```bash +csdk org-function-execution-log list --select id,id +``` + +### List orgFunctionExecutionLog records with filtering and ordering + +```bash +csdk org-function-execution-log list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a orgFunctionExecutionLog + +```bash +csdk org-function-execution-log create --message [--invocationId ] [--taskIdentifier ] [--logLevel ] [--metadata ] [--actorId ] +``` + +### Get a orgFunctionExecutionLog by id + +```bash +csdk org-function-execution-log get --id +``` diff --git a/.agents/skills/cli-compute/references/org-function-invocation.md b/.agents/skills/cli-compute/references/org-function-invocation.md new file mode 100644 index 0000000000..084ef30c84 --- /dev/null +++ b/.agents/skills/cli-compute/references/org-function-invocation.md @@ -0,0 +1,68 @@ +# orgFunctionInvocation + + + +CRUD operations for OrgFunctionInvocation records via csdk CLI + +## Usage + +```bash +csdk org-function-invocation list +csdk org-function-invocation list --where.. --orderBy +csdk org-function-invocation list --limit 10 --after +csdk org-function-invocation find-first --where.. +csdk org-function-invocation get --id +csdk org-function-invocation create --taskIdentifier [--actorId ] [--payload ] [--status ] [--result ] [--error ] [--durationMs ] [--jobId ] [--startedAt ] [--completedAt ] [--parentInvocationId ] [--graphExecutionId ] +csdk org-function-invocation update --id [--actorId ] [--taskIdentifier ] [--payload ] [--status ] [--result ] [--error ] [--durationMs ] [--jobId ] [--startedAt ] [--completedAt ] [--parentInvocationId ] [--graphExecutionId ] +csdk org-function-invocation delete --id +``` + +## Examples + +### List orgFunctionInvocation records + +```bash +csdk org-function-invocation list +``` + +### List orgFunctionInvocation records with pagination + +```bash +csdk org-function-invocation list --limit 10 --offset 0 +``` + +### List orgFunctionInvocation records with cursor pagination + +```bash +csdk org-function-invocation list --limit 10 --after +``` + +### Find first matching orgFunctionInvocation + +```bash +csdk org-function-invocation find-first --where.id.equalTo +``` + +### List orgFunctionInvocation records with field selection + +```bash +csdk org-function-invocation list --select id,id +``` + +### List orgFunctionInvocation records with filtering and ordering + +```bash +csdk org-function-invocation list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a orgFunctionInvocation + +```bash +csdk org-function-invocation create --taskIdentifier [--actorId ] [--payload ] [--status ] [--result ] [--error ] [--durationMs ] [--jobId ] [--startedAt ] [--completedAt ] [--parentInvocationId ] [--graphExecutionId ] +``` + +### Get a orgFunctionInvocation by id + +```bash +csdk org-function-invocation get --id +``` diff --git a/.agents/skills/cli-compute/references/provision-bucket.md b/.agents/skills/cli-compute/references/provision-bucket.md new file mode 100644 index 0000000000..cc17ffbc21 --- /dev/null +++ b/.agents/skills/cli-compute/references/provision-bucket.md @@ -0,0 +1,22 @@ +# provisionBucket + + + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +## Usage + +```bash +csdk provision-bucket --input.bucketKey --input.ownerId +``` + +## Examples + +### Run provisionBucket + +```bash +csdk provision-bucket --input.bucketKey --input.ownerId +``` diff --git a/.agents/skills/cli-compute/references/read-function-graph.md b/.agents/skills/cli-compute/references/read-function-graph.md new file mode 100644 index 0000000000..41d35baa4c --- /dev/null +++ b/.agents/skills/cli-compute/references/read-function-graph.md @@ -0,0 +1,19 @@ +# readFunctionGraph + + + +Execute the readFunctionGraph query + +## Usage + +```bash +csdk read-function-graph --graphId +``` + +## Examples + +### Run readFunctionGraph + +```bash +csdk read-function-graph --graphId +``` diff --git a/.agents/skills/cli-compute/references/save-graph.md b/.agents/skills/cli-compute/references/save-graph.md new file mode 100644 index 0000000000..21e30372dd --- /dev/null +++ b/.agents/skills/cli-compute/references/save-graph.md @@ -0,0 +1,19 @@ +# saveGraph + + + +Execute the saveGraph mutation + +## Usage + +```bash +csdk save-graph --input.clientMutationId --input.graphId --input.rootHash --input.message +``` + +## Examples + +### Run saveGraph + +```bash +csdk save-graph --input.clientMutationId --input.graphId --input.rootHash --input.message +``` diff --git a/.agents/skills/cli-compute/references/secret-definition.md b/.agents/skills/cli-compute/references/secret-definition.md new file mode 100644 index 0000000000..f4e5552e82 --- /dev/null +++ b/.agents/skills/cli-compute/references/secret-definition.md @@ -0,0 +1,68 @@ +# secretDefinition + + + +CRUD operations for SecretDefinition records via csdk CLI + +## Usage + +```bash +csdk secret-definition list +csdk secret-definition list --where.. --orderBy +csdk secret-definition list --limit 10 --after +csdk secret-definition find-first --where.. +csdk secret-definition get --id +csdk secret-definition create --name --databaseId [--description ] [--isBuiltIn ] [--labels ] [--annotations ] +csdk secret-definition update --id [--name ] [--description ] [--isBuiltIn ] [--labels ] [--annotations ] [--databaseId ] +csdk secret-definition delete --id +``` + +## Examples + +### List secretDefinition records + +```bash +csdk secret-definition list +``` + +### List secretDefinition records with pagination + +```bash +csdk secret-definition list --limit 10 --offset 0 +``` + +### List secretDefinition records with cursor pagination + +```bash +csdk secret-definition list --limit 10 --after +``` + +### Find first matching secretDefinition + +```bash +csdk secret-definition find-first --where.id.equalTo +``` + +### List secretDefinition records with field selection + +```bash +csdk secret-definition list --select id,id +``` + +### List secretDefinition records with filtering and ordering + +```bash +csdk secret-definition list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a secretDefinition + +```bash +csdk secret-definition create --name --databaseId [--description ] [--isBuiltIn ] [--labels ] [--annotations ] +``` + +### Get a secretDefinition by id + +```bash +csdk secret-definition get --id +``` diff --git a/.agents/skills/cli-compute/references/set-data-at-path.md b/.agents/skills/cli-compute/references/set-data-at-path.md new file mode 100644 index 0000000000..0b30c6a3ab --- /dev/null +++ b/.agents/skills/cli-compute/references/set-data-at-path.md @@ -0,0 +1,19 @@ +# setDataAtPath + + + +Execute the setDataAtPath mutation + +## Usage + +```bash +csdk set-data-at-path --input.clientMutationId --input.sId --input.root --input.path --input.data +``` + +## Examples + +### Run setDataAtPath + +```bash +csdk set-data-at-path --input.clientMutationId --input.sId --input.root --input.path --input.data +``` diff --git a/.agents/skills/cli-compute/references/start-execution.md b/.agents/skills/cli-compute/references/start-execution.md new file mode 100644 index 0000000000..745d5789f9 --- /dev/null +++ b/.agents/skills/cli-compute/references/start-execution.md @@ -0,0 +1,19 @@ +# startExecution + + + +Execute the startExecution mutation + +## Usage + +```bash +csdk start-execution --input.clientMutationId --input.graphId --input.inputPayload --input.outputNode --input.outputPort --input.maxTicks --input.maxPendingJobs --input.timeoutInterval --input.parentExecutionId --input.parentNodeName +``` + +## Examples + +### Run startExecution + +```bash +csdk start-execution --input.clientMutationId --input.graphId --input.inputPayload --input.outputNode --input.outputPort --input.maxTicks --input.maxPendingJobs --input.timeoutInterval --input.parentExecutionId --input.parentNodeName +``` diff --git a/.agents/skills/cli-compute/references/validate-function-graph.md b/.agents/skills/cli-compute/references/validate-function-graph.md new file mode 100644 index 0000000000..1f4ce6c204 --- /dev/null +++ b/.agents/skills/cli-compute/references/validate-function-graph.md @@ -0,0 +1,19 @@ +# validateFunctionGraph + + + +Execute the validateFunctionGraph mutation + +## Usage + +```bash +csdk validate-function-graph --input.clientMutationId --input.graphId +``` + +## Examples + +### Run validateFunctionGraph + +```bash +csdk validate-function-graph --input.clientMutationId --input.graphId +``` diff --git a/.agents/skills/cli-config/SKILL.md b/.agents/skills/cli-config/SKILL.md new file mode 100644 index 0000000000..d5d0e5b939 --- /dev/null +++ b/.agents/skills/cli-config/SKILL.md @@ -0,0 +1,69 @@ +--- +name: cli-config +description: CLI tool (csdk) for the config API — provides CRUD commands for 2 tables and 9 custom operations +--- + +# cli-config + + + +CLI tool (csdk) for the config API — provides CRUD commands for 2 tables and 9 custom operations + +## Usage + +```bash +# Context management +csdk context create --endpoint +csdk context use + +# Authentication +csdk auth set-token + +# Config variables +csdk config set +csdk config get + +# CRUD for any table (e.g. platform-config-definition) +csdk platform-config-definition list +csdk platform-config-definition get --id +csdk platform-config-definition create -- + +# Non-interactive mode (skip all prompts, use flags only) +csdk --no-tty platform-config-definition list +``` + +## Examples + +### Set up and query + +```bash +csdk context create local --endpoint http://localhost:5000/graphql +csdk context use local +csdk auth set-token +csdk platform-config-definition list +``` + +### Non-interactive mode (for scripts and CI) + +```bash +csdk --no-tty platform-config-definition create -- +``` + +## References + +See the `references/` directory for detailed per-entity API documentation: + +- [context](references/context.md) +- [auth](references/auth.md) +- [config](references/config.md) +- [platform-config-definition](references/platform-config-definition.md) +- [platform-config](references/platform-config.md) +- [platform-secrets-del](references/platform-secrets-del.md) +- [org-secrets-del](references/org-secrets-del.md) +- [platform-secrets-remove-array](references/platform-secrets-remove-array.md) +- [org-secrets-remove-array](references/org-secrets-remove-array.md) +- [platform-secrets-rotate](references/platform-secrets-rotate.md) +- [platform-secrets-set](references/platform-secrets-set.md) +- [org-secrets-rotate](references/org-secrets-rotate.md) +- [org-secrets-set](references/org-secrets-set.md) +- [provision-bucket](references/provision-bucket.md) diff --git a/.agents/skills/cli-config/references/auth.md b/.agents/skills/cli-config/references/auth.md new file mode 100644 index 0000000000..d24ec20dd5 --- /dev/null +++ b/.agents/skills/cli-config/references/auth.md @@ -0,0 +1,27 @@ +# Authentication + + + +Manage authentication tokens for csdk + +## Usage + +```bash +csdk auth set-token +csdk auth status +csdk auth logout +``` + +## Examples + +### Authenticate with a token + +```bash +csdk auth set-token eyJhbGciOiJIUzI1NiIs... +``` + +### Check auth status + +```bash +csdk auth status +``` diff --git a/.agents/skills/cli-config/references/config.md b/.agents/skills/cli-config/references/config.md new file mode 100644 index 0000000000..cc1c23b7ba --- /dev/null +++ b/.agents/skills/cli-config/references/config.md @@ -0,0 +1,29 @@ +# Config Variables + + + +Manage per-context key-value configuration variables for csdk + +## Usage + +```bash +csdk config get +csdk config set +csdk config list +csdk config delete +``` + +## Examples + +### Store and retrieve a config variable + +```bash +csdk config set orgId abc-123 +csdk config get orgId +``` + +### List all config variables + +```bash +csdk config list +``` diff --git a/.agents/skills/cli-config/references/context.md b/.agents/skills/cli-config/references/context.md new file mode 100644 index 0000000000..704ff09111 --- /dev/null +++ b/.agents/skills/cli-config/references/context.md @@ -0,0 +1,30 @@ +# Context Management + + + +Manage API endpoint contexts for csdk + +## Usage + +```bash +csdk context create --endpoint +csdk context list +csdk context use +csdk context current +csdk context delete +``` + +## Examples + +### Create and activate a context + +```bash +csdk context create production --endpoint https://api.example.com/graphql +csdk context use production +``` + +### List all contexts + +```bash +csdk context list +``` diff --git a/.agents/skills/cli-config/references/org-secrets-del.md b/.agents/skills/cli-config/references/org-secrets-del.md new file mode 100644 index 0000000000..114e99a8b5 --- /dev/null +++ b/.agents/skills/cli-config/references/org-secrets-del.md @@ -0,0 +1,19 @@ +# orgSecretsDel + + + +Execute the orgSecretsDel mutation + +## Usage + +```bash +csdk org-secrets-del --input.clientMutationId --input.ownerId --input.secretName --input.namespaceId +``` + +## Examples + +### Run orgSecretsDel + +```bash +csdk org-secrets-del --input.clientMutationId --input.ownerId --input.secretName --input.namespaceId +``` diff --git a/.agents/skills/cli-config/references/org-secrets-remove-array.md b/.agents/skills/cli-config/references/org-secrets-remove-array.md new file mode 100644 index 0000000000..84857516ed --- /dev/null +++ b/.agents/skills/cli-config/references/org-secrets-remove-array.md @@ -0,0 +1,19 @@ +# orgSecretsRemoveArray + + + +Execute the orgSecretsRemoveArray mutation + +## Usage + +```bash +csdk org-secrets-remove-array --input.clientMutationId --input.ownerId --input.secretNames --input.namespaceId +``` + +## Examples + +### Run orgSecretsRemoveArray + +```bash +csdk org-secrets-remove-array --input.clientMutationId --input.ownerId --input.secretNames --input.namespaceId +``` diff --git a/.agents/skills/cli-config/references/org-secrets-rotate.md b/.agents/skills/cli-config/references/org-secrets-rotate.md new file mode 100644 index 0000000000..f02b7a9f6f --- /dev/null +++ b/.agents/skills/cli-config/references/org-secrets-rotate.md @@ -0,0 +1,19 @@ +# orgSecretsRotate + + + +Execute the orgSecretsRotate mutation + +## Usage + +```bash +csdk org-secrets-rotate --input.clientMutationId --input.ownerId --input.secretName --input.secretValue --input.namespaceId --input.algo +``` + +## Examples + +### Run orgSecretsRotate + +```bash +csdk org-secrets-rotate --input.clientMutationId --input.ownerId --input.secretName --input.secretValue --input.namespaceId --input.algo +``` diff --git a/.agents/skills/cli-config/references/org-secrets-set.md b/.agents/skills/cli-config/references/org-secrets-set.md new file mode 100644 index 0000000000..5f7873c56e --- /dev/null +++ b/.agents/skills/cli-config/references/org-secrets-set.md @@ -0,0 +1,19 @@ +# orgSecretsSet + + + +Execute the orgSecretsSet mutation + +## Usage + +```bash +csdk org-secrets-set --input.clientMutationId --input.scopeOwnerId --input.secretName --input.secretValue --input.secretNamespaceId --input.algo +``` + +## Examples + +### Run orgSecretsSet + +```bash +csdk org-secrets-set --input.clientMutationId --input.scopeOwnerId --input.secretName --input.secretValue --input.secretNamespaceId --input.algo +``` diff --git a/.agents/skills/cli-config/references/platform-config-definition.md b/.agents/skills/cli-config/references/platform-config-definition.md new file mode 100644 index 0000000000..472c8d594c --- /dev/null +++ b/.agents/skills/cli-config/references/platform-config-definition.md @@ -0,0 +1,68 @@ +# platformConfigDefinition + + + +CRUD operations for PlatformConfigDefinition records via csdk CLI + +## Usage + +```bash +csdk platform-config-definition list +csdk platform-config-definition list --where.. --orderBy +csdk platform-config-definition list --limit 10 --after +csdk platform-config-definition find-first --where.. +csdk platform-config-definition get --id +csdk platform-config-definition create --name [--description ] [--defaultValue ] [--isBuiltIn ] [--labels ] [--annotations ] +csdk platform-config-definition update --id [--name ] [--description ] [--defaultValue ] [--isBuiltIn ] [--labels ] [--annotations ] +csdk platform-config-definition delete --id +``` + +## Examples + +### List platformConfigDefinition records + +```bash +csdk platform-config-definition list +``` + +### List platformConfigDefinition records with pagination + +```bash +csdk platform-config-definition list --limit 10 --offset 0 +``` + +### List platformConfigDefinition records with cursor pagination + +```bash +csdk platform-config-definition list --limit 10 --after +``` + +### Find first matching platformConfigDefinition + +```bash +csdk platform-config-definition find-first --where.id.equalTo +``` + +### List platformConfigDefinition records with field selection + +```bash +csdk platform-config-definition list --select id,id +``` + +### List platformConfigDefinition records with filtering and ordering + +```bash +csdk platform-config-definition list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a platformConfigDefinition + +```bash +csdk platform-config-definition create --name [--description ] [--defaultValue ] [--isBuiltIn ] [--labels ] [--annotations ] +``` + +### Get a platformConfigDefinition by id + +```bash +csdk platform-config-definition get --id +``` diff --git a/.agents/skills/cli-config/references/platform-config.md b/.agents/skills/cli-config/references/platform-config.md new file mode 100644 index 0000000000..7f130c97ac --- /dev/null +++ b/.agents/skills/cli-config/references/platform-config.md @@ -0,0 +1,68 @@ +# platformConfig + + + +CRUD operations for PlatformConfig records via csdk CLI + +## Usage + +```bash +csdk platform-config list +csdk platform-config list --where.. --orderBy +csdk platform-config list --limit 10 --after +csdk platform-config find-first --where.. +csdk platform-config get --id +csdk platform-config create --namespaceId --name [--value ] [--labels ] [--annotations ] [--description ] [--expiresAt ] +csdk platform-config update --id [--namespaceId ] [--name ] [--value ] [--labels ] [--annotations ] [--description ] [--expiresAt ] +csdk platform-config delete --id +``` + +## Examples + +### List platformConfig records + +```bash +csdk platform-config list +``` + +### List platformConfig records with pagination + +```bash +csdk platform-config list --limit 10 --offset 0 +``` + +### List platformConfig records with cursor pagination + +```bash +csdk platform-config list --limit 10 --after +``` + +### Find first matching platformConfig + +```bash +csdk platform-config find-first --where.id.equalTo +``` + +### List platformConfig records with field selection + +```bash +csdk platform-config list --select id,id +``` + +### List platformConfig records with filtering and ordering + +```bash +csdk platform-config list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a platformConfig + +```bash +csdk platform-config create --namespaceId --name [--value ] [--labels ] [--annotations ] [--description ] [--expiresAt ] +``` + +### Get a platformConfig by id + +```bash +csdk platform-config get --id +``` diff --git a/.agents/skills/cli-config/references/platform-secrets-del.md b/.agents/skills/cli-config/references/platform-secrets-del.md new file mode 100644 index 0000000000..fba871797c --- /dev/null +++ b/.agents/skills/cli-config/references/platform-secrets-del.md @@ -0,0 +1,19 @@ +# platformSecretsDel + + + +Execute the platformSecretsDel mutation + +## Usage + +```bash +csdk platform-secrets-del --input.clientMutationId --input.secretName --input.namespaceId +``` + +## Examples + +### Run platformSecretsDel + +```bash +csdk platform-secrets-del --input.clientMutationId --input.secretName --input.namespaceId +``` diff --git a/.agents/skills/cli-config/references/platform-secrets-remove-array.md b/.agents/skills/cli-config/references/platform-secrets-remove-array.md new file mode 100644 index 0000000000..ede6022035 --- /dev/null +++ b/.agents/skills/cli-config/references/platform-secrets-remove-array.md @@ -0,0 +1,19 @@ +# platformSecretsRemoveArray + + + +Execute the platformSecretsRemoveArray mutation + +## Usage + +```bash +csdk platform-secrets-remove-array --input.clientMutationId --input.secretNames --input.namespaceId +``` + +## Examples + +### Run platformSecretsRemoveArray + +```bash +csdk platform-secrets-remove-array --input.clientMutationId --input.secretNames --input.namespaceId +``` diff --git a/.agents/skills/cli-config/references/platform-secrets-rotate.md b/.agents/skills/cli-config/references/platform-secrets-rotate.md new file mode 100644 index 0000000000..323db45a36 --- /dev/null +++ b/.agents/skills/cli-config/references/platform-secrets-rotate.md @@ -0,0 +1,19 @@ +# platformSecretsRotate + + + +Execute the platformSecretsRotate mutation + +## Usage + +```bash +csdk platform-secrets-rotate --input.clientMutationId --input.secretName --input.secretValue --input.namespaceId --input.algo +``` + +## Examples + +### Run platformSecretsRotate + +```bash +csdk platform-secrets-rotate --input.clientMutationId --input.secretName --input.secretValue --input.namespaceId --input.algo +``` diff --git a/.agents/skills/cli-config/references/platform-secrets-set.md b/.agents/skills/cli-config/references/platform-secrets-set.md new file mode 100644 index 0000000000..035caa95c5 --- /dev/null +++ b/.agents/skills/cli-config/references/platform-secrets-set.md @@ -0,0 +1,19 @@ +# platformSecretsSet + + + +Execute the platformSecretsSet mutation + +## Usage + +```bash +csdk platform-secrets-set --input.clientMutationId --input.secretName --input.secretValue --input.secretNamespaceId --input.algo +``` + +## Examples + +### Run platformSecretsSet + +```bash +csdk platform-secrets-set --input.clientMutationId --input.secretName --input.secretValue --input.secretNamespaceId --input.algo +``` diff --git a/.agents/skills/cli-config/references/provision-bucket.md b/.agents/skills/cli-config/references/provision-bucket.md new file mode 100644 index 0000000000..cc17ffbc21 --- /dev/null +++ b/.agents/skills/cli-config/references/provision-bucket.md @@ -0,0 +1,22 @@ +# provisionBucket + + + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +## Usage + +```bash +csdk provision-bucket --input.bucketKey --input.ownerId +``` + +## Examples + +### Run provisionBucket + +```bash +csdk provision-bucket --input.bucketKey --input.ownerId +``` diff --git a/.agents/skills/cli-modules/SKILL.md b/.agents/skills/cli-modules/SKILL.md index c9266ba353..80381ca57a 100644 --- a/.agents/skills/cli-modules/SKILL.md +++ b/.agents/skills/cli-modules/SKILL.md @@ -1,13 +1,13 @@ --- name: cli-modules -description: CLI tool (csdk) for the modules API — provides CRUD commands for 57 tables and 12 custom operations +description: CLI tool (csdk) for the modules API — provides CRUD commands for 59 tables and 12 custom operations --- # cli-modules -CLI tool (csdk) for the modules API — provides CRUD commands for 57 tables and 12 custom operations +CLI tool (csdk) for the modules API — provides CRUD commands for 59 tables and 12 custom operations ## Usage @@ -92,14 +92,16 @@ See the `references/` directory for detailed per-entity API documentation: - [function-invocation-module](references/function-invocation-module.md) - [function-module](references/function-module.md) - [invites-module](references/invites-module.md) -- [namespace-module](references/namespace-module.md) - [compute-log-module](references/compute-log-module.md) - [inference-log-module](references/inference-log-module.md) +- [namespace-module](references/namespace-module.md) - [storage-log-module](references/storage-log-module.md) - [transfer-log-module](references/transfer-log-module.md) +- [function-deployment-module](references/function-deployment-module.md) - [plans-module](references/plans-module.md) - [billing-provider-module](references/billing-provider-module.md) - [db-usage-module](references/db-usage-module.md) +- [graph-execution-module](references/graph-execution-module.md) - [hierarchy-module](references/hierarchy-module.md) - [permissions-module](references/permissions-module.md) - [notifications-module](references/notifications-module.md) diff --git a/.agents/skills/cli-modules/references/function-deployment-module.md b/.agents/skills/cli-modules/references/function-deployment-module.md new file mode 100644 index 0000000000..8505c67ff1 --- /dev/null +++ b/.agents/skills/cli-modules/references/function-deployment-module.md @@ -0,0 +1,68 @@ +# functionDeploymentModule + + + +CRUD operations for FunctionDeploymentModule records via csdk CLI + +## Usage + +```bash +csdk function-deployment-module list +csdk function-deployment-module list --where.. --orderBy +csdk function-deployment-module list --limit 10 --after +csdk function-deployment-module find-first --where.. +csdk function-deployment-module get --id +csdk function-deployment-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--deploymentsTableId ] [--deploymentEventsTableId ] [--deploymentsTableName ] [--deploymentEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--functionModuleId ] [--namespaceModuleId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk function-deployment-module update --id [--databaseId ] [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--deploymentsTableId ] [--deploymentEventsTableId ] [--deploymentsTableName ] [--deploymentEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--functionModuleId ] [--namespaceModuleId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk function-deployment-module delete --id +``` + +## Examples + +### List functionDeploymentModule records + +```bash +csdk function-deployment-module list +``` + +### List functionDeploymentModule records with pagination + +```bash +csdk function-deployment-module list --limit 10 --offset 0 +``` + +### List functionDeploymentModule records with cursor pagination + +```bash +csdk function-deployment-module list --limit 10 --after +``` + +### Find first matching functionDeploymentModule + +```bash +csdk function-deployment-module find-first --where.id.equalTo +``` + +### List functionDeploymentModule records with field selection + +```bash +csdk function-deployment-module list --select id,id +``` + +### List functionDeploymentModule records with filtering and ordering + +```bash +csdk function-deployment-module list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a functionDeploymentModule + +```bash +csdk function-deployment-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--deploymentsTableId ] [--deploymentEventsTableId ] [--deploymentsTableName ] [--deploymentEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--functionModuleId ] [--namespaceModuleId ] [--policies ] [--provisions ] [--defaultPermissions ] +``` + +### Get a functionDeploymentModule by id + +```bash +csdk function-deployment-module get --id +``` diff --git a/.agents/skills/cli-modules/references/graph-execution-module.md b/.agents/skills/cli-modules/references/graph-execution-module.md new file mode 100644 index 0000000000..50ee7ff321 --- /dev/null +++ b/.agents/skills/cli-modules/references/graph-execution-module.md @@ -0,0 +1,68 @@ +# graphExecutionModule + + + +CRUD operations for GraphExecutionModule records via csdk CLI + +## Usage + +```bash +csdk graph-execution-module list +csdk graph-execution-module list --where.. --orderBy +csdk graph-execution-module list --limit 10 --after +csdk graph-execution-module find-first --where.. +csdk graph-execution-module get --id +csdk graph-execution-module create --databaseId --graphModuleId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--executionsTableId ] [--outputsTableId ] [--nodeStatesTableId ] [--executionsTableName ] [--outputsTableName ] [--nodeStatesTableName ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk graph-execution-module update --id [--databaseId ] [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--graphModuleId ] [--scope ] [--prefix ] [--executionsTableId ] [--outputsTableId ] [--nodeStatesTableId ] [--executionsTableName ] [--outputsTableName ] [--nodeStatesTableName ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk graph-execution-module delete --id +``` + +## Examples + +### List graphExecutionModule records + +```bash +csdk graph-execution-module list +``` + +### List graphExecutionModule records with pagination + +```bash +csdk graph-execution-module list --limit 10 --offset 0 +``` + +### List graphExecutionModule records with cursor pagination + +```bash +csdk graph-execution-module list --limit 10 --after +``` + +### Find first matching graphExecutionModule + +```bash +csdk graph-execution-module find-first --where.id.equalTo +``` + +### List graphExecutionModule records with field selection + +```bash +csdk graph-execution-module list --select id,id +``` + +### List graphExecutionModule records with filtering and ordering + +```bash +csdk graph-execution-module list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a graphExecutionModule + +```bash +csdk graph-execution-module create --databaseId --graphModuleId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--executionsTableId ] [--outputsTableId ] [--nodeStatesTableId ] [--executionsTableName ] [--outputsTableName ] [--nodeStatesTableName ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +``` + +### Get a graphExecutionModule by id + +```bash +csdk graph-execution-module get --id +``` diff --git a/.agents/skills/cli-modules/references/graph-module.md b/.agents/skills/cli-modules/references/graph-module.md index 1e3135b0b6..08a6eb6294 100644 --- a/.agents/skills/cli-modules/references/graph-module.md +++ b/.agents/skills/cli-modules/references/graph-module.md @@ -12,8 +12,8 @@ csdk graph-module list --where.. --orderBy csdk graph-module list --limit 10 --after csdk graph-module find-first --where.. csdk graph-module get --id -csdk graph-module create --databaseId --merkleStoreModuleId [--publicSchemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--graphsTableId ] [--executionsTableId ] [--outputsTableId ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] -csdk graph-module update --id [--databaseId ] [--publicSchemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--merkleStoreModuleId ] [--graphsTableId ] [--executionsTableId ] [--outputsTableId ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk graph-module create --databaseId --merkleStoreModuleId [--publicSchemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--graphsTableId ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk graph-module update --id [--databaseId ] [--publicSchemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--merkleStoreModuleId ] [--graphsTableId ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] csdk graph-module delete --id ``` @@ -58,7 +58,7 @@ csdk graph-module list --where.id.equalTo --orderBy ID_ASC ### Create a graphModule ```bash -csdk graph-module create --databaseId --merkleStoreModuleId [--publicSchemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--graphsTableId ] [--executionsTableId ] [--outputsTableId ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk graph-module create --databaseId --merkleStoreModuleId [--publicSchemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--scope ] [--prefix ] [--graphsTableId ] [--apiName ] [--privateApiName ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] ``` ### Get a graphModule by id diff --git a/.agents/skills/cli-modules/references/namespace-module.md b/.agents/skills/cli-modules/references/namespace-module.md index 0d810a3da1..1216834f4e 100644 --- a/.agents/skills/cli-modules/references/namespace-module.md +++ b/.agents/skills/cli-modules/references/namespace-module.md @@ -12,8 +12,8 @@ csdk namespace-module list --where.. --orderBy csdk namespace-module list --limit 10 --after csdk namespace-module find-first --where.. csdk namespace-module get --id -csdk namespace-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--namespacesTableId ] [--namespaceEventsTableId ] [--namespacesTableName ] [--namespaceEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] -csdk namespace-module update --id [--databaseId ] [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--namespacesTableId ] [--namespaceEventsTableId ] [--namespacesTableName ] [--namespaceEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk namespace-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--namespacesTableId ] [--namespaceEventsTableId ] [--namespacesTableName ] [--namespaceEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--platformNamespacesTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk namespace-module update --id [--databaseId ] [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--namespacesTableId ] [--namespaceEventsTableId ] [--namespacesTableName ] [--namespaceEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--platformNamespacesTableId ] [--policies ] [--provisions ] [--defaultPermissions ] csdk namespace-module delete --id ``` @@ -58,7 +58,7 @@ csdk namespace-module list --where.id.equalTo --orderBy ID_ASC ### Create a namespaceModule ```bash -csdk namespace-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--namespacesTableId ] [--namespaceEventsTableId ] [--namespacesTableName ] [--namespaceEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--policies ] [--provisions ] [--defaultPermissions ] +csdk namespace-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--namespacesTableId ] [--namespaceEventsTableId ] [--namespacesTableName ] [--namespaceEventsTableName ] [--apiName ] [--privateApiName ] [--scope ] [--prefix ] [--entityTableId ] [--platformNamespacesTableId ] [--policies ] [--provisions ] [--defaultPermissions ] ``` ### Get a namespaceModule by id diff --git a/.agents/skills/hooks-api/references/schema.md b/.agents/skills/hooks-api/references/schema.md index dc0804c3ec..d1c3cd5417 100644 --- a/.agents/skills/hooks-api/references/schema.md +++ b/.agents/skills/hooks-api/references/schema.md @@ -7,8 +7,8 @@ React Query hooks for Schema data operations ## Usage ```typescript -useSchemasQuery({ selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } } }) -useSchemaQuery({ id: '', selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } } }) +useSchemasQuery({ selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } } }) +useSchemaQuery({ id: '', selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } } }) useCreateSchemaMutation({ selection: { fields: { id: true } } }) useUpdateSchemaMutation({ selection: { fields: { id: true } } }) useDeleteSchemaMutation({}) @@ -20,7 +20,7 @@ useDeleteSchemaMutation({}) ```typescript const { data, isLoading } = useSchemasQuery({ - selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }, + selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useSchemasQuery({ const { mutate } = useCreateSchemaMutation({ selection: { fields: { id: true } }, }); -mutate({ databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '' }); +mutate({ databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '', apiExposure: '' }); ``` diff --git a/.agents/skills/hooks-compute/SKILL.md b/.agents/skills/hooks-compute/SKILL.md new file mode 100644 index 0000000000..fc29567e16 --- /dev/null +++ b/.agents/skills/hooks-compute/SKILL.md @@ -0,0 +1,73 @@ +--- +name: hooks-compute +description: React Query hooks for the compute API — provides typed query and mutation hooks for 18 tables and 15 custom operations +--- + +# hooks-compute + + + +React Query hooks for the compute API — provides typed query and mutation hooks for 18 tables and 15 custom operations + +## Usage + +```typescript +// Import hooks +import { useGetAllQuery } from './hooks'; + +// Query hooks: useQuery, usesQuery +// Mutation hooks: useCreateMutation, useUpdateMutation, useDeleteMutation +// Bulk mutation hooks (when enabled): useBulkCreateMutation, useBulkUpsertMutation, etc. + +const { data, isLoading } = useGetAllQuery({ + selection: { fields: { id: true } }, +}); +``` + +## Examples + +### Query records + +```typescript +const { data, isLoading } = useGetAllQuery({ + selection: { fields: { id: true } }, +}); +``` + +## References + +See the `references/` directory for detailed per-entity API documentation: + +- [get-all-record](references/get-all-record.md) +- [function-api-binding](references/function-api-binding.md) +- [function-deployment](references/function-deployment.md) +- [function-graph-ref](references/function-graph-ref.md) +- [function-graph-store](references/function-graph-store.md) +- [function-graph-object](references/function-graph-object.md) +- [function-deployment-event](references/function-deployment-event.md) +- [org-function-execution-log](references/org-function-execution-log.md) +- [function-graph-execution-output](references/function-graph-execution-output.md) +- [function-graph-commit](references/function-graph-commit.md) +- [secret-definition](references/secret-definition.md) +- [function-execution-log](references/function-execution-log.md) +- [function-graph-execution-node-state](references/function-graph-execution-node-state.md) +- [function-graph](references/function-graph.md) +- [org-function-invocation](references/org-function-invocation.md) +- [function-invocation](references/function-invocation.md) +- [function-graph-execution](references/function-graph-execution.md) +- [function-definition](references/function-definition.md) +- [read-function-graph](references/read-function-graph.md) +- [validate-function-graph](references/validate-function-graph.md) +- [init-empty-repo](references/init-empty-repo.md) +- [set-data-at-path](references/set-data-at-path.md) +- [import-definitions](references/import-definitions.md) +- [copy-graph](references/copy-graph.md) +- [save-graph](references/save-graph.md) +- [add-edge-and-save](references/add-edge-and-save.md) +- [add-node-and-save](references/add-node-and-save.md) +- [add-edge](references/add-edge.md) +- [add-node](references/add-node.md) +- [import-graph-json](references/import-graph-json.md) +- [insert-node-at-path](references/insert-node-at-path.md) +- [start-execution](references/start-execution.md) +- [provision-bucket](references/provision-bucket.md) diff --git a/.agents/skills/hooks-compute/references/add-edge-and-save.md b/.agents/skills/hooks-compute/references/add-edge-and-save.md new file mode 100644 index 0000000000..c20ccc9d4c --- /dev/null +++ b/.agents/skills/hooks-compute/references/add-edge-and-save.md @@ -0,0 +1,20 @@ +# addEdgeAndSave + + + +React Query mutation hook for addEdgeAndSave + +## Usage + +```typescript +const { mutate } = useAddEdgeAndSaveMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useAddEdgeAndSaveMutation + +```typescript +const { mutate, isLoading } = useAddEdgeAndSaveMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/add-edge.md b/.agents/skills/hooks-compute/references/add-edge.md new file mode 100644 index 0000000000..9abeaf2232 --- /dev/null +++ b/.agents/skills/hooks-compute/references/add-edge.md @@ -0,0 +1,20 @@ +# addEdge + + + +React Query mutation hook for addEdge + +## Usage + +```typescript +const { mutate } = useAddEdgeMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useAddEdgeMutation + +```typescript +const { mutate, isLoading } = useAddEdgeMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/add-node-and-save.md b/.agents/skills/hooks-compute/references/add-node-and-save.md new file mode 100644 index 0000000000..b2f26dff12 --- /dev/null +++ b/.agents/skills/hooks-compute/references/add-node-and-save.md @@ -0,0 +1,20 @@ +# addNodeAndSave + + + +React Query mutation hook for addNodeAndSave + +## Usage + +```typescript +const { mutate } = useAddNodeAndSaveMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useAddNodeAndSaveMutation + +```typescript +const { mutate, isLoading } = useAddNodeAndSaveMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/add-node.md b/.agents/skills/hooks-compute/references/add-node.md new file mode 100644 index 0000000000..6c268355b2 --- /dev/null +++ b/.agents/skills/hooks-compute/references/add-node.md @@ -0,0 +1,20 @@ +# addNode + + + +React Query mutation hook for addNode + +## Usage + +```typescript +const { mutate } = useAddNodeMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useAddNodeMutation + +```typescript +const { mutate, isLoading } = useAddNodeMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/copy-graph.md b/.agents/skills/hooks-compute/references/copy-graph.md new file mode 100644 index 0000000000..6c26645ef4 --- /dev/null +++ b/.agents/skills/hooks-compute/references/copy-graph.md @@ -0,0 +1,20 @@ +# copyGraph + + + +React Query mutation hook for copyGraph + +## Usage + +```typescript +const { mutate } = useCopyGraphMutation(); mutate({ input: { databaseId: '', graphId: '', name: '' } }); +``` + +## Examples + +### Use useCopyGraphMutation + +```typescript +const { mutate, isLoading } = useCopyGraphMutation(); +mutate({ input: { databaseId: '', graphId: '', name: '' } }); +``` diff --git a/.agents/skills/hooks-compute/references/function-api-binding.md b/.agents/skills/hooks-compute/references/function-api-binding.md new file mode 100644 index 0000000000..58ed1e80b6 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-api-binding.md @@ -0,0 +1,34 @@ +# functionApiBinding + + + +Join table binding function definitions to API endpoints with per-binding alias and config + +## Usage + +```typescript +useFunctionApiBindingsQuery({ selection: { fields: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } } }) +useFunctionApiBindingQuery({ id: '', selection: { fields: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } } }) +useCreateFunctionApiBindingMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionApiBindingMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionApiBindingMutation({}) +``` + +## Examples + +### List all functionApiBindings + +```typescript +const { data, isLoading } = useFunctionApiBindingsQuery({ + selection: { fields: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }, +}); +``` + +### Create a functionApiBinding + +```typescript +const { mutate } = useCreateFunctionApiBindingMutation({ + selection: { fields: { id: true } }, +}); +mutate({ functionDefinitionId: '', apiId: '', alias: '', config: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-definition.md b/.agents/skills/hooks-compute/references/function-definition.md new file mode 100644 index 0000000000..95a4548351 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-definition.md @@ -0,0 +1,34 @@ +# functionDefinition + + + +Function definitions — registered cloud functions with routing, queue, and retry configuration + +## Usage + +```typescript +useFunctionDefinitionsQuery({ selection: { fields: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } } }) +useFunctionDefinitionQuery({ id: '', selection: { fields: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } } }) +useCreateFunctionDefinitionMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionDefinitionMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionDefinitionMutation({}) +``` + +## Examples + +### List all functionDefinitions + +```typescript +const { data, isLoading } = useFunctionDefinitionsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }, +}); +``` + +### Create a functionDefinition + +```typescript +const { mutate } = useCreateFunctionDefinitionMutation({ + selection: { fields: { id: true } }, +}); +mutate({ scope: '', name: '', taskIdentifier: '', description: '', isInvocable: '', maxAttempts: '', priority: '', queueName: '', runtime: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', isBuiltIn: '', requiredSecrets: '', requiredConfigs: '', requiredBuckets: '', requiredModels: '', inputs: '', outputs: '', props: '', volatile: '', icon: '', category: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-deployment-event.md b/.agents/skills/hooks-compute/references/function-deployment-event.md new file mode 100644 index 0000000000..d1cf8d0861 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-deployment-event.md @@ -0,0 +1,34 @@ +# functionDeploymentEvent + + + +Deployment lifecycle events — audit log of provisioning, scaling, and failure events + +## Usage + +```typescript +useFunctionDeploymentEventsQuery({ selection: { fields: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } } }) +useFunctionDeploymentEventQuery({ id: '', selection: { fields: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } } }) +useCreateFunctionDeploymentEventMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionDeploymentEventMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionDeploymentEventMutation({}) +``` + +## Examples + +### List all functionDeploymentEvents + +```typescript +const { data, isLoading } = useFunctionDeploymentEventsQuery({ + selection: { fields: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }, +}); +``` + +### Create a functionDeploymentEvent + +```typescript +const { mutate } = useCreateFunctionDeploymentEventMutation({ + selection: { fields: { id: true } }, +}); +mutate({ deploymentId: '', eventType: '', actorId: '', message: '', metadata: '', databaseId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-deployment.md b/.agents/skills/hooks-compute/references/function-deployment.md new file mode 100644 index 0000000000..b86ca97978 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-deployment.md @@ -0,0 +1,34 @@ +# functionDeployment + + + +Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + +## Usage + +```typescript +useFunctionDeploymentsQuery({ selection: { fields: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } } }) +useFunctionDeploymentQuery({ id: '', selection: { fields: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } } }) +useCreateFunctionDeploymentMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionDeploymentMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionDeploymentMutation({}) +``` + +## Examples + +### List all functionDeployments + +```typescript +const { data, isLoading } = useFunctionDeploymentsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }, +}); +``` + +### Create a functionDeployment + +```typescript +const { mutate } = useCreateFunctionDeploymentMutation({ + selection: { fields: { id: true } }, +}); +mutate({ functionDefinitionId: '', namespaceId: '', status: '', serviceUrl: '', serviceName: '', revision: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', lastError: '', lastErrorAt: '', errorCount: '', labels: '', annotations: '', databaseId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-execution-log.md b/.agents/skills/hooks-compute/references/function-execution-log.md new file mode 100644 index 0000000000..a6206e8985 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-execution-log.md @@ -0,0 +1,34 @@ +# functionExecutionLog + + + +Function execution logs — structured console output per invocation + +## Usage + +```typescript +useFunctionExecutionLogsQuery({ selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } } }) +useFunctionExecutionLogQuery({ id: '', selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } } }) +useCreateFunctionExecutionLogMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionExecutionLogMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionExecutionLogMutation({}) +``` + +## Examples + +### List all functionExecutionLogs + +```typescript +const { data, isLoading } = useFunctionExecutionLogsQuery({ + selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }, +}); +``` + +### Create a functionExecutionLog + +```typescript +const { mutate } = useCreateFunctionExecutionLogMutation({ + selection: { fields: { id: true } }, +}); +mutate({ invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph-commit.md b/.agents/skills/hooks-compute/references/function-graph-commit.md new file mode 100644 index 0000000000..6e198be334 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph-commit.md @@ -0,0 +1,34 @@ +# functionGraphCommit + + + +Commit history — each commit snapshots a tree root for a store + +## Usage + +```typescript +useFunctionGraphCommitsQuery({ selection: { fields: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } } }) +useFunctionGraphCommitQuery({ id: '', selection: { fields: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } } }) +useCreateFunctionGraphCommitMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphCommitMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphCommitMutation({}) +``` + +## Examples + +### List all functionGraphCommits + +```typescript +const { data, isLoading } = useFunctionGraphCommitsQuery({ + selection: { fields: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }, +}); +``` + +### Create a functionGraphCommit + +```typescript +const { mutate } = useCreateFunctionGraphCommitMutation({ + selection: { fields: { id: true } }, +}); +mutate({ message: '', databaseId: '', storeId: '', parentIds: '', authorId: '', committerId: '', treeId: '', date: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph-execution-node-state.md b/.agents/skills/hooks-compute/references/function-graph-execution-node-state.md new file mode 100644 index 0000000000..26e3948817 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph-execution-node-state.md @@ -0,0 +1,34 @@ +# functionGraphExecutionNodeState + + + +Per-node execution state — tracks individual node lifecycle for debugging + +## Usage + +```typescript +useFunctionGraphExecutionNodeStatesQuery({ selection: { fields: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } } }) +useFunctionGraphExecutionNodeStateQuery({ id: '', selection: { fields: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } } }) +useCreateFunctionGraphExecutionNodeStateMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphExecutionNodeStateMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphExecutionNodeStateMutation({}) +``` + +## Examples + +### List all functionGraphExecutionNodeStates + +```typescript +const { data, isLoading } = useFunctionGraphExecutionNodeStatesQuery({ + selection: { fields: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }, +}); +``` + +### Create a functionGraphExecutionNodeState + +```typescript +const { mutate } = useCreateFunctionGraphExecutionNodeStateMutation({ + selection: { fields: { id: true } }, +}); +mutate({ executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph-execution-output.md b/.agents/skills/hooks-compute/references/function-graph-execution-output.md new file mode 100644 index 0000000000..111dfdde05 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph-execution-output.md @@ -0,0 +1,34 @@ +# functionGraphExecutionOutput + + + +Content-addressed store for execution outputs — hash-referenced from node_outputs + +## Usage + +```typescript +useFunctionGraphExecutionOutputsQuery({ selection: { fields: { createdAt: true, id: true, databaseId: true, hash: true, data: true } } }) +useFunctionGraphExecutionOutputQuery({ id: '', selection: { fields: { createdAt: true, id: true, databaseId: true, hash: true, data: true } } }) +useCreateFunctionGraphExecutionOutputMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphExecutionOutputMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphExecutionOutputMutation({}) +``` + +## Examples + +### List all functionGraphExecutionOutputs + +```typescript +const { data, isLoading } = useFunctionGraphExecutionOutputsQuery({ + selection: { fields: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }, +}); +``` + +### Create a functionGraphExecutionOutput + +```typescript +const { mutate } = useCreateFunctionGraphExecutionOutputMutation({ + selection: { fields: { id: true } }, +}); +mutate({ databaseId: '', hash: '', data: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph-execution.md b/.agents/skills/hooks-compute/references/function-graph-execution.md new file mode 100644 index 0000000000..6faa582082 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph-execution.md @@ -0,0 +1,34 @@ +# functionGraphExecution + + + +Ephemeral execution state for flow graph evaluation + +## Usage + +```typescript +useFunctionGraphExecutionsQuery({ selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } } }) +useFunctionGraphExecutionQuery({ id: '', selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } } }) +useCreateFunctionGraphExecutionMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphExecutionMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphExecutionMutation({}) +``` + +## Examples + +### List all functionGraphExecutions + +```typescript +const { data, isLoading } = useFunctionGraphExecutionsQuery({ + selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }, +}); +``` + +### Create a functionGraphExecution + +```typescript +const { mutate } = useCreateFunctionGraphExecutionMutation({ + selection: { fields: { id: true } }, +}); +mutate({ startedAt: '', graphId: '', invocationId: '', databaseId: '', entityId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph-object.md b/.agents/skills/hooks-compute/references/function-graph-object.md new file mode 100644 index 0000000000..7bd6a8a1bf --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph-object.md @@ -0,0 +1,34 @@ +# functionGraphObject + + + +Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + +## Usage + +```typescript +useFunctionGraphObjectsQuery({ selection: { fields: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } } }) +useFunctionGraphObjectQuery({ id: '', selection: { fields: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } } }) +useCreateFunctionGraphObjectMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphObjectMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphObjectMutation({}) +``` + +## Examples + +### List all functionGraphObjects + +```typescript +const { data, isLoading } = useFunctionGraphObjectsQuery({ + selection: { fields: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }, +}); +``` + +### Create a functionGraphObject + +```typescript +const { mutate } = useCreateFunctionGraphObjectMutation({ + selection: { fields: { id: true } }, +}); +mutate({ databaseId: '', kids: '', ktree: '', data: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph-ref.md b/.agents/skills/hooks-compute/references/function-graph-ref.md new file mode 100644 index 0000000000..26e7bcc5b9 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph-ref.md @@ -0,0 +1,34 @@ +# functionGraphRef + + + +Branch heads — mutable pointers into the commit chain + +## Usage + +```typescript +useFunctionGraphRefsQuery({ selection: { fields: { id: true, name: true, databaseId: true, storeId: true, commitId: true } } }) +useFunctionGraphRefQuery({ id: '', selection: { fields: { id: true, name: true, databaseId: true, storeId: true, commitId: true } } }) +useCreateFunctionGraphRefMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphRefMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphRefMutation({}) +``` + +## Examples + +### List all functionGraphRefs + +```typescript +const { data, isLoading } = useFunctionGraphRefsQuery({ + selection: { fields: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }, +}); +``` + +### Create a functionGraphRef + +```typescript +const { mutate } = useCreateFunctionGraphRefMutation({ + selection: { fields: { id: true } }, +}); +mutate({ name: '', databaseId: '', storeId: '', commitId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph-store.md b/.agents/skills/hooks-compute/references/function-graph-store.md new file mode 100644 index 0000000000..db38dcc17f --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph-store.md @@ -0,0 +1,34 @@ +# functionGraphStore + + + +Named stores — one per version-controlled tree (e.g. one graph, one definition set) + +## Usage + +```typescript +useFunctionGraphStoresQuery({ selection: { fields: { id: true, name: true, databaseId: true, hash: true, createdAt: true } } }) +useFunctionGraphStoreQuery({ id: '', selection: { fields: { id: true, name: true, databaseId: true, hash: true, createdAt: true } } }) +useCreateFunctionGraphStoreMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphStoreMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphStoreMutation({}) +``` + +## Examples + +### List all functionGraphStores + +```typescript +const { data, isLoading } = useFunctionGraphStoresQuery({ + selection: { fields: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }, +}); +``` + +### Create a functionGraphStore + +```typescript +const { mutate } = useCreateFunctionGraphStoreMutation({ + selection: { fields: { id: true } }, +}); +mutate({ name: '', databaseId: '', hash: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-graph.md b/.agents/skills/hooks-compute/references/function-graph.md new file mode 100644 index 0000000000..07bdcc5d38 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-graph.md @@ -0,0 +1,34 @@ +# functionGraph + + + +Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + +## Usage + +```typescript +useFunctionGraphsQuery({ selection: { fields: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } } }) +useFunctionGraphQuery({ id: '', selection: { fields: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } } }) +useCreateFunctionGraphMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionGraphMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionGraphMutation({}) +``` + +## Examples + +### List all functionGraphs + +```typescript +const { data, isLoading } = useFunctionGraphsQuery({ + selection: { fields: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }, +}); +``` + +### Create a functionGraph + +```typescript +const { mutate } = useCreateFunctionGraphMutation({ + selection: { fields: { id: true } }, +}); +mutate({ databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/function-invocation.md b/.agents/skills/hooks-compute/references/function-invocation.md new file mode 100644 index 0000000000..5517520552 --- /dev/null +++ b/.agents/skills/hooks-compute/references/function-invocation.md @@ -0,0 +1,34 @@ +# functionInvocation + + + +Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + +## Usage + +```typescript +useFunctionInvocationsQuery({ selection: { fields: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } } }) +useFunctionInvocationQuery({ id: '', selection: { fields: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } } }) +useCreateFunctionInvocationMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionInvocationMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionInvocationMutation({}) +``` + +## Examples + +### List all functionInvocations + +```typescript +const { data, isLoading } = useFunctionInvocationsQuery({ + selection: { fields: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }, +}); +``` + +### Create a functionInvocation + +```typescript +const { mutate } = useCreateFunctionInvocationMutation({ + selection: { fields: { id: true } }, +}); +mutate({ actorId: '', databaseId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/get-all-record.md b/.agents/skills/hooks-compute/references/get-all-record.md new file mode 100644 index 0000000000..2f3c3233fc --- /dev/null +++ b/.agents/skills/hooks-compute/references/get-all-record.md @@ -0,0 +1,31 @@ +# getAllRecord + + + +React Query hooks for GetAllRecord data operations + +## Usage + +```typescript +useGetAllQuery({ selection: { fields: { path: true, data: true } } }) +useCreateGetAllRecordMutation({ selection: { fields: { id: true } } }) +``` + +## Examples + +### List all getAll + +```typescript +const { data, isLoading } = useGetAllQuery({ + selection: { fields: { path: true, data: true } }, +}); +``` + +### Create a getAllRecord + +```typescript +const { mutate } = useCreateGetAllRecordMutation({ + selection: { fields: { id: true } }, +}); +mutate({ path: '', data: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/import-definitions.md b/.agents/skills/hooks-compute/references/import-definitions.md new file mode 100644 index 0000000000..2792f2fceb --- /dev/null +++ b/.agents/skills/hooks-compute/references/import-definitions.md @@ -0,0 +1,20 @@ +# importDefinitions + + + +React Query mutation hook for importDefinitions + +## Usage + +```typescript +const { mutate } = useImportDefinitionsMutation(); mutate({ input: { graphId: '', sourceScopeId: '', sourceCommitId: '', contexts: '' } }); +``` + +## Examples + +### Use useImportDefinitionsMutation + +```typescript +const { mutate, isLoading } = useImportDefinitionsMutation(); +mutate({ input: { graphId: '', sourceScopeId: '', sourceCommitId: '', contexts: '' } }); +``` diff --git a/.agents/skills/hooks-compute/references/import-graph-json.md b/.agents/skills/hooks-compute/references/import-graph-json.md new file mode 100644 index 0000000000..67707cb875 --- /dev/null +++ b/.agents/skills/hooks-compute/references/import-graph-json.md @@ -0,0 +1,20 @@ +# importGraphJson + + + +React Query mutation hook for importGraphJson + +## Usage + +```typescript +const { mutate } = useImportGraphJsonMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useImportGraphJsonMutation + +```typescript +const { mutate, isLoading } = useImportGraphJsonMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/init-empty-repo.md b/.agents/skills/hooks-compute/references/init-empty-repo.md new file mode 100644 index 0000000000..2886faeeb7 --- /dev/null +++ b/.agents/skills/hooks-compute/references/init-empty-repo.md @@ -0,0 +1,20 @@ +# initEmptyRepo + + + +React Query mutation hook for initEmptyRepo + +## Usage + +```typescript +const { mutate } = useInitEmptyRepoMutation(); mutate({ input: { sId: '', storeId: '' } }); +``` + +## Examples + +### Use useInitEmptyRepoMutation + +```typescript +const { mutate, isLoading } = useInitEmptyRepoMutation(); +mutate({ input: { sId: '', storeId: '' } }); +``` diff --git a/.agents/skills/hooks-compute/references/insert-node-at-path.md b/.agents/skills/hooks-compute/references/insert-node-at-path.md new file mode 100644 index 0000000000..cbcd48ca31 --- /dev/null +++ b/.agents/skills/hooks-compute/references/insert-node-at-path.md @@ -0,0 +1,20 @@ +# insertNodeAtPath + + + +React Query mutation hook for insertNodeAtPath + +## Usage + +```typescript +const { mutate } = useInsertNodeAtPathMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useInsertNodeAtPathMutation + +```typescript +const { mutate, isLoading } = useInsertNodeAtPathMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/org-function-execution-log.md b/.agents/skills/hooks-compute/references/org-function-execution-log.md new file mode 100644 index 0000000000..d29c450a52 --- /dev/null +++ b/.agents/skills/hooks-compute/references/org-function-execution-log.md @@ -0,0 +1,34 @@ +# orgFunctionExecutionLog + + + +Function execution logs — structured console output per invocation + +## Usage + +```typescript +useOrgFunctionExecutionLogsQuery({ selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } } }) +useOrgFunctionExecutionLogQuery({ id: '', selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } } }) +useCreateOrgFunctionExecutionLogMutation({ selection: { fields: { id: true } } }) +useUpdateOrgFunctionExecutionLogMutation({ selection: { fields: { id: true } } }) +useDeleteOrgFunctionExecutionLogMutation({}) +``` + +## Examples + +### List all orgFunctionExecutionLogs + +```typescript +const { data, isLoading } = useOrgFunctionExecutionLogsQuery({ + selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }, +}); +``` + +### Create a orgFunctionExecutionLog + +```typescript +const { mutate } = useCreateOrgFunctionExecutionLogMutation({ + selection: { fields: { id: true } }, +}); +mutate({ invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/org-function-invocation.md b/.agents/skills/hooks-compute/references/org-function-invocation.md new file mode 100644 index 0000000000..d8489f9e97 --- /dev/null +++ b/.agents/skills/hooks-compute/references/org-function-invocation.md @@ -0,0 +1,34 @@ +# orgFunctionInvocation + + + +Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + +## Usage + +```typescript +useOrgFunctionInvocationsQuery({ selection: { fields: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } } }) +useOrgFunctionInvocationQuery({ id: '', selection: { fields: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } } }) +useCreateOrgFunctionInvocationMutation({ selection: { fields: { id: true } } }) +useUpdateOrgFunctionInvocationMutation({ selection: { fields: { id: true } } }) +useDeleteOrgFunctionInvocationMutation({}) +``` + +## Examples + +### List all orgFunctionInvocations + +```typescript +const { data, isLoading } = useOrgFunctionInvocationsQuery({ + selection: { fields: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }, +}); +``` + +### Create a orgFunctionInvocation + +```typescript +const { mutate } = useCreateOrgFunctionInvocationMutation({ + selection: { fields: { id: true } }, +}); +mutate({ actorId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/provision-bucket.md b/.agents/skills/hooks-compute/references/provision-bucket.md new file mode 100644 index 0000000000..e003fc5551 --- /dev/null +++ b/.agents/skills/hooks-compute/references/provision-bucket.md @@ -0,0 +1,23 @@ +# provisionBucket + + + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +## Usage + +```typescript +const { mutate } = useProvisionBucketMutation(); mutate({ input: { bucketKey: '', ownerId: '' } }); +``` + +## Examples + +### Use useProvisionBucketMutation + +```typescript +const { mutate, isLoading } = useProvisionBucketMutation(); +mutate({ input: { bucketKey: '', ownerId: '' } }); +``` diff --git a/.agents/skills/hooks-compute/references/read-function-graph.md b/.agents/skills/hooks-compute/references/read-function-graph.md new file mode 100644 index 0000000000..a87cec87c3 --- /dev/null +++ b/.agents/skills/hooks-compute/references/read-function-graph.md @@ -0,0 +1,19 @@ +# readFunctionGraph + + + +React Query query hook for readFunctionGraph + +## Usage + +```typescript +useReadFunctionGraphQuery({ graphId: '' }) +``` + +## Examples + +### Use useReadFunctionGraphQuery + +```typescript +const { data, isLoading } = useReadFunctionGraphQuery({ graphId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/save-graph.md b/.agents/skills/hooks-compute/references/save-graph.md new file mode 100644 index 0000000000..65bed09662 --- /dev/null +++ b/.agents/skills/hooks-compute/references/save-graph.md @@ -0,0 +1,20 @@ +# saveGraph + + + +React Query mutation hook for saveGraph + +## Usage + +```typescript +const { mutate } = useSaveGraphMutation(); mutate({ input: { graphId: '', rootHash: '', message: '' } }); +``` + +## Examples + +### Use useSaveGraphMutation + +```typescript +const { mutate, isLoading } = useSaveGraphMutation(); +mutate({ input: { graphId: '', rootHash: '', message: '' } }); +``` diff --git a/.agents/skills/hooks-compute/references/secret-definition.md b/.agents/skills/hooks-compute/references/secret-definition.md new file mode 100644 index 0000000000..a851bc46b8 --- /dev/null +++ b/.agents/skills/hooks-compute/references/secret-definition.md @@ -0,0 +1,34 @@ +# secretDefinition + + + +Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + +## Usage + +```typescript +useSecretDefinitionsQuery({ selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } } }) +useSecretDefinitionQuery({ id: '', selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } } }) +useCreateSecretDefinitionMutation({ selection: { fields: { id: true } } }) +useUpdateSecretDefinitionMutation({ selection: { fields: { id: true } } }) +useDeleteSecretDefinitionMutation({}) +``` + +## Examples + +### List all secretDefinitions + +```typescript +const { data, isLoading } = useSecretDefinitionsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }, +}); +``` + +### Create a secretDefinition + +```typescript +const { mutate } = useCreateSecretDefinitionMutation({ + selection: { fields: { id: true } }, +}); +mutate({ name: '', description: '', isBuiltIn: '', labels: '', annotations: '', databaseId: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/set-data-at-path.md b/.agents/skills/hooks-compute/references/set-data-at-path.md new file mode 100644 index 0000000000..dcb9adb0aa --- /dev/null +++ b/.agents/skills/hooks-compute/references/set-data-at-path.md @@ -0,0 +1,20 @@ +# setDataAtPath + + + +React Query mutation hook for setDataAtPath + +## Usage + +```typescript +const { mutate } = useSetDataAtPathMutation(); mutate({ input: { sId: '', root: '', path: '', data: '' } }); +``` + +## Examples + +### Use useSetDataAtPathMutation + +```typescript +const { mutate, isLoading } = useSetDataAtPathMutation(); +mutate({ input: { sId: '', root: '', path: '', data: '' } }); +``` diff --git a/.agents/skills/hooks-compute/references/start-execution.md b/.agents/skills/hooks-compute/references/start-execution.md new file mode 100644 index 0000000000..963fe4cc31 --- /dev/null +++ b/.agents/skills/hooks-compute/references/start-execution.md @@ -0,0 +1,20 @@ +# startExecution + + + +React Query mutation hook for startExecution + +## Usage + +```typescript +const { mutate } = useStartExecutionMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useStartExecutionMutation + +```typescript +const { mutate, isLoading } = useStartExecutionMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-compute/references/validate-function-graph.md b/.agents/skills/hooks-compute/references/validate-function-graph.md new file mode 100644 index 0000000000..dea041b54a --- /dev/null +++ b/.agents/skills/hooks-compute/references/validate-function-graph.md @@ -0,0 +1,20 @@ +# validateFunctionGraph + + + +React Query mutation hook for validateFunctionGraph + +## Usage + +```typescript +const { mutate } = useValidateFunctionGraphMutation(); mutate({ input: { graphId: '' } }); +``` + +## Examples + +### Use useValidateFunctionGraphMutation + +```typescript +const { mutate, isLoading } = useValidateFunctionGraphMutation(); +mutate({ input: { graphId: '' } }); +``` diff --git a/.agents/skills/hooks-config/SKILL.md b/.agents/skills/hooks-config/SKILL.md new file mode 100644 index 0000000000..fa6b09c0cf --- /dev/null +++ b/.agents/skills/hooks-config/SKILL.md @@ -0,0 +1,51 @@ +--- +name: hooks-config +description: React Query hooks for the config API — provides typed query and mutation hooks for 2 tables and 9 custom operations +--- + +# hooks-config + + + +React Query hooks for the config API — provides typed query and mutation hooks for 2 tables and 9 custom operations + +## Usage + +```typescript +// Import hooks +import { usePlatformConfigDefinitionsQuery } from './hooks'; + +// Query hooks: useQuery, usesQuery +// Mutation hooks: useCreateMutation, useUpdateMutation, useDeleteMutation +// Bulk mutation hooks (when enabled): useBulkCreateMutation, useBulkUpsertMutation, etc. + +const { data, isLoading } = usePlatformConfigDefinitionsQuery({ + selection: { fields: { id: true } }, +}); +``` + +## Examples + +### Query records + +```typescript +const { data, isLoading } = usePlatformConfigDefinitionsQuery({ + selection: { fields: { id: true } }, +}); +``` + +## References + +See the `references/` directory for detailed per-entity API documentation: + +- [platform-config-definition](references/platform-config-definition.md) +- [platform-config](references/platform-config.md) +- [platform-secrets-del](references/platform-secrets-del.md) +- [org-secrets-del](references/org-secrets-del.md) +- [platform-secrets-remove-array](references/platform-secrets-remove-array.md) +- [org-secrets-remove-array](references/org-secrets-remove-array.md) +- [platform-secrets-rotate](references/platform-secrets-rotate.md) +- [platform-secrets-set](references/platform-secrets-set.md) +- [org-secrets-rotate](references/org-secrets-rotate.md) +- [org-secrets-set](references/org-secrets-set.md) +- [provision-bucket](references/provision-bucket.md) diff --git a/.agents/skills/hooks-config/references/org-secrets-del.md b/.agents/skills/hooks-config/references/org-secrets-del.md new file mode 100644 index 0000000000..7d9ff042f0 --- /dev/null +++ b/.agents/skills/hooks-config/references/org-secrets-del.md @@ -0,0 +1,20 @@ +# orgSecretsDel + + + +React Query mutation hook for orgSecretsDel + +## Usage + +```typescript +const { mutate } = useOrgSecretsDelMutation(); mutate({ input: { ownerId: '', secretName: '', namespaceId: '' } }); +``` + +## Examples + +### Use useOrgSecretsDelMutation + +```typescript +const { mutate, isLoading } = useOrgSecretsDelMutation(); +mutate({ input: { ownerId: '', secretName: '', namespaceId: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/org-secrets-remove-array.md b/.agents/skills/hooks-config/references/org-secrets-remove-array.md new file mode 100644 index 0000000000..b5a4f6e88c --- /dev/null +++ b/.agents/skills/hooks-config/references/org-secrets-remove-array.md @@ -0,0 +1,20 @@ +# orgSecretsRemoveArray + + + +React Query mutation hook for orgSecretsRemoveArray + +## Usage + +```typescript +const { mutate } = useOrgSecretsRemoveArrayMutation(); mutate({ input: { ownerId: '', secretNames: '', namespaceId: '' } }); +``` + +## Examples + +### Use useOrgSecretsRemoveArrayMutation + +```typescript +const { mutate, isLoading } = useOrgSecretsRemoveArrayMutation(); +mutate({ input: { ownerId: '', secretNames: '', namespaceId: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/org-secrets-rotate.md b/.agents/skills/hooks-config/references/org-secrets-rotate.md new file mode 100644 index 0000000000..8fb09ca5cf --- /dev/null +++ b/.agents/skills/hooks-config/references/org-secrets-rotate.md @@ -0,0 +1,20 @@ +# orgSecretsRotate + + + +React Query mutation hook for orgSecretsRotate + +## Usage + +```typescript +const { mutate } = useOrgSecretsRotateMutation(); mutate({ input: { ownerId: '', secretName: '', secretValue: '', namespaceId: '', algo: '' } }); +``` + +## Examples + +### Use useOrgSecretsRotateMutation + +```typescript +const { mutate, isLoading } = useOrgSecretsRotateMutation(); +mutate({ input: { ownerId: '', secretName: '', secretValue: '', namespaceId: '', algo: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/org-secrets-set.md b/.agents/skills/hooks-config/references/org-secrets-set.md new file mode 100644 index 0000000000..93dd259fb6 --- /dev/null +++ b/.agents/skills/hooks-config/references/org-secrets-set.md @@ -0,0 +1,20 @@ +# orgSecretsSet + + + +React Query mutation hook for orgSecretsSet + +## Usage + +```typescript +const { mutate } = useOrgSecretsSetMutation(); mutate({ input: { scopeOwnerId: '', secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }); +``` + +## Examples + +### Use useOrgSecretsSetMutation + +```typescript +const { mutate, isLoading } = useOrgSecretsSetMutation(); +mutate({ input: { scopeOwnerId: '', secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/platform-config-definition.md b/.agents/skills/hooks-config/references/platform-config-definition.md new file mode 100644 index 0000000000..3fbec7f84b --- /dev/null +++ b/.agents/skills/hooks-config/references/platform-config-definition.md @@ -0,0 +1,34 @@ +# platformConfigDefinition + + + +Registry of valid config keys — declares which config entries the platform recognizes + +## Usage + +```typescript +usePlatformConfigDefinitionsQuery({ selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } } }) +usePlatformConfigDefinitionQuery({ id: '', selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } } }) +useCreatePlatformConfigDefinitionMutation({ selection: { fields: { id: true } } }) +useUpdatePlatformConfigDefinitionMutation({ selection: { fields: { id: true } } }) +useDeletePlatformConfigDefinitionMutation({}) +``` + +## Examples + +### List all platformConfigDefinitions + +```typescript +const { data, isLoading } = usePlatformConfigDefinitionsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }, +}); +``` + +### Create a platformConfigDefinition + +```typescript +const { mutate } = useCreatePlatformConfigDefinitionMutation({ + selection: { fields: { id: true } }, +}); +mutate({ name: '', description: '', defaultValue: '', isBuiltIn: '', labels: '', annotations: '' }); +``` diff --git a/.agents/skills/hooks-config/references/platform-config.md b/.agents/skills/hooks-config/references/platform-config.md new file mode 100644 index 0000000000..8a1551e143 --- /dev/null +++ b/.agents/skills/hooks-config/references/platform-config.md @@ -0,0 +1,34 @@ +# platformConfig + + + +App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + +## Usage + +```typescript +usePlatformConfigsQuery({ selection: { fields: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } } }) +usePlatformConfigQuery({ id: '', selection: { fields: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } } }) +useCreatePlatformConfigMutation({ selection: { fields: { id: true } } }) +useUpdatePlatformConfigMutation({ selection: { fields: { id: true } } }) +useDeletePlatformConfigMutation({}) +``` + +## Examples + +### List all platformConfigs + +```typescript +const { data, isLoading } = usePlatformConfigsQuery({ + selection: { fields: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }, +}); +``` + +### Create a platformConfig + +```typescript +const { mutate } = useCreatePlatformConfigMutation({ + selection: { fields: { id: true } }, +}); +mutate({ namespaceId: '', name: '', value: '', labels: '', annotations: '', description: '', expiresAt: '' }); +``` diff --git a/.agents/skills/hooks-config/references/platform-secrets-del.md b/.agents/skills/hooks-config/references/platform-secrets-del.md new file mode 100644 index 0000000000..101f99e715 --- /dev/null +++ b/.agents/skills/hooks-config/references/platform-secrets-del.md @@ -0,0 +1,20 @@ +# platformSecretsDel + + + +React Query mutation hook for platformSecretsDel + +## Usage + +```typescript +const { mutate } = usePlatformSecretsDelMutation(); mutate({ input: { secretName: '', namespaceId: '' } }); +``` + +## Examples + +### Use usePlatformSecretsDelMutation + +```typescript +const { mutate, isLoading } = usePlatformSecretsDelMutation(); +mutate({ input: { secretName: '', namespaceId: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/platform-secrets-remove-array.md b/.agents/skills/hooks-config/references/platform-secrets-remove-array.md new file mode 100644 index 0000000000..1d1216b5fb --- /dev/null +++ b/.agents/skills/hooks-config/references/platform-secrets-remove-array.md @@ -0,0 +1,20 @@ +# platformSecretsRemoveArray + + + +React Query mutation hook for platformSecretsRemoveArray + +## Usage + +```typescript +const { mutate } = usePlatformSecretsRemoveArrayMutation(); mutate({ input: { secretNames: '', namespaceId: '' } }); +``` + +## Examples + +### Use usePlatformSecretsRemoveArrayMutation + +```typescript +const { mutate, isLoading } = usePlatformSecretsRemoveArrayMutation(); +mutate({ input: { secretNames: '', namespaceId: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/platform-secrets-rotate.md b/.agents/skills/hooks-config/references/platform-secrets-rotate.md new file mode 100644 index 0000000000..caa6f47fd9 --- /dev/null +++ b/.agents/skills/hooks-config/references/platform-secrets-rotate.md @@ -0,0 +1,20 @@ +# platformSecretsRotate + + + +React Query mutation hook for platformSecretsRotate + +## Usage + +```typescript +const { mutate } = usePlatformSecretsRotateMutation(); mutate({ input: { secretName: '', secretValue: '', namespaceId: '', algo: '' } }); +``` + +## Examples + +### Use usePlatformSecretsRotateMutation + +```typescript +const { mutate, isLoading } = usePlatformSecretsRotateMutation(); +mutate({ input: { secretName: '', secretValue: '', namespaceId: '', algo: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/platform-secrets-set.md b/.agents/skills/hooks-config/references/platform-secrets-set.md new file mode 100644 index 0000000000..f08a02e872 --- /dev/null +++ b/.agents/skills/hooks-config/references/platform-secrets-set.md @@ -0,0 +1,20 @@ +# platformSecretsSet + + + +React Query mutation hook for platformSecretsSet + +## Usage + +```typescript +const { mutate } = usePlatformSecretsSetMutation(); mutate({ input: { secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }); +``` + +## Examples + +### Use usePlatformSecretsSetMutation + +```typescript +const { mutate, isLoading } = usePlatformSecretsSetMutation(); +mutate({ input: { secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }); +``` diff --git a/.agents/skills/hooks-config/references/provision-bucket.md b/.agents/skills/hooks-config/references/provision-bucket.md new file mode 100644 index 0000000000..e003fc5551 --- /dev/null +++ b/.agents/skills/hooks-config/references/provision-bucket.md @@ -0,0 +1,23 @@ +# provisionBucket + + + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +## Usage + +```typescript +const { mutate } = useProvisionBucketMutation(); mutate({ input: { bucketKey: '', ownerId: '' } }); +``` + +## Examples + +### Use useProvisionBucketMutation + +```typescript +const { mutate, isLoading } = useProvisionBucketMutation(); +mutate({ input: { bucketKey: '', ownerId: '' } }); +``` diff --git a/.agents/skills/hooks-modules/SKILL.md b/.agents/skills/hooks-modules/SKILL.md index e01ad64149..43b3762cab 100644 --- a/.agents/skills/hooks-modules/SKILL.md +++ b/.agents/skills/hooks-modules/SKILL.md @@ -1,13 +1,13 @@ --- name: hooks-modules -description: React Query hooks for the modules API — provides typed query and mutation hooks for 57 tables and 12 custom operations +description: React Query hooks for the modules API — provides typed query and mutation hooks for 59 tables and 12 custom operations --- # hooks-modules -React Query hooks for the modules API — provides typed query and mutation hooks for 57 tables and 12 custom operations +React Query hooks for the modules API — provides typed query and mutation hooks for 59 tables and 12 custom operations ## Usage @@ -74,14 +74,16 @@ See the `references/` directory for detailed per-entity API documentation: - [function-invocation-module](references/function-invocation-module.md) - [function-module](references/function-module.md) - [invites-module](references/invites-module.md) -- [namespace-module](references/namespace-module.md) - [compute-log-module](references/compute-log-module.md) - [inference-log-module](references/inference-log-module.md) +- [namespace-module](references/namespace-module.md) - [storage-log-module](references/storage-log-module.md) - [transfer-log-module](references/transfer-log-module.md) +- [function-deployment-module](references/function-deployment-module.md) - [plans-module](references/plans-module.md) - [billing-provider-module](references/billing-provider-module.md) - [db-usage-module](references/db-usage-module.md) +- [graph-execution-module](references/graph-execution-module.md) - [hierarchy-module](references/hierarchy-module.md) - [permissions-module](references/permissions-module.md) - [notifications-module](references/notifications-module.md) diff --git a/.agents/skills/hooks-modules/references/function-deployment-module.md b/.agents/skills/hooks-modules/references/function-deployment-module.md new file mode 100644 index 0000000000..696e55abe7 --- /dev/null +++ b/.agents/skills/hooks-modules/references/function-deployment-module.md @@ -0,0 +1,34 @@ +# functionDeploymentModule + + + +React Query hooks for FunctionDeploymentModule data operations + +## Usage + +```typescript +useFunctionDeploymentModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } } }) +useFunctionDeploymentModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } } }) +useCreateFunctionDeploymentModuleMutation({ selection: { fields: { id: true } } }) +useUpdateFunctionDeploymentModuleMutation({ selection: { fields: { id: true } } }) +useDeleteFunctionDeploymentModuleMutation({}) +``` + +## Examples + +### List all functionDeploymentModules + +```typescript +const { data, isLoading } = useFunctionDeploymentModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }, +}); +``` + +### Create a functionDeploymentModule + +```typescript +const { mutate } = useCreateFunctionDeploymentModuleMutation({ + selection: { fields: { id: true } }, +}); +mutate({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', deploymentsTableId: '', deploymentEventsTableId: '', deploymentsTableName: '', deploymentEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', functionModuleId: '', namespaceModuleId: '', policies: '', provisions: '', defaultPermissions: '' }); +``` diff --git a/.agents/skills/hooks-modules/references/graph-execution-module.md b/.agents/skills/hooks-modules/references/graph-execution-module.md new file mode 100644 index 0000000000..8eed0c1c70 --- /dev/null +++ b/.agents/skills/hooks-modules/references/graph-execution-module.md @@ -0,0 +1,34 @@ +# graphExecutionModule + + + +React Query hooks for GraphExecutionModule data operations + +## Usage + +```typescript +useGraphExecutionModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } } }) +useGraphExecutionModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } } }) +useCreateGraphExecutionModuleMutation({ selection: { fields: { id: true } } }) +useUpdateGraphExecutionModuleMutation({ selection: { fields: { id: true } } }) +useDeleteGraphExecutionModuleMutation({}) +``` + +## Examples + +### List all graphExecutionModules + +```typescript +const { data, isLoading } = useGraphExecutionModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, +}); +``` + +### Create a graphExecutionModule + +```typescript +const { mutate } = useCreateGraphExecutionModuleMutation({ + selection: { fields: { id: true } }, +}); +mutate({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', graphModuleId: '', scope: '', prefix: '', executionsTableId: '', outputsTableId: '', nodeStatesTableId: '', executionsTableName: '', outputsTableName: '', nodeStatesTableName: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); +``` diff --git a/.agents/skills/hooks-modules/references/graph-module.md b/.agents/skills/hooks-modules/references/graph-module.md index def0e762c9..2c7db8a328 100644 --- a/.agents/skills/hooks-modules/references/graph-module.md +++ b/.agents/skills/hooks-modules/references/graph-module.md @@ -7,8 +7,8 @@ React Query hooks for GraphModule data operations ## Usage ```typescript -useGraphModulesQuery({ selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } } }) -useGraphModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } } }) +useGraphModulesQuery({ selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } } }) +useGraphModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } } }) useCreateGraphModuleMutation({ selection: { fields: { id: true } } }) useUpdateGraphModuleMutation({ selection: { fields: { id: true } } }) useDeleteGraphModuleMutation({}) @@ -20,7 +20,7 @@ useDeleteGraphModuleMutation({}) ```typescript const { data, isLoading } = useGraphModulesQuery({ - selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, + selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useGraphModulesQuery({ const { mutate } = useCreateGraphModuleMutation({ selection: { fields: { id: true } }, }); -mutate({ databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', executionsTableId: '', outputsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); +mutate({ databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); ``` diff --git a/.agents/skills/hooks-modules/references/namespace-module.md b/.agents/skills/hooks-modules/references/namespace-module.md index e9b8e5405d..7537c5d8f3 100644 --- a/.agents/skills/hooks-modules/references/namespace-module.md +++ b/.agents/skills/hooks-modules/references/namespace-module.md @@ -7,8 +7,8 @@ React Query hooks for NamespaceModule data operations ## Usage ```typescript -useNamespaceModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } } }) -useNamespaceModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } } }) +useNamespaceModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } } }) +useNamespaceModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } } }) useCreateNamespaceModuleMutation({ selection: { fields: { id: true } } }) useUpdateNamespaceModuleMutation({ selection: { fields: { id: true } } }) useDeleteNamespaceModuleMutation({}) @@ -20,7 +20,7 @@ useDeleteNamespaceModuleMutation({}) ```typescript const { data, isLoading } = useNamespaceModulesQuery({ - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }, + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useNamespaceModulesQuery({ const { mutate } = useCreateNamespaceModuleMutation({ selection: { fields: { id: true } }, }); -mutate({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); +mutate({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', platformNamespacesTableId: '', policies: '', provisions: '', defaultPermissions: '' }); ``` diff --git a/.agents/skills/orm-api/references/schema.md b/.agents/skills/orm-api/references/schema.md index e91d296af8..164276e7aa 100644 --- a/.agents/skills/orm-api/references/schema.md +++ b/.agents/skills/orm-api/references/schema.md @@ -9,7 +9,7 @@ ORM operations for Schema records ```typescript db.schema.findMany({ select: { id: true } }).execute() db.schema.findOne({ id: '', select: { id: true } }).execute() -db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '' }, select: { id: true } }).execute() +db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '', apiExposure: '' }, select: { id: true } }).execute() db.schema.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() db.schema.delete({ where: { id: '' } }).execute() ``` @@ -28,7 +28,7 @@ const items = await db.schema.findMany({ ```typescript const item = await db.schema.create({ - data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '' }, + data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '', apiExposure: '' }, select: { id: true } }).execute(); ``` diff --git a/.agents/skills/orm-compute/SKILL.md b/.agents/skills/orm-compute/SKILL.md new file mode 100644 index 0000000000..63b1261cba --- /dev/null +++ b/.agents/skills/orm-compute/SKILL.md @@ -0,0 +1,72 @@ +--- +name: orm-compute +description: ORM client for the compute API — provides typed CRUD operations for 18 tables and 15 custom operations +--- + +# orm-compute + + + +ORM client for the compute API — provides typed CRUD operations for 18 tables and 15 custom operations + +## Usage + +```typescript +// Import the ORM client +import { db } from './orm'; + +// Available models: getAllRecord, functionApiBinding, functionDeployment, functionGraphRef, functionGraphStore, functionGraphObject, functionDeploymentEvent, orgFunctionExecutionLog, ... +db..findMany({ select: { id: true } }).execute() +db..findOne({ id: '', select: { id: true } }).execute() +db..create({ data: { ... }, select: { id: true } }).execute() +db..update({ where: { id: '' }, data: { ... }, select: { id: true } }).execute() +db..delete({ where: { id: '' } }).execute() +``` + +## Examples + +### Query records + +```typescript +const items = await db.getAllRecord.findMany({ + select: { id: true } +}).execute(); +``` + +## References + +See the `references/` directory for detailed per-entity API documentation: + +- [get-all-record](references/get-all-record.md) +- [function-api-binding](references/function-api-binding.md) +- [function-deployment](references/function-deployment.md) +- [function-graph-ref](references/function-graph-ref.md) +- [function-graph-store](references/function-graph-store.md) +- [function-graph-object](references/function-graph-object.md) +- [function-deployment-event](references/function-deployment-event.md) +- [org-function-execution-log](references/org-function-execution-log.md) +- [function-graph-execution-output](references/function-graph-execution-output.md) +- [function-graph-commit](references/function-graph-commit.md) +- [secret-definition](references/secret-definition.md) +- [function-execution-log](references/function-execution-log.md) +- [function-graph-execution-node-state](references/function-graph-execution-node-state.md) +- [function-graph](references/function-graph.md) +- [org-function-invocation](references/org-function-invocation.md) +- [function-invocation](references/function-invocation.md) +- [function-graph-execution](references/function-graph-execution.md) +- [function-definition](references/function-definition.md) +- [read-function-graph](references/read-function-graph.md) +- [validate-function-graph](references/validate-function-graph.md) +- [init-empty-repo](references/init-empty-repo.md) +- [set-data-at-path](references/set-data-at-path.md) +- [import-definitions](references/import-definitions.md) +- [copy-graph](references/copy-graph.md) +- [save-graph](references/save-graph.md) +- [add-edge-and-save](references/add-edge-and-save.md) +- [add-node-and-save](references/add-node-and-save.md) +- [add-edge](references/add-edge.md) +- [add-node](references/add-node.md) +- [import-graph-json](references/import-graph-json.md) +- [insert-node-at-path](references/insert-node-at-path.md) +- [start-execution](references/start-execution.md) +- [provision-bucket](references/provision-bucket.md) diff --git a/.agents/skills/orm-compute/references/add-edge-and-save.md b/.agents/skills/orm-compute/references/add-edge-and-save.md new file mode 100644 index 0000000000..caf1fde96a --- /dev/null +++ b/.agents/skills/orm-compute/references/add-edge-and-save.md @@ -0,0 +1,19 @@ +# addEdgeAndSave + + + +Execute the addEdgeAndSave mutation + +## Usage + +```typescript +db.mutation.addEdgeAndSave({ input: '' }).execute() +``` + +## Examples + +### Run addEdgeAndSave + +```typescript +const result = await db.mutation.addEdgeAndSave({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/add-edge.md b/.agents/skills/orm-compute/references/add-edge.md new file mode 100644 index 0000000000..81bb556dd7 --- /dev/null +++ b/.agents/skills/orm-compute/references/add-edge.md @@ -0,0 +1,19 @@ +# addEdge + + + +Execute the addEdge mutation + +## Usage + +```typescript +db.mutation.addEdge({ input: '' }).execute() +``` + +## Examples + +### Run addEdge + +```typescript +const result = await db.mutation.addEdge({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/add-node-and-save.md b/.agents/skills/orm-compute/references/add-node-and-save.md new file mode 100644 index 0000000000..a36cbc3ee2 --- /dev/null +++ b/.agents/skills/orm-compute/references/add-node-and-save.md @@ -0,0 +1,19 @@ +# addNodeAndSave + + + +Execute the addNodeAndSave mutation + +## Usage + +```typescript +db.mutation.addNodeAndSave({ input: '' }).execute() +``` + +## Examples + +### Run addNodeAndSave + +```typescript +const result = await db.mutation.addNodeAndSave({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/add-node.md b/.agents/skills/orm-compute/references/add-node.md new file mode 100644 index 0000000000..937fed9321 --- /dev/null +++ b/.agents/skills/orm-compute/references/add-node.md @@ -0,0 +1,19 @@ +# addNode + + + +Execute the addNode mutation + +## Usage + +```typescript +db.mutation.addNode({ input: '' }).execute() +``` + +## Examples + +### Run addNode + +```typescript +const result = await db.mutation.addNode({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/copy-graph.md b/.agents/skills/orm-compute/references/copy-graph.md new file mode 100644 index 0000000000..6893ea7ff6 --- /dev/null +++ b/.agents/skills/orm-compute/references/copy-graph.md @@ -0,0 +1,19 @@ +# copyGraph + + + +Execute the copyGraph mutation + +## Usage + +```typescript +db.mutation.copyGraph({ input: { databaseId: '', graphId: '', name: '' } }).execute() +``` + +## Examples + +### Run copyGraph + +```typescript +const result = await db.mutation.copyGraph({ input: { databaseId: '', graphId: '', name: '' } }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-api-binding.md b/.agents/skills/orm-compute/references/function-api-binding.md new file mode 100644 index 0000000000..40ed99daeb --- /dev/null +++ b/.agents/skills/orm-compute/references/function-api-binding.md @@ -0,0 +1,34 @@ +# functionApiBinding + + + +Join table binding function definitions to API endpoints with per-binding alias and config + +## Usage + +```typescript +db.functionApiBinding.findMany({ select: { id: true } }).execute() +db.functionApiBinding.findOne({ id: '', select: { id: true } }).execute() +db.functionApiBinding.create({ data: { functionDefinitionId: '', apiId: '', alias: '', config: '' }, select: { id: true } }).execute() +db.functionApiBinding.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute() +db.functionApiBinding.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionApiBinding records + +```typescript +const items = await db.functionApiBinding.findMany({ + select: { id: true, functionDefinitionId: true } +}).execute(); +``` + +### Create a functionApiBinding + +```typescript +const item = await db.functionApiBinding.create({ + data: { functionDefinitionId: '', apiId: '', alias: '', config: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-definition.md b/.agents/skills/orm-compute/references/function-definition.md new file mode 100644 index 0000000000..2e7e5eabae --- /dev/null +++ b/.agents/skills/orm-compute/references/function-definition.md @@ -0,0 +1,34 @@ +# functionDefinition + + + +Function definitions — registered cloud functions with routing, queue, and retry configuration + +## Usage + +```typescript +db.functionDefinition.findMany({ select: { id: true } }).execute() +db.functionDefinition.findOne({ id: '', select: { id: true } }).execute() +db.functionDefinition.create({ data: { scope: '', name: '', taskIdentifier: '', description: '', isInvocable: '', maxAttempts: '', priority: '', queueName: '', runtime: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', isBuiltIn: '', requiredSecrets: '', requiredConfigs: '', requiredBuckets: '', requiredModels: '', inputs: '', outputs: '', props: '', volatile: '', icon: '', category: '' }, select: { id: true } }).execute() +db.functionDefinition.update({ where: { id: '' }, data: { scope: '' }, select: { id: true } }).execute() +db.functionDefinition.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionDefinition records + +```typescript +const items = await db.functionDefinition.findMany({ + select: { id: true, scope: true } +}).execute(); +``` + +### Create a functionDefinition + +```typescript +const item = await db.functionDefinition.create({ + data: { scope: '', name: '', taskIdentifier: '', description: '', isInvocable: '', maxAttempts: '', priority: '', queueName: '', runtime: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', isBuiltIn: '', requiredSecrets: '', requiredConfigs: '', requiredBuckets: '', requiredModels: '', inputs: '', outputs: '', props: '', volatile: '', icon: '', category: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-deployment-event.md b/.agents/skills/orm-compute/references/function-deployment-event.md new file mode 100644 index 0000000000..51c0fd36d2 --- /dev/null +++ b/.agents/skills/orm-compute/references/function-deployment-event.md @@ -0,0 +1,34 @@ +# functionDeploymentEvent + + + +Deployment lifecycle events — audit log of provisioning, scaling, and failure events + +## Usage + +```typescript +db.functionDeploymentEvent.findMany({ select: { id: true } }).execute() +db.functionDeploymentEvent.findOne({ id: '', select: { id: true } }).execute() +db.functionDeploymentEvent.create({ data: { deploymentId: '', eventType: '', actorId: '', message: '', metadata: '', databaseId: '' }, select: { id: true } }).execute() +db.functionDeploymentEvent.update({ where: { id: '' }, data: { deploymentId: '' }, select: { id: true } }).execute() +db.functionDeploymentEvent.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionDeploymentEvent records + +```typescript +const items = await db.functionDeploymentEvent.findMany({ + select: { id: true, deploymentId: true } +}).execute(); +``` + +### Create a functionDeploymentEvent + +```typescript +const item = await db.functionDeploymentEvent.create({ + data: { deploymentId: '', eventType: '', actorId: '', message: '', metadata: '', databaseId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-deployment.md b/.agents/skills/orm-compute/references/function-deployment.md new file mode 100644 index 0000000000..9a01f98dfe --- /dev/null +++ b/.agents/skills/orm-compute/references/function-deployment.md @@ -0,0 +1,34 @@ +# functionDeployment + + + +Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + +## Usage + +```typescript +db.functionDeployment.findMany({ select: { id: true } }).execute() +db.functionDeployment.findOne({ id: '', select: { id: true } }).execute() +db.functionDeployment.create({ data: { functionDefinitionId: '', namespaceId: '', status: '', serviceUrl: '', serviceName: '', revision: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', lastError: '', lastErrorAt: '', errorCount: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute() +db.functionDeployment.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute() +db.functionDeployment.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionDeployment records + +```typescript +const items = await db.functionDeployment.findMany({ + select: { id: true, functionDefinitionId: true } +}).execute(); +``` + +### Create a functionDeployment + +```typescript +const item = await db.functionDeployment.create({ + data: { functionDefinitionId: '', namespaceId: '', status: '', serviceUrl: '', serviceName: '', revision: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', lastError: '', lastErrorAt: '', errorCount: '', labels: '', annotations: '', databaseId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-execution-log.md b/.agents/skills/orm-compute/references/function-execution-log.md new file mode 100644 index 0000000000..278d5c426d --- /dev/null +++ b/.agents/skills/orm-compute/references/function-execution-log.md @@ -0,0 +1,34 @@ +# functionExecutionLog + + + +Function execution logs — structured console output per invocation + +## Usage + +```typescript +db.functionExecutionLog.findMany({ select: { id: true } }).execute() +db.functionExecutionLog.findOne({ id: '', select: { id: true } }).execute() +db.functionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }, select: { id: true } }).execute() +db.functionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute() +db.functionExecutionLog.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionExecutionLog records + +```typescript +const items = await db.functionExecutionLog.findMany({ + select: { id: true, invocationId: true } +}).execute(); +``` + +### Create a functionExecutionLog + +```typescript +const item = await db.functionExecutionLog.create({ + data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph-commit.md b/.agents/skills/orm-compute/references/function-graph-commit.md new file mode 100644 index 0000000000..68afeb1424 --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph-commit.md @@ -0,0 +1,34 @@ +# functionGraphCommit + + + +Commit history — each commit snapshots a tree root for a store + +## Usage + +```typescript +db.functionGraphCommit.findMany({ select: { id: true } }).execute() +db.functionGraphCommit.findOne({ id: '', select: { id: true } }).execute() +db.functionGraphCommit.create({ data: { message: '', databaseId: '', storeId: '', parentIds: '', authorId: '', committerId: '', treeId: '', date: '' }, select: { id: true } }).execute() +db.functionGraphCommit.update({ where: { id: '' }, data: { message: '' }, select: { id: true } }).execute() +db.functionGraphCommit.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraphCommit records + +```typescript +const items = await db.functionGraphCommit.findMany({ + select: { id: true, message: true } +}).execute(); +``` + +### Create a functionGraphCommit + +```typescript +const item = await db.functionGraphCommit.create({ + data: { message: '', databaseId: '', storeId: '', parentIds: '', authorId: '', committerId: '', treeId: '', date: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph-execution-node-state.md b/.agents/skills/orm-compute/references/function-graph-execution-node-state.md new file mode 100644 index 0000000000..975233198b --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph-execution-node-state.md @@ -0,0 +1,34 @@ +# functionGraphExecutionNodeState + + + +Per-node execution state — tracks individual node lifecycle for debugging + +## Usage + +```typescript +db.functionGraphExecutionNodeState.findMany({ select: { id: true } }).execute() +db.functionGraphExecutionNodeState.findOne({ id: '', select: { id: true } }).execute() +db.functionGraphExecutionNodeState.create({ data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, select: { id: true } }).execute() +db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute() +db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraphExecutionNodeState records + +```typescript +const items = await db.functionGraphExecutionNodeState.findMany({ + select: { id: true, executionId: true } +}).execute(); +``` + +### Create a functionGraphExecutionNodeState + +```typescript +const item = await db.functionGraphExecutionNodeState.create({ + data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph-execution-output.md b/.agents/skills/orm-compute/references/function-graph-execution-output.md new file mode 100644 index 0000000000..821dbbe9b6 --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph-execution-output.md @@ -0,0 +1,34 @@ +# functionGraphExecutionOutput + + + +Content-addressed store for execution outputs — hash-referenced from node_outputs + +## Usage + +```typescript +db.functionGraphExecutionOutput.findMany({ select: { id: true } }).execute() +db.functionGraphExecutionOutput.findOne({ id: '', select: { id: true } }).execute() +db.functionGraphExecutionOutput.create({ data: { databaseId: '', hash: '', data: '' }, select: { id: true } }).execute() +db.functionGraphExecutionOutput.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() +db.functionGraphExecutionOutput.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraphExecutionOutput records + +```typescript +const items = await db.functionGraphExecutionOutput.findMany({ + select: { id: true, databaseId: true } +}).execute(); +``` + +### Create a functionGraphExecutionOutput + +```typescript +const item = await db.functionGraphExecutionOutput.create({ + data: { databaseId: '', hash: '', data: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph-execution.md b/.agents/skills/orm-compute/references/function-graph-execution.md new file mode 100644 index 0000000000..3f2c0cb6b1 --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph-execution.md @@ -0,0 +1,34 @@ +# functionGraphExecution + + + +Ephemeral execution state for flow graph evaluation + +## Usage + +```typescript +db.functionGraphExecution.findMany({ select: { id: true } }).execute() +db.functionGraphExecution.findOne({ id: '', select: { id: true } }).execute() +db.functionGraphExecution.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', entityId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }, select: { id: true } }).execute() +db.functionGraphExecution.update({ where: { id: '' }, data: { startedAt: '' }, select: { id: true } }).execute() +db.functionGraphExecution.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraphExecution records + +```typescript +const items = await db.functionGraphExecution.findMany({ + select: { id: true, startedAt: true } +}).execute(); +``` + +### Create a functionGraphExecution + +```typescript +const item = await db.functionGraphExecution.create({ + data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', entityId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph-object.md b/.agents/skills/orm-compute/references/function-graph-object.md new file mode 100644 index 0000000000..4cbb5e899b --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph-object.md @@ -0,0 +1,34 @@ +# functionGraphObject + + + +Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + +## Usage + +```typescript +db.functionGraphObject.findMany({ select: { id: true } }).execute() +db.functionGraphObject.findOne({ id: '', select: { id: true } }).execute() +db.functionGraphObject.create({ data: { databaseId: '', kids: '', ktree: '', data: '' }, select: { id: true } }).execute() +db.functionGraphObject.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() +db.functionGraphObject.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraphObject records + +```typescript +const items = await db.functionGraphObject.findMany({ + select: { id: true, databaseId: true } +}).execute(); +``` + +### Create a functionGraphObject + +```typescript +const item = await db.functionGraphObject.create({ + data: { databaseId: '', kids: '', ktree: '', data: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph-ref.md b/.agents/skills/orm-compute/references/function-graph-ref.md new file mode 100644 index 0000000000..dc5f7367b7 --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph-ref.md @@ -0,0 +1,34 @@ +# functionGraphRef + + + +Branch heads — mutable pointers into the commit chain + +## Usage + +```typescript +db.functionGraphRef.findMany({ select: { id: true } }).execute() +db.functionGraphRef.findOne({ id: '', select: { id: true } }).execute() +db.functionGraphRef.create({ data: { name: '', databaseId: '', storeId: '', commitId: '' }, select: { id: true } }).execute() +db.functionGraphRef.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute() +db.functionGraphRef.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraphRef records + +```typescript +const items = await db.functionGraphRef.findMany({ + select: { id: true, name: true } +}).execute(); +``` + +### Create a functionGraphRef + +```typescript +const item = await db.functionGraphRef.create({ + data: { name: '', databaseId: '', storeId: '', commitId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph-store.md b/.agents/skills/orm-compute/references/function-graph-store.md new file mode 100644 index 0000000000..f99f311639 --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph-store.md @@ -0,0 +1,34 @@ +# functionGraphStore + + + +Named stores — one per version-controlled tree (e.g. one graph, one definition set) + +## Usage + +```typescript +db.functionGraphStore.findMany({ select: { id: true } }).execute() +db.functionGraphStore.findOne({ id: '', select: { id: true } }).execute() +db.functionGraphStore.create({ data: { name: '', databaseId: '', hash: '' }, select: { id: true } }).execute() +db.functionGraphStore.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute() +db.functionGraphStore.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraphStore records + +```typescript +const items = await db.functionGraphStore.findMany({ + select: { id: true, name: true } +}).execute(); +``` + +### Create a functionGraphStore + +```typescript +const item = await db.functionGraphStore.create({ + data: { name: '', databaseId: '', hash: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-graph.md b/.agents/skills/orm-compute/references/function-graph.md new file mode 100644 index 0000000000..4254d30d9c --- /dev/null +++ b/.agents/skills/orm-compute/references/function-graph.md @@ -0,0 +1,34 @@ +# functionGraph + + + +Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + +## Usage + +```typescript +db.functionGraph.findMany({ select: { id: true } }).execute() +db.functionGraph.findOne({ id: '', select: { id: true } }).execute() +db.functionGraph.create({ data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute() +db.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() +db.functionGraph.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionGraph records + +```typescript +const items = await db.functionGraph.findMany({ + select: { id: true, databaseId: true } +}).execute(); +``` + +### Create a functionGraph + +```typescript +const item = await db.functionGraph.create({ + data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/function-invocation.md b/.agents/skills/orm-compute/references/function-invocation.md new file mode 100644 index 0000000000..ec5de00ee8 --- /dev/null +++ b/.agents/skills/orm-compute/references/function-invocation.md @@ -0,0 +1,34 @@ +# functionInvocation + + + +Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + +## Usage + +```typescript +db.functionInvocation.findMany({ select: { id: true } }).execute() +db.functionInvocation.findOne({ id: '', select: { id: true } }).execute() +db.functionInvocation.create({ data: { actorId: '', databaseId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute() +db.functionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute() +db.functionInvocation.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionInvocation records + +```typescript +const items = await db.functionInvocation.findMany({ + select: { id: true, actorId: true } +}).execute(); +``` + +### Create a functionInvocation + +```typescript +const item = await db.functionInvocation.create({ + data: { actorId: '', databaseId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/get-all-record.md b/.agents/skills/orm-compute/references/get-all-record.md new file mode 100644 index 0000000000..5a4df6e375 --- /dev/null +++ b/.agents/skills/orm-compute/references/get-all-record.md @@ -0,0 +1,34 @@ +# getAllRecord + + + +ORM operations for GetAllRecord records + +## Usage + +```typescript +db.getAllRecord.findMany({ select: { id: true } }).execute() +db.getAllRecord.findOne({ id: '', select: { id: true } }).execute() +db.getAllRecord.create({ data: { path: '', data: '' }, select: { id: true } }).execute() +db.getAllRecord.update({ where: { id: '' }, data: { path: '' }, select: { id: true } }).execute() +db.getAllRecord.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all getAllRecord records + +```typescript +const items = await db.getAllRecord.findMany({ + select: { id: true, path: true } +}).execute(); +``` + +### Create a getAllRecord + +```typescript +const item = await db.getAllRecord.create({ + data: { path: '', data: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/import-definitions.md b/.agents/skills/orm-compute/references/import-definitions.md new file mode 100644 index 0000000000..a460094dfd --- /dev/null +++ b/.agents/skills/orm-compute/references/import-definitions.md @@ -0,0 +1,19 @@ +# importDefinitions + + + +Execute the importDefinitions mutation + +## Usage + +```typescript +db.mutation.importDefinitions({ input: { graphId: '', sourceScopeId: '', sourceCommitId: '', contexts: '' } }).execute() +``` + +## Examples + +### Run importDefinitions + +```typescript +const result = await db.mutation.importDefinitions({ input: { graphId: '', sourceScopeId: '', sourceCommitId: '', contexts: '' } }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/import-graph-json.md b/.agents/skills/orm-compute/references/import-graph-json.md new file mode 100644 index 0000000000..34e73d706c --- /dev/null +++ b/.agents/skills/orm-compute/references/import-graph-json.md @@ -0,0 +1,19 @@ +# importGraphJson + + + +Execute the importGraphJson mutation + +## Usage + +```typescript +db.mutation.importGraphJson({ input: '' }).execute() +``` + +## Examples + +### Run importGraphJson + +```typescript +const result = await db.mutation.importGraphJson({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/init-empty-repo.md b/.agents/skills/orm-compute/references/init-empty-repo.md new file mode 100644 index 0000000000..9134c92d86 --- /dev/null +++ b/.agents/skills/orm-compute/references/init-empty-repo.md @@ -0,0 +1,19 @@ +# initEmptyRepo + + + +Execute the initEmptyRepo mutation + +## Usage + +```typescript +db.mutation.initEmptyRepo({ input: { sId: '', storeId: '' } }).execute() +``` + +## Examples + +### Run initEmptyRepo + +```typescript +const result = await db.mutation.initEmptyRepo({ input: { sId: '', storeId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/insert-node-at-path.md b/.agents/skills/orm-compute/references/insert-node-at-path.md new file mode 100644 index 0000000000..956ec68ed8 --- /dev/null +++ b/.agents/skills/orm-compute/references/insert-node-at-path.md @@ -0,0 +1,19 @@ +# insertNodeAtPath + + + +Execute the insertNodeAtPath mutation + +## Usage + +```typescript +db.mutation.insertNodeAtPath({ input: '' }).execute() +``` + +## Examples + +### Run insertNodeAtPath + +```typescript +const result = await db.mutation.insertNodeAtPath({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/org-function-execution-log.md b/.agents/skills/orm-compute/references/org-function-execution-log.md new file mode 100644 index 0000000000..09991abcb7 --- /dev/null +++ b/.agents/skills/orm-compute/references/org-function-execution-log.md @@ -0,0 +1,34 @@ +# orgFunctionExecutionLog + + + +Function execution logs — structured console output per invocation + +## Usage + +```typescript +db.orgFunctionExecutionLog.findMany({ select: { id: true } }).execute() +db.orgFunctionExecutionLog.findOne({ id: '', select: { id: true } }).execute() +db.orgFunctionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '' }, select: { id: true } }).execute() +db.orgFunctionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute() +db.orgFunctionExecutionLog.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all orgFunctionExecutionLog records + +```typescript +const items = await db.orgFunctionExecutionLog.findMany({ + select: { id: true, invocationId: true } +}).execute(); +``` + +### Create a orgFunctionExecutionLog + +```typescript +const item = await db.orgFunctionExecutionLog.create({ + data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/org-function-invocation.md b/.agents/skills/orm-compute/references/org-function-invocation.md new file mode 100644 index 0000000000..1bc9942b21 --- /dev/null +++ b/.agents/skills/orm-compute/references/org-function-invocation.md @@ -0,0 +1,34 @@ +# orgFunctionInvocation + + + +Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + +## Usage + +```typescript +db.orgFunctionInvocation.findMany({ select: { id: true } }).execute() +db.orgFunctionInvocation.findOne({ id: '', select: { id: true } }).execute() +db.orgFunctionInvocation.create({ data: { actorId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute() +db.orgFunctionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute() +db.orgFunctionInvocation.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all orgFunctionInvocation records + +```typescript +const items = await db.orgFunctionInvocation.findMany({ + select: { id: true, actorId: true } +}).execute(); +``` + +### Create a orgFunctionInvocation + +```typescript +const item = await db.orgFunctionInvocation.create({ + data: { actorId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/provision-bucket.md b/.agents/skills/orm-compute/references/provision-bucket.md new file mode 100644 index 0000000000..a9133530f2 --- /dev/null +++ b/.agents/skills/orm-compute/references/provision-bucket.md @@ -0,0 +1,22 @@ +# provisionBucket + + + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +## Usage + +```typescript +db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute() +``` + +## Examples + +### Run provisionBucket + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/read-function-graph.md b/.agents/skills/orm-compute/references/read-function-graph.md new file mode 100644 index 0000000000..6fb441f16b --- /dev/null +++ b/.agents/skills/orm-compute/references/read-function-graph.md @@ -0,0 +1,19 @@ +# readFunctionGraph + + + +Execute the readFunctionGraph query + +## Usage + +```typescript +db.query.readFunctionGraph({ graphId: '' }).execute() +``` + +## Examples + +### Run readFunctionGraph + +```typescript +const result = await db.query.readFunctionGraph({ graphId: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/save-graph.md b/.agents/skills/orm-compute/references/save-graph.md new file mode 100644 index 0000000000..4aee4a65c5 --- /dev/null +++ b/.agents/skills/orm-compute/references/save-graph.md @@ -0,0 +1,19 @@ +# saveGraph + + + +Execute the saveGraph mutation + +## Usage + +```typescript +db.mutation.saveGraph({ input: { graphId: '', rootHash: '', message: '' } }).execute() +``` + +## Examples + +### Run saveGraph + +```typescript +const result = await db.mutation.saveGraph({ input: { graphId: '', rootHash: '', message: '' } }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/secret-definition.md b/.agents/skills/orm-compute/references/secret-definition.md new file mode 100644 index 0000000000..7a0eed32cc --- /dev/null +++ b/.agents/skills/orm-compute/references/secret-definition.md @@ -0,0 +1,34 @@ +# secretDefinition + + + +Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + +## Usage + +```typescript +db.secretDefinition.findMany({ select: { id: true } }).execute() +db.secretDefinition.findOne({ id: '', select: { id: true } }).execute() +db.secretDefinition.create({ data: { name: '', description: '', isBuiltIn: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute() +db.secretDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute() +db.secretDefinition.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all secretDefinition records + +```typescript +const items = await db.secretDefinition.findMany({ + select: { id: true, name: true } +}).execute(); +``` + +### Create a secretDefinition + +```typescript +const item = await db.secretDefinition.create({ + data: { name: '', description: '', isBuiltIn: '', labels: '', annotations: '', databaseId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-compute/references/set-data-at-path.md b/.agents/skills/orm-compute/references/set-data-at-path.md new file mode 100644 index 0000000000..4176ca275b --- /dev/null +++ b/.agents/skills/orm-compute/references/set-data-at-path.md @@ -0,0 +1,19 @@ +# setDataAtPath + + + +Execute the setDataAtPath mutation + +## Usage + +```typescript +db.mutation.setDataAtPath({ input: { sId: '', root: '', path: '', data: '' } }).execute() +``` + +## Examples + +### Run setDataAtPath + +```typescript +const result = await db.mutation.setDataAtPath({ input: { sId: '', root: '', path: '', data: '' } }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/start-execution.md b/.agents/skills/orm-compute/references/start-execution.md new file mode 100644 index 0000000000..01db9ac212 --- /dev/null +++ b/.agents/skills/orm-compute/references/start-execution.md @@ -0,0 +1,19 @@ +# startExecution + + + +Execute the startExecution mutation + +## Usage + +```typescript +db.mutation.startExecution({ input: '' }).execute() +``` + +## Examples + +### Run startExecution + +```typescript +const result = await db.mutation.startExecution({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-compute/references/validate-function-graph.md b/.agents/skills/orm-compute/references/validate-function-graph.md new file mode 100644 index 0000000000..c0b223895b --- /dev/null +++ b/.agents/skills/orm-compute/references/validate-function-graph.md @@ -0,0 +1,19 @@ +# validateFunctionGraph + + + +Execute the validateFunctionGraph mutation + +## Usage + +```typescript +db.mutation.validateFunctionGraph({ input: { graphId: '' } }).execute() +``` + +## Examples + +### Run validateFunctionGraph + +```typescript +const result = await db.mutation.validateFunctionGraph({ input: { graphId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/SKILL.md b/.agents/skills/orm-config/SKILL.md new file mode 100644 index 0000000000..69dd124d57 --- /dev/null +++ b/.agents/skills/orm-config/SKILL.md @@ -0,0 +1,50 @@ +--- +name: orm-config +description: ORM client for the config API — provides typed CRUD operations for 2 tables and 9 custom operations +--- + +# orm-config + + + +ORM client for the config API — provides typed CRUD operations for 2 tables and 9 custom operations + +## Usage + +```typescript +// Import the ORM client +import { db } from './orm'; + +// Available models: platformConfigDefinition, platformConfig +db..findMany({ select: { id: true } }).execute() +db..findOne({ id: '', select: { id: true } }).execute() +db..create({ data: { ... }, select: { id: true } }).execute() +db..update({ where: { id: '' }, data: { ... }, select: { id: true } }).execute() +db..delete({ where: { id: '' } }).execute() +``` + +## Examples + +### Query records + +```typescript +const items = await db.platformConfigDefinition.findMany({ + select: { id: true } +}).execute(); +``` + +## References + +See the `references/` directory for detailed per-entity API documentation: + +- [platform-config-definition](references/platform-config-definition.md) +- [platform-config](references/platform-config.md) +- [platform-secrets-del](references/platform-secrets-del.md) +- [org-secrets-del](references/org-secrets-del.md) +- [platform-secrets-remove-array](references/platform-secrets-remove-array.md) +- [org-secrets-remove-array](references/org-secrets-remove-array.md) +- [platform-secrets-rotate](references/platform-secrets-rotate.md) +- [platform-secrets-set](references/platform-secrets-set.md) +- [org-secrets-rotate](references/org-secrets-rotate.md) +- [org-secrets-set](references/org-secrets-set.md) +- [provision-bucket](references/provision-bucket.md) diff --git a/.agents/skills/orm-config/references/org-secrets-del.md b/.agents/skills/orm-config/references/org-secrets-del.md new file mode 100644 index 0000000000..65709ea3cb --- /dev/null +++ b/.agents/skills/orm-config/references/org-secrets-del.md @@ -0,0 +1,19 @@ +# orgSecretsDel + + + +Execute the orgSecretsDel mutation + +## Usage + +```typescript +db.mutation.orgSecretsDel({ input: { ownerId: '', secretName: '', namespaceId: '' } }).execute() +``` + +## Examples + +### Run orgSecretsDel + +```typescript +const result = await db.mutation.orgSecretsDel({ input: { ownerId: '', secretName: '', namespaceId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/org-secrets-remove-array.md b/.agents/skills/orm-config/references/org-secrets-remove-array.md new file mode 100644 index 0000000000..21bb89ee8f --- /dev/null +++ b/.agents/skills/orm-config/references/org-secrets-remove-array.md @@ -0,0 +1,19 @@ +# orgSecretsRemoveArray + + + +Execute the orgSecretsRemoveArray mutation + +## Usage + +```typescript +db.mutation.orgSecretsRemoveArray({ input: { ownerId: '', secretNames: '', namespaceId: '' } }).execute() +``` + +## Examples + +### Run orgSecretsRemoveArray + +```typescript +const result = await db.mutation.orgSecretsRemoveArray({ input: { ownerId: '', secretNames: '', namespaceId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/org-secrets-rotate.md b/.agents/skills/orm-config/references/org-secrets-rotate.md new file mode 100644 index 0000000000..ee0810c713 --- /dev/null +++ b/.agents/skills/orm-config/references/org-secrets-rotate.md @@ -0,0 +1,19 @@ +# orgSecretsRotate + + + +Execute the orgSecretsRotate mutation + +## Usage + +```typescript +db.mutation.orgSecretsRotate({ input: { ownerId: '', secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute() +``` + +## Examples + +### Run orgSecretsRotate + +```typescript +const result = await db.mutation.orgSecretsRotate({ input: { ownerId: '', secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/org-secrets-set.md b/.agents/skills/orm-config/references/org-secrets-set.md new file mode 100644 index 0000000000..3cb6ae045d --- /dev/null +++ b/.agents/skills/orm-config/references/org-secrets-set.md @@ -0,0 +1,19 @@ +# orgSecretsSet + + + +Execute the orgSecretsSet mutation + +## Usage + +```typescript +db.mutation.orgSecretsSet({ input: { scopeOwnerId: '', secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute() +``` + +## Examples + +### Run orgSecretsSet + +```typescript +const result = await db.mutation.orgSecretsSet({ input: { scopeOwnerId: '', secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/platform-config-definition.md b/.agents/skills/orm-config/references/platform-config-definition.md new file mode 100644 index 0000000000..c0831d0403 --- /dev/null +++ b/.agents/skills/orm-config/references/platform-config-definition.md @@ -0,0 +1,34 @@ +# platformConfigDefinition + + + +Registry of valid config keys — declares which config entries the platform recognizes + +## Usage + +```typescript +db.platformConfigDefinition.findMany({ select: { id: true } }).execute() +db.platformConfigDefinition.findOne({ id: '', select: { id: true } }).execute() +db.platformConfigDefinition.create({ data: { name: '', description: '', defaultValue: '', isBuiltIn: '', labels: '', annotations: '' }, select: { id: true } }).execute() +db.platformConfigDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute() +db.platformConfigDefinition.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all platformConfigDefinition records + +```typescript +const items = await db.platformConfigDefinition.findMany({ + select: { id: true, name: true } +}).execute(); +``` + +### Create a platformConfigDefinition + +```typescript +const item = await db.platformConfigDefinition.create({ + data: { name: '', description: '', defaultValue: '', isBuiltIn: '', labels: '', annotations: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-config/references/platform-config.md b/.agents/skills/orm-config/references/platform-config.md new file mode 100644 index 0000000000..6223a3aa0b --- /dev/null +++ b/.agents/skills/orm-config/references/platform-config.md @@ -0,0 +1,34 @@ +# platformConfig + + + +App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + +## Usage + +```typescript +db.platformConfig.findMany({ select: { id: true } }).execute() +db.platformConfig.findOne({ id: '', select: { id: true } }).execute() +db.platformConfig.create({ data: { namespaceId: '', name: '', value: '', labels: '', annotations: '', description: '', expiresAt: '' }, select: { id: true } }).execute() +db.platformConfig.update({ where: { id: '' }, data: { namespaceId: '' }, select: { id: true } }).execute() +db.platformConfig.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all platformConfig records + +```typescript +const items = await db.platformConfig.findMany({ + select: { id: true, namespaceId: true } +}).execute(); +``` + +### Create a platformConfig + +```typescript +const item = await db.platformConfig.create({ + data: { namespaceId: '', name: '', value: '', labels: '', annotations: '', description: '', expiresAt: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-config/references/platform-secrets-del.md b/.agents/skills/orm-config/references/platform-secrets-del.md new file mode 100644 index 0000000000..b5c94cc9f5 --- /dev/null +++ b/.agents/skills/orm-config/references/platform-secrets-del.md @@ -0,0 +1,19 @@ +# platformSecretsDel + + + +Execute the platformSecretsDel mutation + +## Usage + +```typescript +db.mutation.platformSecretsDel({ input: { secretName: '', namespaceId: '' } }).execute() +``` + +## Examples + +### Run platformSecretsDel + +```typescript +const result = await db.mutation.platformSecretsDel({ input: { secretName: '', namespaceId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/platform-secrets-remove-array.md b/.agents/skills/orm-config/references/platform-secrets-remove-array.md new file mode 100644 index 0000000000..83f90fe13b --- /dev/null +++ b/.agents/skills/orm-config/references/platform-secrets-remove-array.md @@ -0,0 +1,19 @@ +# platformSecretsRemoveArray + + + +Execute the platformSecretsRemoveArray mutation + +## Usage + +```typescript +db.mutation.platformSecretsRemoveArray({ input: { secretNames: '', namespaceId: '' } }).execute() +``` + +## Examples + +### Run platformSecretsRemoveArray + +```typescript +const result = await db.mutation.platformSecretsRemoveArray({ input: { secretNames: '', namespaceId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/platform-secrets-rotate.md b/.agents/skills/orm-config/references/platform-secrets-rotate.md new file mode 100644 index 0000000000..b14ed306f0 --- /dev/null +++ b/.agents/skills/orm-config/references/platform-secrets-rotate.md @@ -0,0 +1,19 @@ +# platformSecretsRotate + + + +Execute the platformSecretsRotate mutation + +## Usage + +```typescript +db.mutation.platformSecretsRotate({ input: { secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute() +``` + +## Examples + +### Run platformSecretsRotate + +```typescript +const result = await db.mutation.platformSecretsRotate({ input: { secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/platform-secrets-set.md b/.agents/skills/orm-config/references/platform-secrets-set.md new file mode 100644 index 0000000000..0101e1cac4 --- /dev/null +++ b/.agents/skills/orm-config/references/platform-secrets-set.md @@ -0,0 +1,19 @@ +# platformSecretsSet + + + +Execute the platformSecretsSet mutation + +## Usage + +```typescript +db.mutation.platformSecretsSet({ input: { secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute() +``` + +## Examples + +### Run platformSecretsSet + +```typescript +const result = await db.mutation.platformSecretsSet({ input: { secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` diff --git a/.agents/skills/orm-config/references/provision-bucket.md b/.agents/skills/orm-config/references/provision-bucket.md new file mode 100644 index 0000000000..a9133530f2 --- /dev/null +++ b/.agents/skills/orm-config/references/provision-bucket.md @@ -0,0 +1,22 @@ +# provisionBucket + + + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +## Usage + +```typescript +db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute() +``` + +## Examples + +### Run provisionBucket + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-modules/SKILL.md b/.agents/skills/orm-modules/SKILL.md index f7c35458bf..690f541308 100644 --- a/.agents/skills/orm-modules/SKILL.md +++ b/.agents/skills/orm-modules/SKILL.md @@ -1,13 +1,13 @@ --- name: orm-modules -description: ORM client for the modules API — provides typed CRUD operations for 57 tables and 12 custom operations +description: ORM client for the modules API — provides typed CRUD operations for 59 tables and 12 custom operations --- # orm-modules -ORM client for the modules API — provides typed CRUD operations for 57 tables and 12 custom operations +ORM client for the modules API — provides typed CRUD operations for 59 tables and 12 custom operations ## Usage @@ -73,14 +73,16 @@ See the `references/` directory for detailed per-entity API documentation: - [function-invocation-module](references/function-invocation-module.md) - [function-module](references/function-module.md) - [invites-module](references/invites-module.md) -- [namespace-module](references/namespace-module.md) - [compute-log-module](references/compute-log-module.md) - [inference-log-module](references/inference-log-module.md) +- [namespace-module](references/namespace-module.md) - [storage-log-module](references/storage-log-module.md) - [transfer-log-module](references/transfer-log-module.md) +- [function-deployment-module](references/function-deployment-module.md) - [plans-module](references/plans-module.md) - [billing-provider-module](references/billing-provider-module.md) - [db-usage-module](references/db-usage-module.md) +- [graph-execution-module](references/graph-execution-module.md) - [hierarchy-module](references/hierarchy-module.md) - [permissions-module](references/permissions-module.md) - [notifications-module](references/notifications-module.md) diff --git a/.agents/skills/orm-modules/references/function-deployment-module.md b/.agents/skills/orm-modules/references/function-deployment-module.md new file mode 100644 index 0000000000..3c5faa82de --- /dev/null +++ b/.agents/skills/orm-modules/references/function-deployment-module.md @@ -0,0 +1,34 @@ +# functionDeploymentModule + + + +ORM operations for FunctionDeploymentModule records + +## Usage + +```typescript +db.functionDeploymentModule.findMany({ select: { id: true } }).execute() +db.functionDeploymentModule.findOne({ id: '', select: { id: true } }).execute() +db.functionDeploymentModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', deploymentsTableId: '', deploymentEventsTableId: '', deploymentsTableName: '', deploymentEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', functionModuleId: '', namespaceModuleId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute() +db.functionDeploymentModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() +db.functionDeploymentModule.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all functionDeploymentModule records + +```typescript +const items = await db.functionDeploymentModule.findMany({ + select: { id: true, databaseId: true } +}).execute(); +``` + +### Create a functionDeploymentModule + +```typescript +const item = await db.functionDeploymentModule.create({ + data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', deploymentsTableId: '', deploymentEventsTableId: '', deploymentsTableName: '', deploymentEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', functionModuleId: '', namespaceModuleId: '', policies: '', provisions: '', defaultPermissions: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-modules/references/graph-execution-module.md b/.agents/skills/orm-modules/references/graph-execution-module.md new file mode 100644 index 0000000000..94b24f988d --- /dev/null +++ b/.agents/skills/orm-modules/references/graph-execution-module.md @@ -0,0 +1,34 @@ +# graphExecutionModule + + + +ORM operations for GraphExecutionModule records + +## Usage + +```typescript +db.graphExecutionModule.findMany({ select: { id: true } }).execute() +db.graphExecutionModule.findOne({ id: '', select: { id: true } }).execute() +db.graphExecutionModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', graphModuleId: '', scope: '', prefix: '', executionsTableId: '', outputsTableId: '', nodeStatesTableId: '', executionsTableName: '', outputsTableName: '', nodeStatesTableName: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute() +db.graphExecutionModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() +db.graphExecutionModule.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all graphExecutionModule records + +```typescript +const items = await db.graphExecutionModule.findMany({ + select: { id: true, databaseId: true } +}).execute(); +``` + +### Create a graphExecutionModule + +```typescript +const item = await db.graphExecutionModule.create({ + data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', graphModuleId: '', scope: '', prefix: '', executionsTableId: '', outputsTableId: '', nodeStatesTableId: '', executionsTableName: '', outputsTableName: '', nodeStatesTableName: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-modules/references/graph-module.md b/.agents/skills/orm-modules/references/graph-module.md index b325b31083..2bdd14385e 100644 --- a/.agents/skills/orm-modules/references/graph-module.md +++ b/.agents/skills/orm-modules/references/graph-module.md @@ -9,7 +9,7 @@ ORM operations for GraphModule records ```typescript db.graphModule.findMany({ select: { id: true } }).execute() db.graphModule.findOne({ id: '', select: { id: true } }).execute() -db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', executionsTableId: '', outputsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute() +db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute() db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() db.graphModule.delete({ where: { id: '' } }).execute() ``` @@ -28,7 +28,7 @@ const items = await db.graphModule.findMany({ ```typescript const item = await db.graphModule.create({ - data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', executionsTableId: '', outputsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, + data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); ``` diff --git a/.agents/skills/orm-modules/references/namespace-module.md b/.agents/skills/orm-modules/references/namespace-module.md index 4a0202accb..7f345fab95 100644 --- a/.agents/skills/orm-modules/references/namespace-module.md +++ b/.agents/skills/orm-modules/references/namespace-module.md @@ -9,7 +9,7 @@ ORM operations for NamespaceModule records ```typescript db.namespaceModule.findMany({ select: { id: true } }).execute() db.namespaceModule.findOne({ id: '', select: { id: true } }).execute() -db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute() +db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', platformNamespacesTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute() db.namespaceModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() db.namespaceModule.delete({ where: { id: '' } }).execute() ``` @@ -28,7 +28,7 @@ const items = await db.namespaceModule.findMany({ ```typescript const item = await db.namespaceModule.create({ - data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, + data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', platformNamespacesTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); ``` diff --git a/graphql/codegen/src/core/codegen/cli/table-command-generator.ts b/graphql/codegen/src/core/codegen/cli/table-command-generator.ts index 622e19521b..7471776f0a 100644 --- a/graphql/codegen/src/core/codegen/cli/table-command-generator.ts +++ b/graphql/codegen/src/core/codegen/cli/table-command-generator.ts @@ -17,6 +17,9 @@ import { getPatchTypeName, getFilterTypeName, getOrderByTypeName, + getExtraInputKeys, + getUpdateInputTypeName, + getDeleteInputTypeName, } from '../utils'; import type { Table, TypeRegistry } from '../../../types/schema'; import type { GeneratedFile } from './executor-generator'; @@ -959,26 +962,27 @@ function buildSearchHandler( function buildGetHandler(table: Table, targetName?: string, typeRegistry?: TypeRegistry): t.FunctionDeclaration { const { singularName } = getTableNames(table); const pkFields = getPrimaryKeyInfo(table); - const pk = pkFields[0]; const selectObj = buildSelectObject(table, typeRegistry); - const promptQuestion = t.objectExpression([ - t.objectProperty(t.identifier('type'), t.stringLiteral('text')), - t.objectProperty(t.identifier('name'), t.stringLiteral(pk.name)), - t.objectProperty(t.identifier('message'), t.stringLiteral(pk.name)), - t.objectProperty(t.identifier('required'), t.booleanLiteral(true)), - ]); - - const pkTsType = pk.gqlType === 'Int' || pk.gqlType === 'BigInt' - ? t.tsNumberKeyword() - : t.tsStringKeyword(); + const promptQuestions = pkFields.map((pkField) => + t.objectExpression([ + t.objectProperty(t.identifier('type'), t.stringLiteral('text')), + t.objectProperty(t.identifier('name'), t.stringLiteral(pkField.name)), + t.objectProperty(t.identifier('message'), t.stringLiteral(pkField.name)), + t.objectProperty(t.identifier('required'), t.booleanLiteral(true)), + ]), + ); const ormArgs = t.objectExpression([ - t.objectProperty( - t.identifier(pk.name), - t.tsAsExpression( - t.memberExpression(t.identifier('answers'), t.identifier(pk.name)), - pkTsType, + ...pkFields.map((pkField) => + t.objectProperty( + t.identifier(pkField.name), + t.tsAsExpression( + t.memberExpression(t.identifier('answers'), t.identifier(pkField.name)), + pkField.gqlType === 'Int' || pkField.gqlType === 'BigInt' + ? t.tsNumberKeyword() + : t.tsStringKeyword(), + ), ), ), t.objectProperty(t.identifier('select'), selectObj), @@ -994,7 +998,7 @@ function buildGetHandler(table: Table, targetName?: string, typeRegistry?: TypeR t.identifier('prompter'), t.identifier('prompt'), ), - [t.identifier('argv'), t.arrayExpression([promptQuestion])], + [t.identifier('argv'), t.arrayExpression(promptQuestions)], ), ), ), @@ -1064,9 +1068,24 @@ function buildMutationHandler( typeRegistry?: TypeRegistry, ormTypes?: { createInputTypeName: string; innerFieldName: string; patchTypeName: string }, ): t.FunctionDeclaration { - const { singularName } = getTableNames(table); + const { singularName, typeName } = getTableNames(table); const pkFields = getPrimaryKeyInfo(table); - const pk = pkFields[0]; + const pkFieldNames = new Set(pkFields.map((p) => p.name)); + + // Discover extra required fields on mutation input types beyond the PK. + // For partitioned tables, PostGraphile adds the partition key (e.g. createdAt, + // databaseId) as a required field on the update/delete input types. + // These must be included in the CLI where clause to match the ORM's type. + const patchFieldName = table.query?.patchFieldName ?? lcFirst(typeName) + 'Patch'; + const updateExtraKeys = operation === 'update' + ? getExtraInputKeys(getUpdateInputTypeName(table), pkFieldNames, patchFieldName, typeRegistry) + : []; + const deleteExtraKeys = operation === 'delete' + ? getExtraInputKeys(getDeleteInputTypeName(table), pkFieldNames, null, typeRegistry) + : []; + const extraKeys = operation === 'update' ? updateExtraKeys : deleteExtraKeys; + // All fields that go in the where clause (PK fields + extra keys) + const allWhereFieldNames = new Set([...pkFieldNames, ...extraKeys.map((ek) => ek.name)]); // Get the set of writable field names from the type registry // This filters out computed fields (e.g. searchTsvRank, hashUuid) that exist @@ -1077,7 +1096,7 @@ function buildMutationHandler( const fieldsWithDefaults = getFieldsWithDefaults(table, typeRegistry); // For create: include fields that are in the create input type. - // For update/delete: always exclude the PK (it goes in `where`, not `data`). + // For update/delete: always exclude ALL where-clause fields (PK + extra keys). // The ORM input-types generator always excludes these fields from create inputs // (see EXCLUDED_MUTATION_FIELDS in input-types-generator.ts). We must match this // to avoid generating data properties that don't exist on the ORM create type. @@ -1086,11 +1105,11 @@ function buildMutationHandler( const ORM_EXCLUDED_FIELDS = ['id', 'createdAt', 'updatedAt', 'nodeId']; const editableFields = getScalarFields(table).filter( (f) => - // For update/delete: always exclude PK (it goes in `where`, not `data`) + // For update/delete: always exclude ALL where-clause fields (PK + extra keys) // For create: exclude PK only if it's in the ORM exclusion list (e.g. 'id') - (f.name !== pk.name || (operation === 'create' && !ORM_EXCLUDED_FIELDS.includes(pk.name))) && - // Always exclude ORM-excluded fields (except PK which is handled above) - (f.name === pk.name || !ORM_EXCLUDED_FIELDS.includes(f.name)) && + (!allWhereFieldNames.has(f.name) || (operation === 'create' && !ORM_EXCLUDED_FIELDS.includes(f.name))) && + // Always exclude ORM-excluded fields (except where-clause fields handled above) + (allWhereFieldNames.has(f.name) || !ORM_EXCLUDED_FIELDS.includes(f.name)) && // If we have type registry info, only include fields that exist in the input type (writableFields === null || writableFields.has(f.name)), ); @@ -1098,14 +1117,28 @@ function buildMutationHandler( const questions: t.Expression[] = []; if (operation === 'update' || operation === 'delete') { - questions.push( - t.objectExpression([ - t.objectProperty(t.identifier('type'), t.stringLiteral('text')), - t.objectProperty(t.identifier('name'), t.stringLiteral(pk.name)), - t.objectProperty(t.identifier('message'), t.stringLiteral(pk.name)), - t.objectProperty(t.identifier('required'), t.booleanLiteral(true)), - ]), - ); + // Prompt for all PK fields + for (const pkField of pkFields) { + questions.push( + t.objectExpression([ + t.objectProperty(t.identifier('type'), t.stringLiteral('text')), + t.objectProperty(t.identifier('name'), t.stringLiteral(pkField.name)), + t.objectProperty(t.identifier('message'), t.stringLiteral(pkField.name)), + t.objectProperty(t.identifier('required'), t.booleanLiteral(true)), + ]), + ); + } + // Prompt for extra key fields (e.g. partition keys like createdAt, databaseId) + for (const ek of extraKeys) { + questions.push( + t.objectExpression([ + t.objectProperty(t.identifier('type'), t.stringLiteral('text')), + t.objectProperty(t.identifier('name'), t.stringLiteral(ek.name)), + t.objectProperty(t.identifier('message'), t.stringLiteral(ek.name)), + t.objectProperty(t.identifier('required'), t.booleanLiteral(true)), + ]), + ); + } } if (operation !== 'delete') { @@ -1146,9 +1179,11 @@ function buildMutationHandler( const selectObj = operation === 'delete' - ? t.objectExpression([ - t.objectProperty(t.identifier(pk.name), t.booleanLiteral(true)), - ]) + ? t.objectExpression( + pkFields.map((pkField) => + t.objectProperty(t.identifier(pkField.name), t.booleanLiteral(true)), + ), + ) : buildSelectObject(table, typeRegistry); let ormArgs: t.ObjectExpression; @@ -1168,6 +1203,31 @@ function buildMutationHandler( ); + const buildWhereProps = () => [ + ...pkFields.map((pkField) => + t.objectProperty( + t.identifier(pkField.name), + t.tsAsExpression( + t.memberExpression(t.identifier('answers'), t.identifier(pkField.name)), + pkField.gqlType === 'Int' || pkField.gqlType === 'BigInt' + ? t.tsNumberKeyword() + : t.tsStringKeyword(), + ), + ), + ), + ...extraKeys.map((ek) => + t.objectProperty( + t.identifier(ek.name), + t.tsAsExpression( + t.memberExpression(t.identifier('answers'), t.identifier(ek.name)), + ek.tsType === 'number' + ? t.tsNumberKeyword() + : t.tsStringKeyword(), + ), + ), + ), + ]; + if (operation === 'create') { ormArgs = t.objectExpression([ t.objectProperty( @@ -1180,17 +1240,7 @@ function buildMutationHandler( ormArgs = t.objectExpression([ t.objectProperty( t.identifier('where'), - t.objectExpression([ - t.objectProperty( - t.identifier(pk.name), - t.tsAsExpression( - t.memberExpression(t.identifier('answers'), t.identifier(pk.name)), - pk.gqlType === 'Int' || pk.gqlType === 'BigInt' - ? t.tsNumberKeyword() - : t.tsStringKeyword(), - ), - ), - ]), + t.objectExpression(buildWhereProps()), ), t.objectProperty( t.identifier('data'), @@ -1202,17 +1252,7 @@ function buildMutationHandler( ormArgs = t.objectExpression([ t.objectProperty( t.identifier('where'), - t.objectExpression([ - t.objectProperty( - t.identifier(pk.name), - t.tsAsExpression( - t.memberExpression(t.identifier('answers'), t.identifier(pk.name)), - pk.gqlType === 'Int' || pk.gqlType === 'BigInt' - ? t.tsNumberKeyword() - : t.tsStringKeyword(), - ), - ), - ]), + t.objectExpression(buildWhereProps()), ), t.objectProperty(t.identifier('select'), selectObj), ]); diff --git a/sdk/constructive-cli/README.md b/sdk/constructive-cli/README.md index fff798ad59..fd3b22c3b4 100644 --- a/sdk/constructive-cli/README.md +++ b/sdk/constructive-cli/README.md @@ -14,6 +14,8 @@ | agent | - | ORM, CLI | [./src/agent/README.md](./src/agent/README.md) | | api | - | ORM, CLI | [./src/api/README.md](./src/api/README.md) | | auth | - | ORM, CLI | [./src/auth/README.md](./src/auth/README.md) | +| compute | - | ORM, CLI | [./src/compute/README.md](./src/compute/README.md) | +| config | - | ORM, CLI | [./src/config/README.md](./src/config/README.md) | | modules | - | ORM, CLI | [./src/modules/README.md](./src/modules/README.md) | | objects | - | ORM, CLI | [./src/objects/README.md](./src/objects/README.md) | | usage | - | ORM, CLI | [./src/usage/README.md](./src/usage/README.md) | diff --git a/sdk/constructive-cli/src/.targets b/sdk/constructive-cli/src/.targets index bf4de0b16a..42542d6c87 100644 --- a/sdk/constructive-cli/src/.targets +++ b/sdk/constructive-cli/src/.targets @@ -1 +1 @@ -["admin","agent","api","auth","modules","objects","usage"] +["admin","agent","api","auth","compute","config","modules","objects","usage"] diff --git a/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts index fd80edc234..cc7a22623e 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appAdminGrant.ts @@ -196,7 +196,8 @@ export class AppAdminGrantModel { 'UpdateAppAdminGrantInput', 'id', 'appAdminGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts b/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts index c9e66ec9c8..598f1b15af 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appClaimedInvite.ts @@ -196,7 +196,8 @@ export class AppClaimedInviteModel { 'UpdateAppClaimedInviteInput', 'id', 'appClaimedInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appGrant.ts index 4481fb3d83..d773ff6de1 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appGrant.ts @@ -196,7 +196,8 @@ export class AppGrantModel { 'UpdateAppGrantInput', 'id', 'appGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appInvite.ts b/sdk/constructive-cli/src/admin/orm/models/appInvite.ts index 5fcbff9369..3350bba65b 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appInvite.ts @@ -196,7 +196,8 @@ export class AppInviteModel { 'UpdateAppInviteInput', 'id', 'appInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appMembership.ts b/sdk/constructive-cli/src/admin/orm/models/appMembership.ts index a4011c41ab..1faa691016 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appMembership.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appMembership.ts @@ -196,7 +196,8 @@ export class AppMembershipModel { 'UpdateAppMembershipInput', 'id', 'appMembershipPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts b/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts index f69f1aca69..efc0ab28ee 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appMembershipDefault.ts @@ -198,7 +198,8 @@ export class AppMembershipDefaultModel { 'UpdateAppMembershipDefaultInput', 'id', 'appMembershipDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts index eeb815d842..28f7d92d12 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appOwnerGrant.ts @@ -196,7 +196,8 @@ export class AppOwnerGrantModel { 'UpdateAppOwnerGrantInput', 'id', 'appOwnerGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermission.ts b/sdk/constructive-cli/src/admin/orm/models/appPermission.ts index e71adea658..efa4812398 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermission.ts @@ -196,7 +196,8 @@ export class AppPermissionModel { 'UpdateAppPermissionInput', 'id', 'appPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts index d5511aed01..c967364f31 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefault.ts @@ -198,7 +198,8 @@ export class AppPermissionDefaultModel { 'UpdateAppPermissionDefaultInput', 'id', 'appPermissionDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts index 6915611884..b6a3b10748 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultGrant.ts @@ -198,7 +198,8 @@ export class AppPermissionDefaultGrantModel { 'UpdateAppPermissionDefaultGrantInput', 'id', 'appPermissionDefaultGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts index eeee28fadd..6e47d9eeec 100644 --- a/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/appPermissionDefaultPermission.ts @@ -221,7 +221,8 @@ export class AppPermissionDefaultPermissionModel { 'UpdateAppPermissionDefaultPermissionInput', 'id', 'appPermissionDefaultPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/membershipType.ts b/sdk/constructive-cli/src/admin/orm/models/membershipType.ts index ee7ed596c0..1ab7c15781 100644 --- a/sdk/constructive-cli/src/admin/orm/models/membershipType.ts +++ b/sdk/constructive-cli/src/admin/orm/models/membershipType.ts @@ -196,7 +196,8 @@ export class MembershipTypeModel { 'UpdateMembershipTypeInput', 'id', 'membershipTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts index 7b13377316..9ef902aaa8 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgAdminGrant.ts @@ -196,7 +196,8 @@ export class OrgAdminGrantModel { 'UpdateOrgAdminGrantInput', 'id', 'orgAdminGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgChartEdge.ts b/sdk/constructive-cli/src/admin/orm/models/orgChartEdge.ts index 8a43b83a98..80c81b0e08 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgChartEdge.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgChartEdge.ts @@ -196,7 +196,8 @@ export class OrgChartEdgeModel { 'UpdateOrgChartEdgeInput', 'id', 'orgChartEdgePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgChartEdgeGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgChartEdgeGrant.ts index 168a6fe3db..c9df058dfd 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgChartEdgeGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgChartEdgeGrant.ts @@ -196,7 +196,8 @@ export class OrgChartEdgeGrantModel { 'UpdateOrgChartEdgeGrantInput', 'id', 'orgChartEdgeGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts b/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts index e1a3aecafb..82b31bb474 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgClaimedInvite.ts @@ -196,7 +196,8 @@ export class OrgClaimedInviteModel { 'UpdateOrgClaimedInviteInput', 'id', 'orgClaimedInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts index c8e74f5cc6..467c6b11b9 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgGrant.ts @@ -196,7 +196,8 @@ export class OrgGrantModel { 'UpdateOrgGrantInput', 'id', 'orgGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts b/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts index 8d7931f078..50cc5eb9e6 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgInvite.ts @@ -196,7 +196,8 @@ export class OrgInviteModel { 'UpdateOrgInviteInput', 'id', 'orgInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMember.ts b/sdk/constructive-cli/src/admin/orm/models/orgMember.ts index 44f5608f45..bf7ac25fe9 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMember.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMember.ts @@ -196,7 +196,8 @@ export class OrgMemberModel { 'UpdateOrgMemberInput', 'id', 'orgMemberPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts b/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts index 77357e1745..9cecf8839b 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMemberProfile.ts @@ -196,7 +196,8 @@ export class OrgMemberProfileModel { 'UpdateOrgMemberProfileInput', 'id', 'orgMemberProfilePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts b/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts index 623ec08fe2..06ee032ca8 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMembership.ts @@ -196,7 +196,8 @@ export class OrgMembershipModel { 'UpdateOrgMembershipInput', 'id', 'orgMembershipPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts b/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts index 3441315057..525619dfca 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMembershipDefault.ts @@ -198,7 +198,8 @@ export class OrgMembershipDefaultModel { 'UpdateOrgMembershipDefaultInput', 'id', 'orgMembershipDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts b/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts index 46801fc913..de551183d2 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgMembershipSetting.ts @@ -198,7 +198,8 @@ export class OrgMembershipSettingModel { 'UpdateOrgMembershipSettingInput', 'id', 'orgMembershipSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts index 9614dce8fc..d99550bd73 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgOwnerGrant.ts @@ -196,7 +196,8 @@ export class OrgOwnerGrantModel { 'UpdateOrgOwnerGrantInput', 'id', 'orgOwnerGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts index 7bdc906323..e3aded7147 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermission.ts @@ -196,7 +196,8 @@ export class OrgPermissionModel { 'UpdateOrgPermissionInput', 'id', 'orgPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts index 8d00b99325..20ed957d15 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefault.ts @@ -198,7 +198,8 @@ export class OrgPermissionDefaultModel { 'UpdateOrgPermissionDefaultInput', 'id', 'orgPermissionDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts index 2f1a709be3..07d5976acb 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultGrant.ts @@ -198,7 +198,8 @@ export class OrgPermissionDefaultGrantModel { 'UpdateOrgPermissionDefaultGrantInput', 'id', 'orgPermissionDefaultGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts index 7c898408dc..3339ceaeca 100644 --- a/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts +++ b/sdk/constructive-cli/src/admin/orm/models/orgPermissionDefaultPermission.ts @@ -221,7 +221,8 @@ export class OrgPermissionDefaultPermissionModel { 'UpdateOrgPermissionDefaultPermissionInput', 'id', 'orgPermissionDefaultPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/admin/orm/query-builder.ts b/sdk/constructive-cli/src/admin/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-cli/src/admin/orm/query-builder.ts +++ b/sdk/constructive-cli/src/admin/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-cli/src/agent/orm/input-types.ts b/sdk/constructive-cli/src/agent/orm/input-types.ts index dbb8e0c07f..8198498912 100644 --- a/sdk/constructive-cli/src/agent/orm/input-types.ts +++ b/sdk/constructive-cli/src/agent/orm/input-types.ts @@ -1092,7 +1092,8 @@ export interface AgentResourceFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -1569,6 +1570,7 @@ export interface CreateAgentResourceChunkInput { chunkIndex?: number; embedding?: number[]; metadata?: Record; + embeddingText?: string; }; } export interface AgentResourceChunkPatch { @@ -1577,6 +1579,7 @@ export interface AgentResourceChunkPatch { chunkIndex?: number | null; embedding?: number[] | null; metadata?: Record | null; + embeddingText?: string | null; } export interface UpdateAgentResourceChunkInput { clientMutationId?: string; @@ -1638,6 +1641,7 @@ export interface CreateAgentResourceInput { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + embeddingText?: string; }; } export interface AgentResourcePatch { @@ -1655,6 +1659,7 @@ export interface AgentResourcePatch { archivedAt?: string | null; embedding?: number[] | null; embeddingUpdatedAt?: string | null; + embeddingText?: string | null; } export interface UpdateAgentResourceInput { clientMutationId?: string; @@ -1770,6 +1775,8 @@ export interface VectorNearbyInput { distance?: number; /** When true (default for tables with @hasChunks), transparently queries the chunks table and returns the minimum distance across parent + all chunks. Set to false to only search the parent embedding. */ includeChunks?: boolean; + /** Natural language text to embed server-side for similarity search. Mutually exclusive with `vector` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + text?: string; } /** A filter to be used against many `Agent` object types. All fields are combined with a logical ‘and.’ */ export interface AgentPersonaToManyAgentFilter { @@ -2021,6 +2028,8 @@ export interface AgentResourceChunkInput { metadata?: Record; createdAt?: string; updatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } /** An input for mutations affecting `AgentPersona` */ export interface AgentPersonaInput { @@ -2073,6 +2082,8 @@ export interface AgentResourceInput { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } /** A filter to be used against `AgentTask` object types. All fields are combined with a logical ‘and.’ */ export interface AgentTaskFilter { @@ -2721,7 +2732,8 @@ export interface AgentResourceFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; diff --git a/sdk/constructive-cli/src/agent/orm/models/agent.ts b/sdk/constructive-cli/src/agent/orm/models/agent.ts index 1bf091a6cf..72f4b04da0 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agent.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agent.ts @@ -196,7 +196,8 @@ export class AgentModel { 'UpdateAgentInput', 'id', 'agentPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts b/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts index d128641c85..ffa3a09734 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentMessage.ts @@ -196,7 +196,8 @@ export class AgentMessageModel { 'UpdateAgentMessageInput', 'id', 'agentMessagePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts b/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts index 84cebbe0e1..1391dbde2c 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentPersona.ts @@ -196,7 +196,8 @@ export class AgentPersonaModel { 'UpdateAgentPersonaInput', 'id', 'agentPersonaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts b/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts index ec029de47d..9829718fee 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentPlan.ts @@ -196,7 +196,8 @@ export class AgentPlanModel { 'UpdateAgentPlanInput', 'id', 'agentPlanPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts b/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts index 5e4aa9b6d1..e301bf6c99 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentPrompt.ts @@ -196,7 +196,8 @@ export class AgentPromptModel { 'UpdateAgentPromptInput', 'id', 'agentPromptPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentResource.ts b/sdk/constructive-cli/src/agent/orm/models/agentResource.ts index a02699c383..7628b03b3c 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentResource.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentResource.ts @@ -196,7 +196,8 @@ export class AgentResourceModel { 'UpdateAgentResourceInput', 'id', 'agentResourcePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts b/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts index b69cb15557..fd5edf82ac 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentResourceChunk.ts @@ -196,7 +196,8 @@ export class AgentResourceChunkModel { 'UpdateAgentResourceChunkInput', 'id', 'agentResourceChunkPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentTask.ts b/sdk/constructive-cli/src/agent/orm/models/agentTask.ts index 3bbc609f16..a4b3a1e367 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentTask.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentTask.ts @@ -196,7 +196,8 @@ export class AgentTaskModel { 'UpdateAgentTaskInput', 'id', 'agentTaskPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/models/agentThread.ts b/sdk/constructive-cli/src/agent/orm/models/agentThread.ts index 7bbd14abec..1ae2eb5a67 100644 --- a/sdk/constructive-cli/src/agent/orm/models/agentThread.ts +++ b/sdk/constructive-cli/src/agent/orm/models/agentThread.ts @@ -196,7 +196,8 @@ export class AgentThreadModel { 'UpdateAgentThreadInput', 'id', 'agentThreadPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/agent/orm/query-builder.ts b/sdk/constructive-cli/src/agent/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-cli/src/agent/orm/query-builder.ts +++ b/sdk/constructive-cli/src/agent/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-cli/src/api/cli/README.md b/sdk/constructive-cli/src/api/cli/README.md index b307d9b7aa..360a9eb727 100644 --- a/sdk/constructive-cli/src/api/cli/README.md +++ b/sdk/constructive-cli/src/api/cli/README.md @@ -195,11 +195,12 @@ CRUD operations for Schema records. | `scope` | Int | | `tags` | String | | `isPublic` | Boolean | +| `apiExposure` | ApiExposureLevel | | `createdAt` | Datetime | | `updatedAt` | Datetime | **Required create fields:** `databaseId`, `name`, `schemaName` -**Optional create fields (backend defaults):** `label`, `description`, `smartTags`, `category`, `scope`, `tags`, `isPublic` +**Optional create fields (backend defaults):** `label`, `description`, `smartTags`, `category`, `scope`, `tags`, `isPublic`, `apiExposure` ### `table` diff --git a/sdk/constructive-cli/src/api/cli/commands/schema.ts b/sdk/constructive-cli/src/api/cli/commands/schema.ts index 6eafc21367..d24f3d6d41 100644 --- a/sdk/constructive-cli/src/api/cli/commands/schema.ts +++ b/sdk/constructive-cli/src/api/cli/commands/schema.ts @@ -27,6 +27,7 @@ const fieldSchema: FieldSchema = { scope: 'int', tags: 'string', isPublic: 'boolean', + apiExposure: 'string', createdAt: 'string', updatedAt: 'string', }; @@ -92,6 +93,7 @@ async function handleList(argv: Partial>, _prompter: Inq scope: true, tags: true, isPublic: true, + apiExposure: true, createdAt: true, updatedAt: true, }; @@ -125,6 +127,7 @@ async function handleFindFirst(argv: Partial>, _prompter scope: true, tags: true, isPublic: true, + apiExposure: true, createdAt: true, updatedAt: true, }; @@ -170,6 +173,7 @@ async function handleGet(argv: Partial>, prompter: Inqui scope: true, tags: true, isPublic: true, + apiExposure: true, createdAt: true, updatedAt: true, }, @@ -254,6 +258,13 @@ async function handleCreate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, + { + type: 'text', + name: 'apiExposure', + message: 'apiExposure', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as CreateSchemaInput['schema']; @@ -271,6 +282,7 @@ async function handleCreate(argv: Partial>, prompter: In scope: cleanedData.scope, tags: cleanedData.tags, isPublic: cleanedData.isPublic, + apiExposure: cleanedData.apiExposure, }, select: { id: true, @@ -284,6 +296,7 @@ async function handleCreate(argv: Partial>, prompter: In scope: true, tags: true, isPublic: true, + apiExposure: true, createdAt: true, updatedAt: true, }, @@ -374,6 +387,13 @@ async function handleUpdate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, + { + type: 'text', + name: 'apiExposure', + message: 'apiExposure', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as SchemaPatch; @@ -394,6 +414,7 @@ async function handleUpdate(argv: Partial>, prompter: In scope: cleanedData.scope, tags: cleanedData.tags, isPublic: cleanedData.isPublic, + apiExposure: cleanedData.apiExposure, }, select: { id: true, @@ -407,6 +428,7 @@ async function handleUpdate(argv: Partial>, prompter: In scope: true, tags: true, isPublic: true, + apiExposure: true, createdAt: true, updatedAt: true, }, diff --git a/sdk/constructive-cli/src/api/orm/README.md b/sdk/constructive-cli/src/api/orm/README.md index e4f38f7327..caf70c1803 100644 --- a/sdk/constructive-cli/src/api/orm/README.md +++ b/sdk/constructive-cli/src/api/orm/README.md @@ -121,6 +121,7 @@ CRUD operations for Schema records. | `scope` | Int | Yes | | `tags` | String | Yes | | `isPublic` | Boolean | Yes | +| `apiExposure` | ApiExposureLevel | Yes | | `createdAt` | Datetime | No | | `updatedAt` | Datetime | No | @@ -128,13 +129,13 @@ CRUD operations for Schema records. ```typescript // List all schema records -const items = await db.schema.findMany({ select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }).execute(); +const items = await db.schema.findMany({ select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }).execute(); // Get one by id -const item = await db.schema.findOne({ id: '', select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }).execute(); +const item = await db.schema.findOne({ id: '', select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }).execute(); // Create -const created = await db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '' }, select: { id: true } }).execute(); +const created = await db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '', apiExposure: '' }, select: { id: true } }).execute(); // Update const updated = await db.schema.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); diff --git a/sdk/constructive-cli/src/api/orm/input-types.ts b/sdk/constructive-cli/src/api/orm/input-types.ts index 75eb0921a8..b1e5d0f51c 100644 --- a/sdk/constructive-cli/src/api/orm/input-types.ts +++ b/sdk/constructive-cli/src/api/orm/input-types.ts @@ -231,6 +231,7 @@ export interface UUIDListFilter { anyGreaterThanOrEqualTo?: string; } // ============ Enum Types ============ +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; export type ObjectCategory = 'CORE' | 'MODULE' | 'PERMISSIONS' | 'AUTH' | 'MEMBERSHIPS' | 'APP'; // ============ Custom Scalar Types ============ export type ConstructiveInternalTypeAttachment = unknown; @@ -257,6 +258,7 @@ export interface Schema { scope?: number | null; tags?: string[] | null; isPublic?: boolean | null; + apiExposure?: ApiExposureLevel | null; createdAt?: string | null; updatedAt?: string | null; } @@ -1329,6 +1331,7 @@ export type SchemaSelect = { scope?: boolean; tags?: boolean; isPublic?: boolean; + apiExposure?: boolean; createdAt?: boolean; updatedAt?: boolean; database?: { @@ -2718,6 +2721,8 @@ export interface SchemaFilter { tags?: StringListFilter; /** Filter by the object’s `isPublic` field. */ isPublic?: BooleanFilter; + /** Filter by the object’s `apiExposure` field. */ + apiExposure?: ApiExposureLevelFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ @@ -4652,6 +4657,8 @@ export type SchemaOrderBy = | 'TAGS_DESC' | 'IS_PUBLIC_ASC' | 'IS_PUBLIC_DESC' + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' @@ -5804,6 +5811,7 @@ export interface CreateSchemaInput { scope?: number; tags?: string[]; isPublic?: boolean; + apiExposure?: ApiExposureLevel; }; } export interface SchemaPatch { @@ -5817,6 +5825,7 @@ export interface SchemaPatch { scope?: number | null; tags?: string[] | null; isPublic?: boolean | null; + apiExposure?: ApiExposureLevel | null; } export interface UpdateSchemaInput { clientMutationId?: string; @@ -7497,6 +7506,31 @@ export interface ObjectCategoryFilter { /** Greater than or equal to the specified value. */ greaterThanOrEqualTo?: ObjectCategory; } +/** A filter to be used against ApiExposureLevel fields. All fields are combined with a logical ‘and.’ */ +export interface ApiExposureLevelFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: ApiExposureLevel; + /** Not equal to the specified value. */ + notEqualTo?: ApiExposureLevel; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: ApiExposureLevel; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: ApiExposureLevel; + /** Included in the specified list. */ + in?: ApiExposureLevel[]; + /** Not included in the specified list. */ + notIn?: ApiExposureLevel[]; + /** Less than the specified value. */ + lessThan?: ApiExposureLevel; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: ApiExposureLevel; + /** Greater than the specified value. */ + greaterThan?: ApiExposureLevel; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: ApiExposureLevel; +} /** A filter to be used against many `Table` object types. All fields are combined with a logical ‘and.’ */ export interface SchemaToManyTableFilter { /** Filters to entities where at least one related entity matches. */ @@ -8457,6 +8491,7 @@ export interface SchemaInput { scope?: number; tags?: string[]; isPublic?: boolean; + apiExposure?: ApiExposureLevel; createdAt?: string; updatedAt?: string; } @@ -10346,6 +10381,8 @@ export interface SchemaFilter { tags?: StringListFilter; /** Filter by the object’s `isPublic` field. */ isPublic?: BooleanFilter; + /** Filter by the object’s `apiExposure` field. */ + apiExposure?: ApiExposureLevelFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ diff --git a/sdk/constructive-cli/src/api/orm/models/api.ts b/sdk/constructive-cli/src/api/orm/models/api.ts index 5e2e04bd39..4d60695731 100644 --- a/sdk/constructive-cli/src/api/orm/models/api.ts +++ b/sdk/constructive-cli/src/api/orm/models/api.ts @@ -196,7 +196,8 @@ export class ApiModel { 'UpdateApiInput', 'id', 'apiPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/apiModule.ts b/sdk/constructive-cli/src/api/orm/models/apiModule.ts index d98c67c6e7..dd9bb29f76 100644 --- a/sdk/constructive-cli/src/api/orm/models/apiModule.ts +++ b/sdk/constructive-cli/src/api/orm/models/apiModule.ts @@ -196,7 +196,8 @@ export class ApiModuleModel { 'UpdateApiModuleInput', 'id', 'apiModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/apiSchema.ts b/sdk/constructive-cli/src/api/orm/models/apiSchema.ts index 9ef99da8cd..2179728a2b 100644 --- a/sdk/constructive-cli/src/api/orm/models/apiSchema.ts +++ b/sdk/constructive-cli/src/api/orm/models/apiSchema.ts @@ -196,7 +196,8 @@ export class ApiSchemaModel { 'UpdateApiSchemaInput', 'id', 'apiSchemaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/apiSetting.ts b/sdk/constructive-cli/src/api/orm/models/apiSetting.ts index 9c3140fdc9..01f1b5b74e 100644 --- a/sdk/constructive-cli/src/api/orm/models/apiSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/apiSetting.ts @@ -196,7 +196,8 @@ export class ApiSettingModel { 'UpdateApiSettingInput', 'id', 'apiSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/app.ts b/sdk/constructive-cli/src/api/orm/models/app.ts index 73ac9831b1..049d73f6c0 100644 --- a/sdk/constructive-cli/src/api/orm/models/app.ts +++ b/sdk/constructive-cli/src/api/orm/models/app.ts @@ -196,7 +196,8 @@ export class AppModel { 'UpdateAppInput', 'id', 'appPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts b/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts index 5c052886fa..7f6054e6a4 100644 --- a/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/checkConstraint.ts @@ -196,7 +196,8 @@ export class CheckConstraintModel { 'UpdateCheckConstraintInput', 'id', 'checkConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/compositeType.ts b/sdk/constructive-cli/src/api/orm/models/compositeType.ts index 0f46f810e9..72f4ab3adf 100644 --- a/sdk/constructive-cli/src/api/orm/models/compositeType.ts +++ b/sdk/constructive-cli/src/api/orm/models/compositeType.ts @@ -196,7 +196,8 @@ export class CompositeTypeModel { 'UpdateCompositeTypeInput', 'id', 'compositeTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/corsSetting.ts b/sdk/constructive-cli/src/api/orm/models/corsSetting.ts index 91b61c1eb4..2e37465f00 100644 --- a/sdk/constructive-cli/src/api/orm/models/corsSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/corsSetting.ts @@ -196,7 +196,8 @@ export class CorsSettingModel { 'UpdateCorsSettingInput', 'id', 'corsSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/database.ts b/sdk/constructive-cli/src/api/orm/models/database.ts index 57b3505489..41c99ba120 100644 --- a/sdk/constructive-cli/src/api/orm/models/database.ts +++ b/sdk/constructive-cli/src/api/orm/models/database.ts @@ -196,7 +196,8 @@ export class DatabaseModel { 'UpdateDatabaseInput', 'id', 'databasePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts b/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts index 08d9ab8cb6..6743fdbdc2 100644 --- a/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/databaseSetting.ts @@ -196,7 +196,8 @@ export class DatabaseSettingModel { 'UpdateDatabaseSettingInput', 'id', 'databaseSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts b/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts index dd22777cdf..9260ed2fb7 100644 --- a/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts +++ b/sdk/constructive-cli/src/api/orm/models/databaseTransfer.ts @@ -196,7 +196,8 @@ export class DatabaseTransferModel { 'UpdateDatabaseTransferInput', 'id', 'databaseTransferPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts b/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts index 36414357b3..8d964bf6a4 100644 --- a/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts +++ b/sdk/constructive-cli/src/api/orm/models/defaultPrivilege.ts @@ -196,7 +196,8 @@ export class DefaultPrivilegeModel { 'UpdateDefaultPrivilegeInput', 'id', 'defaultPrivilegePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/domain.ts b/sdk/constructive-cli/src/api/orm/models/domain.ts index ab0016ec4b..d5d807ae4c 100644 --- a/sdk/constructive-cli/src/api/orm/models/domain.ts +++ b/sdk/constructive-cli/src/api/orm/models/domain.ts @@ -196,7 +196,8 @@ export class DomainModel { 'UpdateDomainInput', 'id', 'domainPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts b/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts index a5c7feb754..90af6f51a9 100644 --- a/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts +++ b/sdk/constructive-cli/src/api/orm/models/embeddingChunk.ts @@ -196,7 +196,8 @@ export class EmbeddingChunkModel { 'UpdateEmbeddingChunkInput', 'id', 'embeddingChunkPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/enum.ts b/sdk/constructive-cli/src/api/orm/models/enum.ts index 58495e1551..b5f965ea6f 100644 --- a/sdk/constructive-cli/src/api/orm/models/enum.ts +++ b/sdk/constructive-cli/src/api/orm/models/enum.ts @@ -196,7 +196,8 @@ export class EnumModel { 'UpdateEnumInput', 'id', 'enumPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/field.ts b/sdk/constructive-cli/src/api/orm/models/field.ts index 7664e791c7..baa1994dbd 100644 --- a/sdk/constructive-cli/src/api/orm/models/field.ts +++ b/sdk/constructive-cli/src/api/orm/models/field.ts @@ -196,7 +196,8 @@ export class FieldModel { 'UpdateFieldInput', 'id', 'fieldPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts b/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts index 36e80496f3..498b987bd0 100644 --- a/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/foreignKeyConstraint.ts @@ -198,7 +198,8 @@ export class ForeignKeyConstraintModel { 'UpdateForeignKeyConstraintInput', 'id', 'foreignKeyConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts b/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts index 2135f84475..1fc50cde73 100644 --- a/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts +++ b/sdk/constructive-cli/src/api/orm/models/fullTextSearch.ts @@ -196,7 +196,8 @@ export class FullTextSearchModel { 'UpdateFullTextSearchInput', 'id', 'fullTextSearchPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/function.ts b/sdk/constructive-cli/src/api/orm/models/function.ts index 1ca6207ace..fc8fba9b21 100644 --- a/sdk/constructive-cli/src/api/orm/models/function.ts +++ b/sdk/constructive-cli/src/api/orm/models/function.ts @@ -196,7 +196,8 @@ export class FunctionModel { 'UpdateFunctionInput', 'id', 'functionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/indexModel.ts b/sdk/constructive-cli/src/api/orm/models/indexModel.ts index 1c7eb1e964..919849c835 100644 --- a/sdk/constructive-cli/src/api/orm/models/indexModel.ts +++ b/sdk/constructive-cli/src/api/orm/models/indexModel.ts @@ -196,7 +196,8 @@ export class IndexModel { 'UpdateIndexInput', 'id', 'indexPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts b/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts index 83cb41250f..ab4670e925 100644 --- a/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts +++ b/sdk/constructive-cli/src/api/orm/models/nodeTypeRegistry.ts @@ -196,7 +196,8 @@ export class NodeTypeRegistryModel { 'UpdateNodeTypeRegistryInput', 'name', 'nodeTypeRegistryPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/partition.ts b/sdk/constructive-cli/src/api/orm/models/partition.ts index 86baeedbe9..1f848f6419 100644 --- a/sdk/constructive-cli/src/api/orm/models/partition.ts +++ b/sdk/constructive-cli/src/api/orm/models/partition.ts @@ -196,7 +196,8 @@ export class PartitionModel { 'UpdatePartitionInput', 'id', 'partitionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/policy.ts b/sdk/constructive-cli/src/api/orm/models/policy.ts index c60088703b..0b50aa86d3 100644 --- a/sdk/constructive-cli/src/api/orm/models/policy.ts +++ b/sdk/constructive-cli/src/api/orm/models/policy.ts @@ -196,7 +196,8 @@ export class PolicyModel { 'UpdatePolicyInput', 'id', 'policyPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts b/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts index e73aca57d2..65f2946d86 100644 --- a/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/primaryKeyConstraint.ts @@ -198,7 +198,8 @@ export class PrimaryKeyConstraintModel { 'UpdatePrimaryKeyConstraintInput', 'id', 'primaryKeyConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts b/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts index d950bb4fd5..e44627cac6 100644 --- a/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/pubkeySetting.ts @@ -196,7 +196,8 @@ export class PubkeySettingModel { 'UpdatePubkeySettingInput', 'id', 'pubkeySettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts b/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts index 50c715e02b..f371074a3a 100644 --- a/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/rlsSetting.ts @@ -196,7 +196,8 @@ export class RlsSettingModel { 'UpdateRlsSettingInput', 'id', 'rlsSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/schema.ts b/sdk/constructive-cli/src/api/orm/models/schema.ts index 3d0af98206..d9d34cae1a 100644 --- a/sdk/constructive-cli/src/api/orm/models/schema.ts +++ b/sdk/constructive-cli/src/api/orm/models/schema.ts @@ -196,7 +196,8 @@ export class SchemaModel { 'UpdateSchemaInput', 'id', 'schemaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts b/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts index dfe7569752..553345a2b3 100644 --- a/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts +++ b/sdk/constructive-cli/src/api/orm/models/schemaGrant.ts @@ -196,7 +196,8 @@ export class SchemaGrantModel { 'UpdateSchemaGrantInput', 'id', 'schemaGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/site.ts b/sdk/constructive-cli/src/api/orm/models/site.ts index 070a32b240..30c5c8f81a 100644 --- a/sdk/constructive-cli/src/api/orm/models/site.ts +++ b/sdk/constructive-cli/src/api/orm/models/site.ts @@ -196,7 +196,8 @@ export class SiteModel { 'UpdateSiteInput', 'id', 'sitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts b/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts index de85238e4f..1e8bc08f33 100644 --- a/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts +++ b/sdk/constructive-cli/src/api/orm/models/siteMetadatum.ts @@ -196,7 +196,8 @@ export class SiteMetadatumModel { 'UpdateSiteMetadatumInput', 'id', 'siteMetadatumPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/siteModule.ts b/sdk/constructive-cli/src/api/orm/models/siteModule.ts index b890423fee..fe7f43bf62 100644 --- a/sdk/constructive-cli/src/api/orm/models/siteModule.ts +++ b/sdk/constructive-cli/src/api/orm/models/siteModule.ts @@ -196,7 +196,8 @@ export class SiteModuleModel { 'UpdateSiteModuleInput', 'id', 'siteModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/siteTheme.ts b/sdk/constructive-cli/src/api/orm/models/siteTheme.ts index 57b9cadc54..51551f60db 100644 --- a/sdk/constructive-cli/src/api/orm/models/siteTheme.ts +++ b/sdk/constructive-cli/src/api/orm/models/siteTheme.ts @@ -196,7 +196,8 @@ export class SiteThemeModel { 'UpdateSiteThemeInput', 'id', 'siteThemePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts b/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts index fe266c9d35..31de43c115 100644 --- a/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts +++ b/sdk/constructive-cli/src/api/orm/models/spatialRelation.ts @@ -196,7 +196,8 @@ export class SpatialRelationModel { 'UpdateSpatialRelationInput', 'id', 'spatialRelationPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/table.ts b/sdk/constructive-cli/src/api/orm/models/table.ts index db1c5d3a97..1f8df77e80 100644 --- a/sdk/constructive-cli/src/api/orm/models/table.ts +++ b/sdk/constructive-cli/src/api/orm/models/table.ts @@ -196,7 +196,8 @@ export class TableModel { 'UpdateTableInput', 'id', 'tablePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/tableGrant.ts b/sdk/constructive-cli/src/api/orm/models/tableGrant.ts index e05b44f2b3..b49372245a 100644 --- a/sdk/constructive-cli/src/api/orm/models/tableGrant.ts +++ b/sdk/constructive-cli/src/api/orm/models/tableGrant.ts @@ -196,7 +196,8 @@ export class TableGrantModel { 'UpdateTableGrantInput', 'id', 'tableGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/trigger.ts b/sdk/constructive-cli/src/api/orm/models/trigger.ts index f4812bc6ea..47169bc484 100644 --- a/sdk/constructive-cli/src/api/orm/models/trigger.ts +++ b/sdk/constructive-cli/src/api/orm/models/trigger.ts @@ -196,7 +196,8 @@ export class TriggerModel { 'UpdateTriggerInput', 'id', 'triggerPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts b/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts index d2bd543aa4..40d2ee283e 100644 --- a/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts +++ b/sdk/constructive-cli/src/api/orm/models/triggerFunction.ts @@ -196,7 +196,8 @@ export class TriggerFunctionModel { 'UpdateTriggerFunctionInput', 'id', 'triggerFunctionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts b/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts index 3c1dad93d6..0880a23e50 100644 --- a/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts +++ b/sdk/constructive-cli/src/api/orm/models/uniqueConstraint.ts @@ -196,7 +196,8 @@ export class UniqueConstraintModel { 'UpdateUniqueConstraintInput', 'id', 'uniqueConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/view.ts b/sdk/constructive-cli/src/api/orm/models/view.ts index 75acdcbcf5..04afa60a84 100644 --- a/sdk/constructive-cli/src/api/orm/models/view.ts +++ b/sdk/constructive-cli/src/api/orm/models/view.ts @@ -196,7 +196,8 @@ export class ViewModel { 'UpdateViewInput', 'id', 'viewPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/viewGrant.ts b/sdk/constructive-cli/src/api/orm/models/viewGrant.ts index bd4eddaefe..7f9b69a42c 100644 --- a/sdk/constructive-cli/src/api/orm/models/viewGrant.ts +++ b/sdk/constructive-cli/src/api/orm/models/viewGrant.ts @@ -196,7 +196,8 @@ export class ViewGrantModel { 'UpdateViewGrantInput', 'id', 'viewGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/viewRule.ts b/sdk/constructive-cli/src/api/orm/models/viewRule.ts index cdec5ad128..df3eadd57c 100644 --- a/sdk/constructive-cli/src/api/orm/models/viewRule.ts +++ b/sdk/constructive-cli/src/api/orm/models/viewRule.ts @@ -196,7 +196,8 @@ export class ViewRuleModel { 'UpdateViewRuleInput', 'id', 'viewRulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/viewTable.ts b/sdk/constructive-cli/src/api/orm/models/viewTable.ts index 83362317e6..44308019a0 100644 --- a/sdk/constructive-cli/src/api/orm/models/viewTable.ts +++ b/sdk/constructive-cli/src/api/orm/models/viewTable.ts @@ -196,7 +196,8 @@ export class ViewTableModel { 'UpdateViewTableInput', 'id', 'viewTablePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts b/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts index e83c7e59f7..515c0dbcaa 100644 --- a/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts +++ b/sdk/constructive-cli/src/api/orm/models/webauthnSetting.ts @@ -196,7 +196,8 @@ export class WebauthnSettingModel { 'UpdateWebauthnSettingInput', 'id', 'webauthnSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/api/orm/query-builder.ts b/sdk/constructive-cli/src/api/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-cli/src/api/orm/query-builder.ts +++ b/sdk/constructive-cli/src/api/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts b/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts index cfe2d760ed..dc425a6a36 100644 --- a/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts +++ b/sdk/constructive-cli/src/auth/cli/commands/audit-log-auth.ts @@ -254,6 +254,12 @@ async function handleUpdate(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, { type: 'text', name: 'event', @@ -302,6 +308,7 @@ async function handleUpdate(argv: Partial>, prompter: In .update({ where: { id: answers.id as string, + createdAt: answers.createdAt as string, }, data: { event: cleanedData.event, @@ -341,6 +348,12 @@ async function handleDelete(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); @@ -348,6 +361,7 @@ async function handleDelete(argv: Partial>, prompter: In .delete({ where: { id: answers.id as string, + createdAt: answers.createdAt as string, }, select: { id: true, diff --git a/sdk/constructive-cli/src/auth/orm/input-types.ts b/sdk/constructive-cli/src/auth/orm/input-types.ts index 8e73cfffb4..734fe10c3a 100644 --- a/sdk/constructive-cli/src/auth/orm/input-types.ts +++ b/sdk/constructive-cli/src/auth/orm/input-types.ts @@ -808,7 +808,8 @@ export interface UserFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -2221,7 +2222,8 @@ export interface UserFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; diff --git a/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts b/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts index 8a6665612c..d0eee8faf1 100644 --- a/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts +++ b/sdk/constructive-cli/src/auth/orm/models/auditLogAuth.ts @@ -176,6 +176,7 @@ export class AuditLogAuthModel { S, { id: string; + createdAt: string; }, AuditLogAuthPatch > & { @@ -196,7 +197,10 @@ export class AuditLogAuthModel { 'UpdateAuditLogAuthInput', 'id', 'auditLogAuthPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class AuditLogAuthModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class AuditLogAuthModel { 'auditLogAuth', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteAuditLogAuthInput', args.select, diff --git a/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts b/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts index 11914bd9d1..5dc26c76df 100644 --- a/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts +++ b/sdk/constructive-cli/src/auth/orm/models/cryptoAddress.ts @@ -196,7 +196,8 @@ export class CryptoAddressModel { 'UpdateCryptoAddressInput', 'id', 'cryptoAddressPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/auth/orm/models/email.ts b/sdk/constructive-cli/src/auth/orm/models/email.ts index 325475b9ce..eb60ea671f 100644 --- a/sdk/constructive-cli/src/auth/orm/models/email.ts +++ b/sdk/constructive-cli/src/auth/orm/models/email.ts @@ -196,7 +196,8 @@ export class EmailModel { 'UpdateEmailInput', 'id', 'emailPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts b/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts index 0803908e25..f005f23c34 100644 --- a/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts +++ b/sdk/constructive-cli/src/auth/orm/models/phoneNumber.ts @@ -196,7 +196,8 @@ export class PhoneNumberModel { 'UpdatePhoneNumberInput', 'id', 'phoneNumberPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/auth/orm/models/roleType.ts b/sdk/constructive-cli/src/auth/orm/models/roleType.ts index 8b256a0dc7..e8df4924bd 100644 --- a/sdk/constructive-cli/src/auth/orm/models/roleType.ts +++ b/sdk/constructive-cli/src/auth/orm/models/roleType.ts @@ -196,7 +196,8 @@ export class RoleTypeModel { 'UpdateRoleTypeInput', 'id', 'roleTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/auth/orm/models/user.ts b/sdk/constructive-cli/src/auth/orm/models/user.ts index 8935818350..a35147a5ac 100644 --- a/sdk/constructive-cli/src/auth/orm/models/user.ts +++ b/sdk/constructive-cli/src/auth/orm/models/user.ts @@ -196,7 +196,8 @@ export class UserModel { 'UpdateUserInput', 'id', 'userPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts b/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts index cca4c75cf4..bc31ef6a16 100644 --- a/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts +++ b/sdk/constructive-cli/src/auth/orm/models/webauthnCredential.ts @@ -196,7 +196,8 @@ export class WebauthnCredentialModel { 'UpdateWebauthnCredentialInput', 'id', 'webauthnCredentialPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/auth/orm/query-builder.ts b/sdk/constructive-cli/src/auth/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-cli/src/auth/orm/query-builder.ts +++ b/sdk/constructive-cli/src/auth/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-cli/src/cli-commands.ts b/sdk/constructive-cli/src/cli-commands.ts index 07f23714da..0366629079 100644 --- a/sdk/constructive-cli/src/cli-commands.ts +++ b/sdk/constructive-cli/src/cli-commands.ts @@ -8,7 +8,7 @@ import type { CLIOptions, Inquirerer, ParsedArgs } from 'inquirerer'; import { extractFirst, getPackageJson } from 'inquirerer'; -import { getConfigStore } from './config'; +import { getConfigStore } from './config-store'; import { printSuccess, printError, printKeyValue, printTable } from './utils'; const TOOL_NAME = 'csdk'; diff --git a/sdk/constructive-cli/src/compute/README.md b/sdk/constructive-cli/src/compute/README.md new file mode 100644 index 0000000000..e63a848bf3 --- /dev/null +++ b/sdk/constructive-cli/src/compute/README.md @@ -0,0 +1,47 @@ +# Generated GraphQL SDK + +

+ +

+ + + +## Overview + +- **Tables:** 18 +- **Custom queries:** 1 +- **Custom mutations:** 14 + +**Generators:** ORM, CLI + +## Modules + +### ORM Client (`./orm`) + +Prisma-like ORM client for programmatic GraphQL access. + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', +}); +``` + +See [orm/README.md](./orm/README.md) for full API reference. + +### CLI Commands (`./cli`) + +inquirerer-based CLI commands for `csdk`. + +See [cli/README.md](./cli/README.md) for command reference. + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-cli/src/compute/cli/README.md b/sdk/constructive-cli/src/compute/cli/README.md new file mode 100644 index 0000000000..a9e5c5300f --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/README.md @@ -0,0 +1,945 @@ +# csdk CLI + +

+ +

+ + + +## Setup + +```bash +# Create a context pointing at your GraphQL endpoint +csdk context create production --endpoint https://api.example.com/graphql + +# Set the active context +csdk context use production + +# Authenticate +csdk auth set-token +``` + +## Commands + +| Command | Description | +|---------|-------------| +| `context` | Manage API contexts (endpoints) | +| `auth` | Manage authentication tokens | +| `config` | Manage config key-value store (per-context) | +| `get-all-record` | getAllRecord CRUD operations | +| `function-api-binding` | functionApiBinding CRUD operations | +| `function-deployment` | functionDeployment CRUD operations | +| `function-graph-ref` | functionGraphRef CRUD operations | +| `function-graph-store` | functionGraphStore CRUD operations | +| `function-graph-object` | functionGraphObject CRUD operations | +| `function-deployment-event` | functionDeploymentEvent CRUD operations | +| `org-function-execution-log` | orgFunctionExecutionLog CRUD operations | +| `function-graph-execution-output` | functionGraphExecutionOutput CRUD operations | +| `function-graph-commit` | functionGraphCommit CRUD operations | +| `secret-definition` | secretDefinition CRUD operations | +| `function-execution-log` | functionExecutionLog CRUD operations | +| `function-graph-execution-node-state` | functionGraphExecutionNodeState CRUD operations | +| `function-graph` | functionGraph CRUD operations | +| `org-function-invocation` | orgFunctionInvocation CRUD operations | +| `function-invocation` | functionInvocation CRUD operations | +| `function-graph-execution` | functionGraphExecution CRUD operations | +| `function-definition` | functionDefinition CRUD operations | +| `read-function-graph` | readFunctionGraph | +| `validate-function-graph` | validateFunctionGraph | +| `init-empty-repo` | initEmptyRepo | +| `set-data-at-path` | setDataAtPath | +| `import-definitions` | importDefinitions | +| `copy-graph` | copyGraph | +| `save-graph` | saveGraph | +| `add-edge-and-save` | addEdgeAndSave | +| `add-node-and-save` | addNodeAndSave | +| `add-edge` | addEdge | +| `add-node` | addNode | +| `import-graph-json` | importGraphJson | +| `insert-node-at-path` | insertNodeAtPath | +| `start-execution` | startExecution | +| `provision-bucket` | Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. | + +## Infrastructure Commands + +### `context` + +Manage named API contexts (kubectl-style). + +| Subcommand | Description | +|------------|-------------| +| `create --endpoint ` | Create a new context | +| `list` | List all contexts | +| `use ` | Set the active context | +| `current` | Show current context | +| `delete ` | Delete a context | + +Configuration is stored at `~/.csdk/config/`. + +### `auth` + +Manage authentication tokens per context. + +| Subcommand | Description | +|------------|-------------| +| `set-token ` | Store bearer token for current context | +| `status` | Show auth status across all contexts | +| `logout` | Remove credentials for current context | + +### `config` + +Manage per-context key-value configuration variables. + +| Subcommand | Description | +|------------|-------------| +| `get ` | Get a config value | +| `set ` | Set a config value | +| `list` | List all config values | +| `delete ` | Delete a config value | + +Variables are scoped to the active context and stored at `~/.csdk/config/`. + +## Table Commands + +### `get-all-record` + +CRUD operations for GetAllRecord records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all getAllRecord records | +| `find-first` | Find first matching getAllRecord record | +| `get` | Get a getAllRecord by id | +| `create` | Create a new getAllRecord | +| `update` | Update an existing getAllRecord | +| `delete` | Delete a getAllRecord | + +**Fields:** + +| Field | Type | +|-------|------| +| `path` | String | +| `data` | JSON | + +**Required create fields:** `path`, `data` + +### `function-api-binding` + +CRUD operations for FunctionApiBinding records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionApiBinding records | +| `find-first` | Find first matching functionApiBinding record | +| `get` | Get a functionApiBinding by id | +| `create` | Create a new functionApiBinding | +| `update` | Update an existing functionApiBinding | +| `delete` | Delete a functionApiBinding | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `functionDefinitionId` | UUID | +| `apiId` | UUID | +| `alias` | String | +| `config` | JSON | + +**Required create fields:** `functionDefinitionId`, `apiId` +**Optional create fields (backend defaults):** `alias`, `config` + +### `function-deployment` + +CRUD operations for FunctionDeployment records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionDeployment records | +| `find-first` | Find first matching functionDeployment record | +| `get` | Get a functionDeployment by id | +| `create` | Create a new functionDeployment | +| `update` | Update an existing functionDeployment | +| `delete` | Delete a functionDeployment | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `functionDefinitionId` | UUID | +| `namespaceId` | UUID | +| `status` | String | +| `serviceUrl` | String | +| `serviceName` | String | +| `revision` | Int | +| `image` | String | +| `concurrency` | Int | +| `scaleMin` | Int | +| `scaleMax` | Int | +| `timeoutSeconds` | Int | +| `resources` | JSON | +| `lastError` | String | +| `lastErrorAt` | Datetime | +| `errorCount` | Int | +| `labels` | JSON | +| `annotations` | JSON | +| `databaseId` | UUID | + +**Required create fields:** `functionDefinitionId`, `namespaceId`, `databaseId` +**Optional create fields (backend defaults):** `status`, `serviceUrl`, `serviceName`, `revision`, `image`, `concurrency`, `scaleMin`, `scaleMax`, `timeoutSeconds`, `resources`, `lastError`, `lastErrorAt`, `errorCount`, `labels`, `annotations` + +### `function-graph-ref` + +CRUD operations for FunctionGraphRef records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraphRef records | +| `find-first` | Find first matching functionGraphRef record | +| `get` | Get a functionGraphRef by id | +| `create` | Create a new functionGraphRef | +| `update` | Update an existing functionGraphRef | +| `delete` | Delete a functionGraphRef | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `name` | String | +| `databaseId` | UUID | +| `storeId` | UUID | +| `commitId` | UUID | + +**Required create fields:** `name`, `databaseId`, `storeId` +**Optional create fields (backend defaults):** `commitId` + +### `function-graph-store` + +CRUD operations for FunctionGraphStore records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraphStore records | +| `find-first` | Find first matching functionGraphStore record | +| `get` | Get a functionGraphStore by id | +| `create` | Create a new functionGraphStore | +| `update` | Update an existing functionGraphStore | +| `delete` | Delete a functionGraphStore | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `name` | String | +| `databaseId` | UUID | +| `hash` | UUID | +| `createdAt` | Datetime | + +**Required create fields:** `name`, `databaseId` +**Optional create fields (backend defaults):** `hash` + +### `function-graph-object` + +CRUD operations for FunctionGraphObject records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraphObject records | +| `find-first` | Find first matching functionGraphObject record | +| `get` | Get a functionGraphObject by id | +| `create` | Create a new functionGraphObject | +| `update` | Update an existing functionGraphObject | +| `delete` | Delete a functionGraphObject | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseId` | UUID | +| `kids` | UUID | +| `ktree` | String | +| `data` | JSON | +| `createdAt` | Datetime | + +**Required create fields:** `databaseId` +**Optional create fields (backend defaults):** `kids`, `ktree`, `data` + +### `function-deployment-event` + +CRUD operations for FunctionDeploymentEvent records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionDeploymentEvent records | +| `find-first` | Find first matching functionDeploymentEvent record | +| `get` | Get a functionDeploymentEvent by id | +| `create` | Create a new functionDeploymentEvent | +| `update` | Update an existing functionDeploymentEvent | +| `delete` | Delete a functionDeploymentEvent | + +**Fields:** + +| Field | Type | +|-------|------| +| `createdAt` | Datetime | +| `id` | UUID | +| `deploymentId` | UUID | +| `eventType` | String | +| `actorId` | UUID | +| `message` | String | +| `metadata` | JSON | +| `databaseId` | UUID | + +**Required create fields:** `deploymentId`, `eventType`, `databaseId` +**Optional create fields (backend defaults):** `actorId`, `message`, `metadata` + +### `org-function-execution-log` + +CRUD operations for OrgFunctionExecutionLog records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all orgFunctionExecutionLog records | +| `find-first` | Find first matching orgFunctionExecutionLog record | +| `get` | Get a orgFunctionExecutionLog by id | +| `create` | Create a new orgFunctionExecutionLog | +| `update` | Update an existing orgFunctionExecutionLog | +| `delete` | Delete a orgFunctionExecutionLog | + +**Fields:** + +| Field | Type | +|-------|------| +| `createdAt` | Datetime | +| `id` | UUID | +| `invocationId` | UUID | +| `taskIdentifier` | String | +| `logLevel` | String | +| `message` | String | +| `metadata` | JSON | +| `actorId` | UUID | + +**Required create fields:** `message` +**Optional create fields (backend defaults):** `invocationId`, `taskIdentifier`, `logLevel`, `metadata`, `actorId` + +### `function-graph-execution-output` + +CRUD operations for FunctionGraphExecutionOutput records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraphExecutionOutput records | +| `find-first` | Find first matching functionGraphExecutionOutput record | +| `get` | Get a functionGraphExecutionOutput by id | +| `create` | Create a new functionGraphExecutionOutput | +| `update` | Update an existing functionGraphExecutionOutput | +| `delete` | Delete a functionGraphExecutionOutput | + +**Fields:** + +| Field | Type | +|-------|------| +| `createdAt` | Datetime | +| `id` | UUID | +| `databaseId` | UUID | +| `hash` | Base64EncodedBinary | +| `data` | JSON | + +**Required create fields:** `databaseId`, `hash`, `data` + +### `function-graph-commit` + +CRUD operations for FunctionGraphCommit records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraphCommit records | +| `find-first` | Find first matching functionGraphCommit record | +| `get` | Get a functionGraphCommit by id | +| `create` | Create a new functionGraphCommit | +| `update` | Update an existing functionGraphCommit | +| `delete` | Delete a functionGraphCommit | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `message` | String | +| `databaseId` | UUID | +| `storeId` | UUID | +| `parentIds` | UUID | +| `authorId` | UUID | +| `committerId` | UUID | +| `treeId` | UUID | +| `date` | Datetime | + +**Required create fields:** `databaseId`, `storeId` +**Optional create fields (backend defaults):** `message`, `parentIds`, `authorId`, `committerId`, `treeId`, `date` + +### `secret-definition` + +CRUD operations for SecretDefinition records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all secretDefinition records | +| `find-first` | Find first matching secretDefinition record | +| `get` | Get a secretDefinition by id | +| `create` | Create a new secretDefinition | +| `update` | Update an existing secretDefinition | +| `delete` | Delete a secretDefinition | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `name` | String | +| `description` | String | +| `isBuiltIn` | Boolean | +| `labels` | JSON | +| `annotations` | JSON | +| `databaseId` | UUID | + +**Required create fields:** `name`, `databaseId` +**Optional create fields (backend defaults):** `description`, `isBuiltIn`, `labels`, `annotations` + +### `function-execution-log` + +CRUD operations for FunctionExecutionLog records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionExecutionLog records | +| `find-first` | Find first matching functionExecutionLog record | +| `get` | Get a functionExecutionLog by id | +| `create` | Create a new functionExecutionLog | +| `update` | Update an existing functionExecutionLog | +| `delete` | Delete a functionExecutionLog | + +**Fields:** + +| Field | Type | +|-------|------| +| `createdAt` | Datetime | +| `id` | UUID | +| `invocationId` | UUID | +| `taskIdentifier` | String | +| `logLevel` | String | +| `message` | String | +| `metadata` | JSON | +| `actorId` | UUID | +| `databaseId` | UUID | + +**Required create fields:** `message`, `databaseId` +**Optional create fields (backend defaults):** `invocationId`, `taskIdentifier`, `logLevel`, `metadata`, `actorId` + +### `function-graph-execution-node-state` + +CRUD operations for FunctionGraphExecutionNodeState records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraphExecutionNodeState records | +| `find-first` | Find first matching functionGraphExecutionNodeState record | +| `get` | Get a functionGraphExecutionNodeState by id | +| `create` | Create a new functionGraphExecutionNodeState | +| `update` | Update an existing functionGraphExecutionNodeState | +| `delete` | Delete a functionGraphExecutionNodeState | + +**Fields:** + +| Field | Type | +|-------|------| +| `createdAt` | Datetime | +| `id` | UUID | +| `executionId` | UUID | +| `databaseId` | UUID | +| `nodeName` | String | +| `nodePath` | String | +| `status` | String | +| `startedAt` | Datetime | +| `completedAt` | Datetime | +| `errorCode` | String | +| `errorMessage` | String | +| `outputId` | UUID | + +**Required create fields:** `executionId`, `databaseId`, `nodeName` +**Optional create fields (backend defaults):** `nodePath`, `status`, `startedAt`, `completedAt`, `errorCode`, `errorMessage`, `outputId` + +### `function-graph` + +CRUD operations for FunctionGraph records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraph records | +| `find-first` | Find first matching functionGraph record | +| `get` | Get a functionGraph by id | +| `create` | Create a new functionGraph | +| `update` | Update an existing functionGraph | +| `delete` | Delete a functionGraph | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseId` | UUID | +| `storeId` | UUID | +| `entityId` | UUID | +| `context` | String | +| `name` | String | +| `description` | String | +| `definitionsCommitId` | UUID | +| `isValid` | Boolean | +| `validationErrors` | JSON | +| `createdBy` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | + +**Required create fields:** `databaseId`, `storeId`, `entityId`, `context`, `name`, `description`, `definitionsCommitId`, `isValid`, `validationErrors`, `createdBy` + +### `org-function-invocation` + +CRUD operations for OrgFunctionInvocation records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all orgFunctionInvocation records | +| `find-first` | Find first matching orgFunctionInvocation record | +| `get` | Get a orgFunctionInvocation by id | +| `create` | Create a new orgFunctionInvocation | +| `update` | Update an existing orgFunctionInvocation | +| `delete` | Delete a orgFunctionInvocation | + +**Fields:** + +| Field | Type | +|-------|------| +| `createdAt` | Datetime | +| `id` | UUID | +| `actorId` | UUID | +| `taskIdentifier` | String | +| `payload` | JSON | +| `status` | String | +| `result` | JSON | +| `error` | String | +| `durationMs` | Int | +| `jobId` | BigInt | +| `startedAt` | Datetime | +| `completedAt` | Datetime | +| `parentInvocationId` | UUID | +| `graphExecutionId` | UUID | + +**Required create fields:** `taskIdentifier` +**Optional create fields (backend defaults):** `actorId`, `payload`, `status`, `result`, `error`, `durationMs`, `jobId`, `startedAt`, `completedAt`, `parentInvocationId`, `graphExecutionId` + +### `function-invocation` + +CRUD operations for FunctionInvocation records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionInvocation records | +| `find-first` | Find first matching functionInvocation record | +| `get` | Get a functionInvocation by id | +| `create` | Create a new functionInvocation | +| `update` | Update an existing functionInvocation | +| `delete` | Delete a functionInvocation | + +**Fields:** + +| Field | Type | +|-------|------| +| `createdAt` | Datetime | +| `id` | UUID | +| `actorId` | UUID | +| `databaseId` | UUID | +| `taskIdentifier` | String | +| `payload` | JSON | +| `status` | String | +| `result` | JSON | +| `error` | String | +| `durationMs` | Int | +| `jobId` | BigInt | +| `startedAt` | Datetime | +| `completedAt` | Datetime | +| `parentInvocationId` | UUID | +| `graphExecutionId` | UUID | + +**Required create fields:** `databaseId`, `taskIdentifier` +**Optional create fields (backend defaults):** `actorId`, `payload`, `status`, `result`, `error`, `durationMs`, `jobId`, `startedAt`, `completedAt`, `parentInvocationId`, `graphExecutionId` + +### `function-graph-execution` + +CRUD operations for FunctionGraphExecution records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionGraphExecution records | +| `find-first` | Find first matching functionGraphExecution record | +| `get` | Get a functionGraphExecution by id | +| `create` | Create a new functionGraphExecution | +| `update` | Update an existing functionGraphExecution | +| `delete` | Delete a functionGraphExecution | + +**Fields:** + +| Field | Type | +|-------|------| +| `startedAt` | Datetime | +| `id` | UUID | +| `graphId` | UUID | +| `invocationId` | UUID | +| `databaseId` | UUID | +| `entityId` | UUID | +| `outputNode` | String | +| `outputPort` | String | +| `status` | String | +| `inputPayload` | JSON | +| `outputPayload` | JSON | +| `nodeOutputs` | JSON | +| `executionPlan` | JSON | +| `currentWave` | Int | +| `parentExecutionId` | UUID | +| `parentNodeName` | String | +| `definitionsCommitId` | UUID | +| `tickCount` | Int | +| `completedAt` | Datetime | +| `maxTicks` | Int | +| `maxPendingJobs` | Int | +| `timeoutAt` | Datetime | +| `errorCode` | String | +| `errorMessage` | String | + +**Required create fields:** `graphId`, `databaseId`, `outputNode` +**Optional create fields (backend defaults):** `startedAt`, `invocationId`, `entityId`, `outputPort`, `status`, `inputPayload`, `outputPayload`, `nodeOutputs`, `executionPlan`, `currentWave`, `parentExecutionId`, `parentNodeName`, `definitionsCommitId`, `tickCount`, `completedAt`, `maxTicks`, `maxPendingJobs`, `timeoutAt`, `errorCode`, `errorMessage` + +### `function-definition` + +CRUD operations for FunctionDefinition records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionDefinition records | +| `find-first` | Find first matching functionDefinition record | +| `get` | Get a functionDefinition by id | +| `create` | Create a new functionDefinition | +| `update` | Update an existing functionDefinition | +| `delete` | Delete a functionDefinition | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `scope` | String | +| `name` | String | +| `taskIdentifier` | String | +| `description` | String | +| `isInvocable` | Boolean | +| `maxAttempts` | Int | +| `priority` | Int | +| `queueName` | String | +| `runtime` | String | +| `image` | String | +| `concurrency` | Int | +| `scaleMin` | Int | +| `scaleMax` | Int | +| `timeoutSeconds` | Int | +| `resources` | JSON | +| `isBuiltIn` | Boolean | +| `requiredSecrets` | FunctionRequirement | +| `requiredConfigs` | FunctionRequirement | +| `requiredBuckets` | String | +| `requiredModels` | String | +| `inputs` | JSON | +| `outputs` | JSON | +| `props` | JSON | +| `volatile` | Boolean | +| `icon` | String | +| `category` | String | + +**Required create fields:** `scope`, `name`, `taskIdentifier` +**Optional create fields (backend defaults):** `description`, `isInvocable`, `maxAttempts`, `priority`, `queueName`, `runtime`, `image`, `concurrency`, `scaleMin`, `scaleMax`, `timeoutSeconds`, `resources`, `isBuiltIn`, `requiredSecrets`, `requiredConfigs`, `requiredBuckets`, `requiredModels`, `inputs`, `outputs`, `props`, `volatile`, `icon`, `category` + +## Custom Operations + +### `read-function-graph` + +readFunctionGraph + +- **Type:** query +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--graphId` | UUID | + +### `validate-function-graph` + +validateFunctionGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.graphId` | UUID | + +### `init-empty-repo` + +initEmptyRepo + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.sId` | UUID | + | `--input.storeId` | UUID | + +### `set-data-at-path` + +setDataAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.sId` | UUID | + | `--input.root` | UUID | + | `--input.path` | String | + | `--input.data` | JSON | + +### `import-definitions` + +importDefinitions + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.graphId` | UUID | + | `--input.sourceScopeId` | UUID | + | `--input.sourceCommitId` | UUID | + | `--input.contexts` | String | + +### `copy-graph` + +copyGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.databaseId` | UUID | + | `--input.graphId` | UUID | + | `--input.name` | String | + +### `save-graph` + +saveGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.graphId` | UUID | + | `--input.rootHash` | UUID | + | `--input.message` | String | + +### `add-edge-and-save` + +addEdgeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.graphId` | UUID | + | `--input.srcNode` | String | + | `--input.srcPort` | String | + | `--input.dstNode` | String | + | `--input.dstPort` | String | + | `--input.message` | String | + +### `add-node-and-save` + +addNodeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.graphId` | UUID | + | `--input.nodeName` | String | + | `--input.nodeType` | String | + | `--input.props` | JSON | + | `--input.meta` | JSON | + | `--input.message` | String | + +### `add-edge` + +addEdge + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.databaseId` | UUID | + | `--input.rootHash` | UUID | + | `--input.srcNode` | String | + | `--input.srcPort` | String | + | `--input.dstNode` | String | + | `--input.dstPort` | String | + | `--input.context` | String | + | `--input.graphName` | String | + +### `add-node` + +addNode + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.databaseId` | UUID | + | `--input.rootHash` | UUID | + | `--input.nodeName` | String | + | `--input.nodeType` | String | + | `--input.context` | String | + | `--input.graphName` | String | + | `--input.props` | JSON | + | `--input.meta` | JSON | + +### `import-graph-json` + +importGraphJson + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.databaseId` | UUID | + | `--input.name` | String | + | `--input.graphJson` | JSON | + | `--input.context` | String | + | `--input.description` | String | + | `--input.entityId` | UUID | + | `--input.createdBy` | UUID | + | `--input.definitionsCommitId` | UUID | + +### `insert-node-at-path` + +insertNodeAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.sId` | UUID | + | `--input.root` | UUID | + | `--input.path` | String | + | `--input.data` | JSON | + | `--input.kids` | UUID | + | `--input.ktree` | String | + +### `start-execution` + +startExecution + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.graphId` | UUID | + | `--input.inputPayload` | JSON | + | `--input.outputNode` | String | + | `--input.outputPort` | String | + | `--input.maxTicks` | Int | + | `--input.maxPendingJobs` | Int | + | `--input.timeoutInterval` | IntervalInput | + | `--input.parentExecutionId` | UUID | + | `--input.parentNodeName` | String | + +### `provision-bucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.bucketKey` | String (required) | + | `--input.ownerId` | UUID | + +## Output + +All commands output JSON to stdout. Pipe to `jq` for formatting: + +```bash +csdk car list | jq '.[]' +csdk car get --id | jq '.' +``` + +## Non-Interactive Mode + +Use `--no-tty` to skip all interactive prompts (useful for scripts and CI): + +```bash +csdk --no-tty car create --name "Sedan" --year 2024 +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-cli/src/compute/cli/commands.ts b/sdk/constructive-cli/src/compute/cli/commands.ts new file mode 100644 index 0000000000..437ce960ed --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands.ts @@ -0,0 +1,119 @@ +/** + * CLI command map and entry point + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import getAllRecordCmd from './commands/get-all-record'; +import functionApiBindingCmd from './commands/function-api-binding'; +import functionDeploymentCmd from './commands/function-deployment'; +import functionGraphRefCmd from './commands/function-graph-ref'; +import functionGraphStoreCmd from './commands/function-graph-store'; +import functionGraphObjectCmd from './commands/function-graph-object'; +import functionDeploymentEventCmd from './commands/function-deployment-event'; +import orgFunctionExecutionLogCmd from './commands/org-function-execution-log'; +import functionGraphExecutionOutputCmd from './commands/function-graph-execution-output'; +import functionGraphCommitCmd from './commands/function-graph-commit'; +import secretDefinitionCmd from './commands/secret-definition'; +import functionExecutionLogCmd from './commands/function-execution-log'; +import functionGraphExecutionNodeStateCmd from './commands/function-graph-execution-node-state'; +import functionGraphCmd from './commands/function-graph'; +import orgFunctionInvocationCmd from './commands/org-function-invocation'; +import functionInvocationCmd from './commands/function-invocation'; +import functionGraphExecutionCmd from './commands/function-graph-execution'; +import functionDefinitionCmd from './commands/function-definition'; +import readFunctionGraphCmd from './commands/read-function-graph'; +import validateFunctionGraphCmd from './commands/validate-function-graph'; +import initEmptyRepoCmd from './commands/init-empty-repo'; +import setDataAtPathCmd from './commands/set-data-at-path'; +import importDefinitionsCmd from './commands/import-definitions'; +import copyGraphCmd from './commands/copy-graph'; +import saveGraphCmd from './commands/save-graph'; +import addEdgeAndSaveCmd from './commands/add-edge-and-save'; +import addNodeAndSaveCmd from './commands/add-node-and-save'; +import addEdgeCmd from './commands/add-edge'; +import addNodeCmd from './commands/add-node'; +import importGraphJsonCmd from './commands/import-graph-json'; +import insertNodeAtPathCmd from './commands/insert-node-at-path'; +import startExecutionCmd from './commands/start-execution'; +import provisionBucketCmd from './commands/provision-bucket'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'get-all-record': getAllRecordCmd, + 'function-api-binding': functionApiBindingCmd, + 'function-deployment': functionDeploymentCmd, + 'function-graph-ref': functionGraphRefCmd, + 'function-graph-store': functionGraphStoreCmd, + 'function-graph-object': functionGraphObjectCmd, + 'function-deployment-event': functionDeploymentEventCmd, + 'org-function-execution-log': orgFunctionExecutionLogCmd, + 'function-graph-execution-output': functionGraphExecutionOutputCmd, + 'function-graph-commit': functionGraphCommitCmd, + 'secret-definition': secretDefinitionCmd, + 'function-execution-log': functionExecutionLogCmd, + 'function-graph-execution-node-state': functionGraphExecutionNodeStateCmd, + 'function-graph': functionGraphCmd, + 'org-function-invocation': orgFunctionInvocationCmd, + 'function-invocation': functionInvocationCmd, + 'function-graph-execution': functionGraphExecutionCmd, + 'function-definition': functionDefinitionCmd, + 'read-function-graph': readFunctionGraphCmd, + 'validate-function-graph': validateFunctionGraphCmd, + 'init-empty-repo': initEmptyRepoCmd, + 'set-data-at-path': setDataAtPathCmd, + 'import-definitions': importDefinitionsCmd, + 'copy-graph': copyGraphCmd, + 'save-graph': saveGraphCmd, + 'add-edge-and-save': addEdgeAndSaveCmd, + 'add-node-and-save': addNodeAndSaveCmd, + 'add-edge': addEdgeCmd, + 'add-node': addNodeCmd, + 'import-graph-json': importGraphJsonCmd, + 'insert-node-at-path': insertNodeAtPathCmd, + 'start-execution': startExecutionCmd, + 'provision-bucket': provisionBucketCmd, +}); +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n get-all-record getAllRecord CRUD operations\n function-api-binding functionApiBinding CRUD operations\n function-deployment functionDeployment CRUD operations\n function-graph-ref functionGraphRef CRUD operations\n function-graph-store functionGraphStore CRUD operations\n function-graph-object functionGraphObject CRUD operations\n function-deployment-event functionDeploymentEvent CRUD operations\n org-function-execution-log orgFunctionExecutionLog CRUD operations\n function-graph-execution-output functionGraphExecutionOutput CRUD operations\n function-graph-commit functionGraphCommit CRUD operations\n secret-definition secretDefinition CRUD operations\n function-execution-log functionExecutionLog CRUD operations\n function-graph-execution-node-state functionGraphExecutionNodeState CRUD operations\n function-graph functionGraph CRUD operations\n org-function-invocation orgFunctionInvocation CRUD operations\n function-invocation functionInvocation CRUD operations\n function-graph-execution functionGraphExecution CRUD operations\n function-definition functionDefinition CRUD operations\n read-function-graph readFunctionGraph\n validate-function-graph validateFunctionGraph\n init-empty-repo initEmptyRepo\n set-data-at-path setDataAtPath\n import-definitions importDefinitions\n copy-graph copyGraph\n save-graph saveGraph\n add-edge-and-save addEdgeAndSave\n add-node-and-save addNodeAndSave\n add-edge addEdge\n add-node addNode\n import-graph-json importGraphJson\n insert-node-at-path insertNodeAtPath\n start-execution startExecution\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + let { first: command, newArgv } = extractFirst(argv); + const commandMap = createCommandMap(); + if (!command) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); + command = answer.command as string; + } + const commandFn = commandMap[command]; + if (!commandFn) { + console.log(usage); + console.error(`Unknown command: ${command}`); + process.exit(1); + } + await commandFn(newArgv, prompter, options); + prompter.close(); + return argv; +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-edge-and-save.ts b/sdk/constructive-cli/src/compute/cli/commands/add-edge-and-save.ts new file mode 100644 index 0000000000..7d259d67d8 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/add-edge-and-save.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation addEdgeAndSave + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddEdgeAndSaveVariables } from '../../orm/mutation'; +import type { AddEdgeAndSavePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('add-edge-and-save - addEdgeAndSave\n\nUsage: add-edge-and-save [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addEdgeAndSave( + parsedAnswers as unknown as AddEdgeAndSaveVariables, + { + select: selectFields, + } as unknown as { + select: AddEdgeAndSavePayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: addEdgeAndSave'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-edge.ts b/sdk/constructive-cli/src/compute/cli/commands/add-edge.ts new file mode 100644 index 0000000000..63ff143b52 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/add-edge.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation addEdge + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddEdgeVariables } from '../../orm/mutation'; +import type { AddEdgePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('add-edge - addEdge\n\nUsage: add-edge [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addEdge( + parsedAnswers as unknown as AddEdgeVariables, + { + select: selectFields, + } as unknown as { + select: AddEdgePayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: addEdge'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-node-and-save.ts b/sdk/constructive-cli/src/compute/cli/commands/add-node-and-save.ts new file mode 100644 index 0000000000..1e20debed8 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/add-node-and-save.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation addNodeAndSave + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddNodeAndSaveVariables } from '../../orm/mutation'; +import type { AddNodeAndSavePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('add-node-and-save - addNodeAndSave\n\nUsage: add-node-and-save [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addNodeAndSave( + parsedAnswers as unknown as AddNodeAndSaveVariables, + { + select: selectFields, + } as unknown as { + select: AddNodeAndSavePayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: addNodeAndSave'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/add-node.ts b/sdk/constructive-cli/src/compute/cli/commands/add-node.ts new file mode 100644 index 0000000000..53d031681e --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/add-node.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation addNode + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { AddNodeVariables } from '../../orm/mutation'; +import type { AddNodePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('add-node - addNode\n\nUsage: add-node [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .addNode( + parsedAnswers as unknown as AddNodeVariables, + { + select: selectFields, + } as unknown as { + select: AddNodePayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: addNode'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/auth.ts b/sdk/constructive-cli/src/compute/cli/commands/auth.ts new file mode 100644 index 0000000000..c731ba27ca --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/auth.ts @@ -0,0 +1,122 @@ +/** + * Authentication commands + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const store = getStore(); + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); + return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); + } + return handleAuthSubcommand(subcommand, newArgv, prompter, store); +}; +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + switch (subcommand) { + case 'set-token': + return handleSetToken(argv, prompter, store); + case 'status': + return handleStatus(store); + case 'logout': + return handleLogout(argv, prompter, store); + default: + console.log(usage); + process.exit(1); + } +} +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const current = store.getCurrentContext(); + if (!current) { + console.error('No active context. Run "context create" first.'); + process.exit(1); + } + const { first: token } = extractFirst(argv); + let tokenValue = token; + if (!tokenValue) { + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); + tokenValue = answer.token as string; + } + store.setCredentials(current.name, { + token: String(tokenValue || '').trim(), + }); + console.log(`Token saved for context: ${current.name}`); +} +function handleStatus(store: ReturnType) { + const contexts = store.listContexts(); + const settings = store.loadSettings(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + console.log('Authentication Status:'); + for (const ctx of contexts) { + const isCurrent = ctx.name === settings.currentContext; + const hasAuth = store.hasValidCredentials(ctx.name); + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; + console.log(`${marker}${ctx.name} [${status}]`); + } +} +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const current = store.getCurrentContext(); + if (!current) { + console.log('No active context.'); + return; + } + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); + if (!(confirm.confirm as boolean)) { + return; + } + if (store.removeCredentials(current.name)) { + console.log(`Credentials removed for: ${current.name}`); + } else { + console.log(`No credentials found for: ${current.name}`); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/context.ts b/sdk/constructive-cli/src/compute/cli/commands/context.ts new file mode 100644 index 0000000000..52d12c666b --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/context.ts @@ -0,0 +1,179 @@ +/** + * Context management commands + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const store = getStore(); + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); + return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); + } + return handleSubcommand(subcommand, newArgv, prompter, store); +}; +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + switch (subcommand) { + case 'create': + return handleCreate(argv, prompter, store); + case 'list': + return handleList(store); + case 'use': + return handleUse(argv, prompter, store); + case 'current': + return handleCurrent(store); + case 'delete': + return handleDelete(argv, prompter, store); + default: + console.log(usage); + process.exit(1); + } +} +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; + const contextName = answers.name; + const endpoint = answers.endpoint; + store.createContext(contextName, { + endpoint: endpoint, + }); + const settings = store.loadSettings(); + if (!settings.currentContext) { + store.setCurrentContext(contextName); + } + console.log(`Created context: ${contextName}`); + console.log(` Endpoint: ${endpoint}`); +} +function handleList(store: ReturnType) { + const contexts = store.listContexts(); + const settings = store.loadSettings(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + console.log('Contexts:'); + for (const ctx of contexts) { + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; + console.log(`${marker}${ctx.name} ${authStatus}`); + console.log(` Endpoint: ${ctx.endpoint}`); + } +} +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); + const contexts = store.listContexts(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + let contextName = name; + if (!contextName) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); + contextName = answer.name as string; + } + if (store.setCurrentContext(contextName)) { + console.log(`Switched to context: ${contextName}`); + } else { + console.error(`Context "${contextName}" not found.`); + process.exit(1); + } +} +function handleCurrent(store: ReturnType) { + const current = store.getCurrentContext(); + if (!current) { + console.log('No current context set.'); + return; + } + console.log(`Current context: ${current.name}`); + console.log(` Endpoint: ${current.endpoint}`); + const hasAuth = store.hasValidCredentials(current.name); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); +} +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); + const contexts = store.listContexts(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + let contextName = name; + if (!contextName) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); + contextName = answer.name as string; + } + if (store.deleteContext(contextName)) { + console.log(`Deleted context: ${contextName}`); + } else { + console.error(`Context "${contextName}" not found.`); + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/copy-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/copy-graph.ts new file mode 100644 index 0000000000..bad694bbb3 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/copy-graph.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation copyGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { CopyGraphVariables } from '../../orm/mutation'; +import type { CopyGraphPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('copy-graph - copyGraph\n\nUsage: copy-graph [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .copyGraph( + parsedAnswers as unknown as CopyGraphVariables, + { + select: selectFields, + } as unknown as { + select: CopyGraphPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: copyGraph'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-api-binding.ts b/sdk/constructive-cli/src/compute/cli/commands/function-api-binding.ts new file mode 100644 index 0000000000..273789e9a3 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-api-binding.ts @@ -0,0 +1,323 @@ +/** + * CLI commands for FunctionApiBinding + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionApiBindingInput, + FunctionApiBindingPatch, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + functionDefinitionId: 'uuid', + apiId: 'uuid', + alias: 'string', + config: 'json', +}; +const usage = + '\nfunction-api-binding \n\nCommands:\n list List functionApiBinding records\n find-first Find first matching functionApiBinding record\n get Get a functionApiBinding by ID\n create Create a new functionApiBinding\n update Update an existing functionApiBinding\n delete Delete a functionApiBinding\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + functionDefinitionId: true, + apiId: true, + alias: true, + config: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + > & { + select: FunctionApiBindingSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionApiBinding.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + functionDefinitionId: true, + apiId: true, + alias: true, + config: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + > & { + select: FunctionApiBindingSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionApiBinding.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionApiBinding + .findOne({ + id: answers.id as string, + select: { + id: true, + functionDefinitionId: true, + apiId: true, + alias: true, + config: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: true, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: true, + }, + { + type: 'text', + name: 'alias', + message: 'alias', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionApiBindingInput['functionApiBinding']; + const client = getClient(); + const result = await client.functionApiBinding + .create({ + data: { + functionDefinitionId: cleanedData.functionDefinitionId, + apiId: cleanedData.apiId, + alias: cleanedData.alias, + config: cleanedData.config, + }, + select: { + id: true, + functionDefinitionId: true, + apiId: true, + alias: true, + config: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + }, + { + type: 'text', + name: 'apiId', + message: 'apiId', + required: false, + }, + { + type: 'text', + name: 'alias', + message: 'alias', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'config', + message: 'config', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionApiBindingPatch; + const client = getClient(); + const result = await client.functionApiBinding + .update({ + where: { + id: answers.id as string, + }, + data: { + functionDefinitionId: cleanedData.functionDefinitionId, + apiId: cleanedData.apiId, + alias: cleanedData.alias, + config: cleanedData.config, + }, + select: { + id: true, + functionDefinitionId: true, + apiId: true, + alias: true, + config: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionApiBinding + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-definition.ts b/sdk/constructive-cli/src/compute/cli/commands/function-definition.ts new file mode 100644 index 0000000000..16609a2606 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-definition.ts @@ -0,0 +1,817 @@ +/** + * CLI commands for FunctionDefinition + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDefinitionInput, + FunctionDefinitionPatch, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + createdAt: 'string', + updatedAt: 'string', + scope: 'string', + name: 'string', + taskIdentifier: 'string', + description: 'string', + isInvocable: 'boolean', + maxAttempts: 'int', + priority: 'int', + queueName: 'string', + runtime: 'string', + image: 'string', + concurrency: 'int', + scaleMin: 'int', + scaleMax: 'int', + timeoutSeconds: 'int', + resources: 'json', + isBuiltIn: 'boolean', + requiredSecrets: 'string', + requiredConfigs: 'string', + requiredBuckets: 'string', + requiredModels: 'string', + inputs: 'json', + outputs: 'json', + props: 'json', + volatile: 'boolean', + icon: 'string', + category: 'string', +}; +const usage = + '\nfunction-definition \n\nCommands:\n list List functionDefinition records\n find-first Find first matching functionDefinition record\n get Get a functionDefinition by ID\n create Create a new functionDefinition\n update Update an existing functionDefinition\n delete Delete a functionDefinition\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + scope: true, + name: true, + taskIdentifier: true, + description: true, + isInvocable: true, + maxAttempts: true, + priority: true, + queueName: true, + runtime: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + isBuiltIn: true, + requiredSecrets: true, + requiredConfigs: true, + requiredBuckets: true, + requiredModels: true, + inputs: true, + outputs: true, + props: true, + volatile: true, + icon: true, + category: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + > & { + select: FunctionDefinitionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDefinition.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + scope: true, + name: true, + taskIdentifier: true, + description: true, + isInvocable: true, + maxAttempts: true, + priority: true, + queueName: true, + runtime: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + isBuiltIn: true, + requiredSecrets: true, + requiredConfigs: true, + requiredBuckets: true, + requiredModels: true, + inputs: true, + outputs: true, + props: true, + volatile: true, + icon: true, + category: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + > & { + select: FunctionDefinitionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDefinition.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionDefinition + .findOne({ + id: answers.id as string, + select: { + id: true, + createdAt: true, + updatedAt: true, + scope: true, + name: true, + taskIdentifier: true, + description: true, + isInvocable: true, + maxAttempts: true, + priority: true, + queueName: true, + runtime: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + isBuiltIn: true, + requiredSecrets: true, + requiredConfigs: true, + requiredBuckets: true, + requiredModels: true, + inputs: true, + outputs: true, + props: true, + volatile: true, + icon: true, + category: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'scope', + message: 'scope', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isInvocable', + message: 'isInvocable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAttempts', + message: 'maxAttempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queueName', + message: 'queueName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtime', + message: 'runtime', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBuiltIn', + message: 'isBuiltIn', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredBuckets', + message: 'requiredBuckets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredModels', + message: 'requiredModels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputs', + message: 'inputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'outputs', + message: 'outputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'props', + message: 'props', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'volatile', + message: 'volatile', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDefinitionInput['functionDefinition']; + const client = getClient(); + const result = await client.functionDefinition + .create({ + data: { + scope: cleanedData.scope, + name: cleanedData.name, + taskIdentifier: cleanedData.taskIdentifier, + description: cleanedData.description, + isInvocable: cleanedData.isInvocable, + maxAttempts: cleanedData.maxAttempts, + priority: cleanedData.priority, + queueName: cleanedData.queueName, + runtime: cleanedData.runtime, + image: cleanedData.image, + concurrency: cleanedData.concurrency, + scaleMin: cleanedData.scaleMin, + scaleMax: cleanedData.scaleMax, + timeoutSeconds: cleanedData.timeoutSeconds, + resources: cleanedData.resources, + isBuiltIn: cleanedData.isBuiltIn, + requiredSecrets: cleanedData.requiredSecrets, + requiredConfigs: cleanedData.requiredConfigs, + requiredBuckets: cleanedData.requiredBuckets, + requiredModels: cleanedData.requiredModels, + inputs: cleanedData.inputs, + outputs: cleanedData.outputs, + props: cleanedData.props, + volatile: cleanedData.volatile, + icon: cleanedData.icon, + category: cleanedData.category, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + scope: true, + name: true, + taskIdentifier: true, + description: true, + isInvocable: true, + maxAttempts: true, + priority: true, + queueName: true, + runtime: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + isBuiltIn: true, + requiredSecrets: true, + requiredConfigs: true, + requiredBuckets: true, + requiredModels: true, + inputs: true, + outputs: true, + props: true, + volatile: true, + icon: true, + category: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isInvocable', + message: 'isInvocable', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxAttempts', + message: 'maxAttempts', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'priority', + message: 'priority', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'queueName', + message: 'queueName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'runtime', + message: 'runtime', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBuiltIn', + message: 'isBuiltIn', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredSecrets', + message: 'requiredSecrets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredConfigs', + message: 'requiredConfigs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredBuckets', + message: 'requiredBuckets', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'requiredModels', + message: 'requiredModels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputs', + message: 'inputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'outputs', + message: 'outputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'props', + message: 'props', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'volatile', + message: 'volatile', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'icon', + message: 'icon', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'category', + message: 'category', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDefinitionPatch; + const client = getClient(); + const result = await client.functionDefinition + .update({ + where: { + id: answers.id as string, + }, + data: { + scope: cleanedData.scope, + name: cleanedData.name, + taskIdentifier: cleanedData.taskIdentifier, + description: cleanedData.description, + isInvocable: cleanedData.isInvocable, + maxAttempts: cleanedData.maxAttempts, + priority: cleanedData.priority, + queueName: cleanedData.queueName, + runtime: cleanedData.runtime, + image: cleanedData.image, + concurrency: cleanedData.concurrency, + scaleMin: cleanedData.scaleMin, + scaleMax: cleanedData.scaleMax, + timeoutSeconds: cleanedData.timeoutSeconds, + resources: cleanedData.resources, + isBuiltIn: cleanedData.isBuiltIn, + requiredSecrets: cleanedData.requiredSecrets, + requiredConfigs: cleanedData.requiredConfigs, + requiredBuckets: cleanedData.requiredBuckets, + requiredModels: cleanedData.requiredModels, + inputs: cleanedData.inputs, + outputs: cleanedData.outputs, + props: cleanedData.props, + volatile: cleanedData.volatile, + icon: cleanedData.icon, + category: cleanedData.category, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + scope: true, + name: true, + taskIdentifier: true, + description: true, + isInvocable: true, + maxAttempts: true, + priority: true, + queueName: true, + runtime: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + isBuiltIn: true, + requiredSecrets: true, + requiredConfigs: true, + requiredBuckets: true, + requiredModels: true, + inputs: true, + outputs: true, + props: true, + volatile: true, + icon: true, + category: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionDefinition + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-deployment-event.ts b/sdk/constructive-cli/src/compute/cli/commands/function-deployment-event.ts new file mode 100644 index 0000000000..d302de7314 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-deployment-event.ts @@ -0,0 +1,385 @@ +/** + * CLI commands for FunctionDeploymentEvent + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + createdAt: 'string', + id: 'uuid', + deploymentId: 'uuid', + eventType: 'string', + actorId: 'uuid', + message: 'string', + metadata: 'json', + databaseId: 'uuid', +}; +const usage = + '\nfunction-deployment-event \n\nCommands:\n list List functionDeploymentEvent records\n find-first Find first matching functionDeploymentEvent record\n get Get a functionDeploymentEvent by ID\n create Create a new functionDeploymentEvent\n update Update an existing functionDeploymentEvent\n delete Delete a functionDeploymentEvent\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + deploymentId: true, + eventType: true, + actorId: true, + message: true, + metadata: true, + databaseId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + > & { + select: FunctionDeploymentEventSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDeploymentEvent.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + deploymentId: true, + eventType: true, + actorId: true, + message: true, + metadata: true, + databaseId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + > & { + select: FunctionDeploymentEventSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDeploymentEvent.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionDeploymentEvent + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + deploymentId: true, + eventType: true, + actorId: true, + message: true, + metadata: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'deploymentId', + message: 'deploymentId', + required: true, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDeploymentEventInput['functionDeploymentEvent']; + const client = getClient(); + const result = await client.functionDeploymentEvent + .create({ + data: { + deploymentId: cleanedData.deploymentId, + eventType: cleanedData.eventType, + actorId: cleanedData.actorId, + message: cleanedData.message, + metadata: cleanedData.metadata, + databaseId: cleanedData.databaseId, + }, + select: { + createdAt: true, + id: true, + deploymentId: true, + eventType: true, + actorId: true, + message: true, + metadata: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'deploymentId', + message: 'deploymentId', + required: false, + }, + { + type: 'text', + name: 'eventType', + message: 'eventType', + required: false, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDeploymentEventPatch; + const client = getClient(); + const result = await client.functionDeploymentEvent + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + deploymentId: cleanedData.deploymentId, + eventType: cleanedData.eventType, + actorId: cleanedData.actorId, + message: cleanedData.message, + metadata: cleanedData.metadata, + databaseId: cleanedData.databaseId, + }, + select: { + createdAt: true, + id: true, + deploymentId: true, + eventType: true, + actorId: true, + message: true, + metadata: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionDeploymentEvent + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-deployment.ts b/sdk/constructive-cli/src/compute/cli/commands/function-deployment.ts new file mode 100644 index 0000000000..5aa5f11826 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-deployment.ts @@ -0,0 +1,641 @@ +/** + * CLI commands for FunctionDeployment + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDeploymentInput, + FunctionDeploymentPatch, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + createdAt: 'string', + updatedAt: 'string', + functionDefinitionId: 'uuid', + namespaceId: 'uuid', + status: 'string', + serviceUrl: 'string', + serviceName: 'string', + revision: 'int', + image: 'string', + concurrency: 'int', + scaleMin: 'int', + scaleMax: 'int', + timeoutSeconds: 'int', + resources: 'json', + lastError: 'string', + lastErrorAt: 'string', + errorCount: 'int', + labels: 'json', + annotations: 'json', + databaseId: 'uuid', +}; +const usage = + '\nfunction-deployment \n\nCommands:\n list List functionDeployment records\n find-first Find first matching functionDeployment record\n get Get a functionDeployment by ID\n create Create a new functionDeployment\n update Update an existing functionDeployment\n delete Delete a functionDeployment\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + functionDefinitionId: true, + namespaceId: true, + status: true, + serviceUrl: true, + serviceName: true, + revision: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + lastError: true, + lastErrorAt: true, + errorCount: true, + labels: true, + annotations: true, + databaseId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + > & { + select: FunctionDeploymentSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDeployment.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + functionDefinitionId: true, + namespaceId: true, + status: true, + serviceUrl: true, + serviceName: true, + revision: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + lastError: true, + lastErrorAt: true, + errorCount: true, + labels: true, + annotations: true, + databaseId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + > & { + select: FunctionDeploymentSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDeployment.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionDeployment + .findOne({ + id: answers.id as string, + select: { + id: true, + createdAt: true, + updatedAt: true, + functionDefinitionId: true, + namespaceId: true, + status: true, + serviceUrl: true, + serviceName: true, + revision: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + lastError: true, + lastErrorAt: true, + errorCount: true, + labels: true, + annotations: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceUrl', + message: 'serviceUrl', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceName', + message: 'serviceName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastErrorAt', + message: 'lastErrorAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDeploymentInput['functionDeployment']; + const client = getClient(); + const result = await client.functionDeployment + .create({ + data: { + functionDefinitionId: cleanedData.functionDefinitionId, + namespaceId: cleanedData.namespaceId, + status: cleanedData.status, + serviceUrl: cleanedData.serviceUrl, + serviceName: cleanedData.serviceName, + revision: cleanedData.revision, + image: cleanedData.image, + concurrency: cleanedData.concurrency, + scaleMin: cleanedData.scaleMin, + scaleMax: cleanedData.scaleMax, + timeoutSeconds: cleanedData.timeoutSeconds, + resources: cleanedData.resources, + lastError: cleanedData.lastError, + lastErrorAt: cleanedData.lastErrorAt, + errorCount: cleanedData.errorCount, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + functionDefinitionId: true, + namespaceId: true, + status: true, + serviceUrl: true, + serviceName: true, + revision: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + lastError: true, + lastErrorAt: true, + errorCount: true, + labels: true, + annotations: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'functionDefinitionId', + message: 'functionDefinitionId', + required: false, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceUrl', + message: 'serviceUrl', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'serviceName', + message: 'serviceName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revision', + message: 'revision', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'image', + message: 'image', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'concurrency', + message: 'concurrency', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMin', + message: 'scaleMin', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scaleMax', + message: 'scaleMax', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutSeconds', + message: 'timeoutSeconds', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'resources', + message: 'resources', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastError', + message: 'lastError', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastErrorAt', + message: 'lastErrorAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCount', + message: 'errorCount', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDeploymentPatch; + const client = getClient(); + const result = await client.functionDeployment + .update({ + where: { + id: answers.id as string, + }, + data: { + functionDefinitionId: cleanedData.functionDefinitionId, + namespaceId: cleanedData.namespaceId, + status: cleanedData.status, + serviceUrl: cleanedData.serviceUrl, + serviceName: cleanedData.serviceName, + revision: cleanedData.revision, + image: cleanedData.image, + concurrency: cleanedData.concurrency, + scaleMin: cleanedData.scaleMin, + scaleMax: cleanedData.scaleMax, + timeoutSeconds: cleanedData.timeoutSeconds, + resources: cleanedData.resources, + lastError: cleanedData.lastError, + lastErrorAt: cleanedData.lastErrorAt, + errorCount: cleanedData.errorCount, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + functionDefinitionId: true, + namespaceId: true, + status: true, + serviceUrl: true, + serviceName: true, + revision: true, + image: true, + concurrency: true, + scaleMin: true, + scaleMax: true, + timeoutSeconds: true, + resources: true, + lastError: true, + lastErrorAt: true, + errorCount: true, + labels: true, + annotations: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionDeployment + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-execution-log.ts b/sdk/constructive-cli/src/compute/cli/commands/function-execution-log.ts new file mode 100644 index 0000000000..0927e232c0 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-execution-log.ts @@ -0,0 +1,409 @@ +/** + * CLI commands for FunctionExecutionLog + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionExecutionLogInput, + FunctionExecutionLogPatch, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + createdAt: 'string', + id: 'uuid', + invocationId: 'uuid', + taskIdentifier: 'string', + logLevel: 'string', + message: 'string', + metadata: 'json', + actorId: 'uuid', + databaseId: 'uuid', +}; +const usage = + '\nfunction-execution-log \n\nCommands:\n list List functionExecutionLog records\n find-first Find first matching functionExecutionLog record\n get Get a functionExecutionLog by ID\n create Create a new functionExecutionLog\n update Update an existing functionExecutionLog\n delete Delete a functionExecutionLog\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + databaseId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + > & { + select: FunctionExecutionLogSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionExecutionLog.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + databaseId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + > & { + select: FunctionExecutionLogSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionExecutionLog.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionExecutionLog + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionExecutionLogInput['functionExecutionLog']; + const client = getClient(); + const result = await client.functionExecutionLog + .create({ + data: { + invocationId: cleanedData.invocationId, + taskIdentifier: cleanedData.taskIdentifier, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + }, + select: { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionExecutionLogPatch; + const client = getClient(); + const result = await client.functionExecutionLog + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + invocationId: cleanedData.invocationId, + taskIdentifier: cleanedData.taskIdentifier, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + }, + select: { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionExecutionLog + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-commit.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-commit.ts new file mode 100644 index 0000000000..3708a5c1a2 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-commit.ts @@ -0,0 +1,418 @@ +/** + * CLI commands for FunctionGraphCommit + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphCommitInput, + FunctionGraphCommitPatch, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + message: 'string', + databaseId: 'uuid', + storeId: 'uuid', + parentIds: 'uuid', + authorId: 'uuid', + committerId: 'uuid', + treeId: 'uuid', + date: 'string', +}; +const usage = + '\nfunction-graph-commit \n\nCommands:\n list List functionGraphCommit records\n find-first Find first matching functionGraphCommit record\n get Get a functionGraphCommit by ID\n create Create a new functionGraphCommit\n update Update an existing functionGraphCommit\n delete Delete a functionGraphCommit\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + message: true, + databaseId: true, + storeId: true, + parentIds: true, + authorId: true, + committerId: true, + treeId: true, + date: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + > & { + select: FunctionGraphCommitSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphCommit.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + message: true, + databaseId: true, + storeId: true, + parentIds: true, + authorId: true, + committerId: true, + treeId: true, + date: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + > & { + select: FunctionGraphCommitSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphCommit.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraphCommit + .findOne({ + id: answers.id as string, + select: { + id: true, + message: true, + databaseId: true, + storeId: true, + parentIds: true, + authorId: true, + committerId: true, + treeId: true, + date: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphCommitInput['functionGraphCommit']; + const client = getClient(); + const result = await client.functionGraphCommit + .create({ + data: { + message: cleanedData.message, + databaseId: cleanedData.databaseId, + storeId: cleanedData.storeId, + parentIds: cleanedData.parentIds, + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + treeId: cleanedData.treeId, + date: cleanedData.date, + }, + select: { + id: true, + message: true, + databaseId: true, + storeId: true, + parentIds: true, + authorId: true, + committerId: true, + treeId: true, + date: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'parentIds', + message: 'parentIds', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'authorId', + message: 'authorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'committerId', + message: 'committerId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'treeId', + message: 'treeId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'date', + message: 'date', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphCommitPatch; + const client = getClient(); + const result = await client.functionGraphCommit + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + message: cleanedData.message, + storeId: cleanedData.storeId, + parentIds: cleanedData.parentIds, + authorId: cleanedData.authorId, + committerId: cleanedData.committerId, + treeId: cleanedData.treeId, + date: cleanedData.date, + }, + select: { + id: true, + message: true, + databaseId: true, + storeId: true, + parentIds: true, + authorId: true, + committerId: true, + treeId: true, + date: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraphCommit + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-node-state.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-node-state.ts new file mode 100644 index 0000000000..b464a44c09 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-node-state.ts @@ -0,0 +1,476 @@ +/** + * CLI commands for FunctionGraphExecutionNodeState + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + createdAt: 'string', + id: 'uuid', + executionId: 'uuid', + databaseId: 'uuid', + nodeName: 'string', + nodePath: 'string', + status: 'string', + startedAt: 'string', + completedAt: 'string', + errorCode: 'string', + errorMessage: 'string', + outputId: 'uuid', +}; +const usage = + '\nfunction-graph-execution-node-state \n\nCommands:\n list List functionGraphExecutionNodeState records\n find-first Find first matching functionGraphExecutionNodeState record\n get Get a functionGraphExecutionNodeState by ID\n create Create a new functionGraphExecutionNodeState\n update Update an existing functionGraphExecutionNodeState\n delete Delete a functionGraphExecutionNodeState\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + executionId: true, + databaseId: true, + nodeName: true, + nodePath: true, + status: true, + startedAt: true, + completedAt: true, + errorCode: true, + errorMessage: true, + outputId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: FunctionGraphExecutionNodeStateSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphExecutionNodeState.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + executionId: true, + databaseId: true, + nodeName: true, + nodePath: true, + status: true, + startedAt: true, + completedAt: true, + errorCode: true, + errorMessage: true, + outputId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: FunctionGraphExecutionNodeStateSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphExecutionNodeState.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraphExecutionNodeState + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + executionId: true, + databaseId: true, + nodeName: true, + nodePath: true, + status: true, + startedAt: true, + completedAt: true, + errorCode: true, + errorMessage: true, + outputId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'executionId', + message: 'executionId', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'nodeName', + message: 'nodeName', + required: true, + }, + { + type: 'text', + name: 'nodePath', + message: 'nodePath', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputId', + message: 'outputId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState']; + const client = getClient(); + const result = await client.functionGraphExecutionNodeState + .create({ + data: { + executionId: cleanedData.executionId, + databaseId: cleanedData.databaseId, + nodeName: cleanedData.nodeName, + nodePath: cleanedData.nodePath, + status: cleanedData.status, + startedAt: cleanedData.startedAt, + completedAt: cleanedData.completedAt, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + outputId: cleanedData.outputId, + }, + select: { + createdAt: true, + id: true, + executionId: true, + databaseId: true, + nodeName: true, + nodePath: true, + status: true, + startedAt: true, + completedAt: true, + errorCode: true, + errorMessage: true, + outputId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'executionId', + message: 'executionId', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'nodeName', + message: 'nodeName', + required: false, + }, + { + type: 'text', + name: 'nodePath', + message: 'nodePath', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputId', + message: 'outputId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as FunctionGraphExecutionNodeStatePatch; + const client = getClient(); + const result = await client.functionGraphExecutionNodeState + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + executionId: cleanedData.executionId, + databaseId: cleanedData.databaseId, + nodeName: cleanedData.nodeName, + nodePath: cleanedData.nodePath, + status: cleanedData.status, + startedAt: cleanedData.startedAt, + completedAt: cleanedData.completedAt, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + outputId: cleanedData.outputId, + }, + select: { + createdAt: true, + id: true, + executionId: true, + databaseId: true, + nodeName: true, + nodePath: true, + status: true, + startedAt: true, + completedAt: true, + errorCode: true, + errorMessage: true, + outputId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraphExecutionNodeState + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-output.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-output.ts new file mode 100644 index 0000000000..e4f5ea3b0a --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution-output.ts @@ -0,0 +1,319 @@ +/** + * CLI commands for FunctionGraphExecutionOutput + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + createdAt: 'string', + id: 'uuid', + databaseId: 'uuid', + hash: 'string', + data: 'json', +}; +const usage = + '\nfunction-graph-execution-output \n\nCommands:\n list List functionGraphExecutionOutput records\n find-first Find first matching functionGraphExecutionOutput record\n get Get a functionGraphExecutionOutput by ID\n create Create a new functionGraphExecutionOutput\n update Update an existing functionGraphExecutionOutput\n delete Delete a functionGraphExecutionOutput\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + databaseId: true, + hash: true, + data: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: FunctionGraphExecutionOutputSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphExecutionOutput.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + databaseId: true, + hash: true, + data: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: FunctionGraphExecutionOutputSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphExecutionOutput.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraphExecutionOutput + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + databaseId: true, + hash: true, + data: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput']; + const client = getClient(); + const result = await client.functionGraphExecutionOutput + .create({ + data: { + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + data: cleanedData.data, + }, + select: { + createdAt: true, + id: true, + databaseId: true, + hash: true, + data: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphExecutionOutputPatch; + const client = getClient(); + const result = await client.functionGraphExecutionOutput + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + data: cleanedData.data, + }, + select: { + createdAt: true, + id: true, + databaseId: true, + hash: true, + data: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraphExecutionOutput + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution.ts new file mode 100644 index 0000000000..a49aeaed79 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution.ts @@ -0,0 +1,745 @@ +/** + * CLI commands for FunctionGraphExecution + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + startedAt: 'string', + id: 'uuid', + graphId: 'uuid', + invocationId: 'uuid', + databaseId: 'uuid', + entityId: 'uuid', + outputNode: 'string', + outputPort: 'string', + status: 'string', + inputPayload: 'json', + outputPayload: 'json', + nodeOutputs: 'json', + executionPlan: 'json', + currentWave: 'int', + parentExecutionId: 'uuid', + parentNodeName: 'string', + definitionsCommitId: 'uuid', + tickCount: 'int', + completedAt: 'string', + maxTicks: 'int', + maxPendingJobs: 'int', + timeoutAt: 'string', + errorCode: 'string', + errorMessage: 'string', +}; +const usage = + '\nfunction-graph-execution \n\nCommands:\n list List functionGraphExecution records\n find-first Find first matching functionGraphExecution record\n get Get a functionGraphExecution by ID\n create Create a new functionGraphExecution\n update Update an existing functionGraphExecution\n delete Delete a functionGraphExecution\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + startedAt: true, + id: true, + graphId: true, + invocationId: true, + databaseId: true, + entityId: true, + outputNode: true, + outputPort: true, + status: true, + inputPayload: true, + outputPayload: true, + nodeOutputs: true, + executionPlan: true, + currentWave: true, + parentExecutionId: true, + parentNodeName: true, + definitionsCommitId: true, + tickCount: true, + completedAt: true, + maxTicks: true, + maxPendingJobs: true, + timeoutAt: true, + errorCode: true, + errorMessage: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + > & { + select: FunctionGraphExecutionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphExecution.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + startedAt: true, + id: true, + graphId: true, + invocationId: true, + databaseId: true, + entityId: true, + outputNode: true, + outputPort: true, + status: true, + inputPayload: true, + outputPayload: true, + nodeOutputs: true, + executionPlan: true, + currentWave: true, + parentExecutionId: true, + parentNodeName: true, + definitionsCommitId: true, + tickCount: true, + completedAt: true, + maxTicks: true, + maxPendingJobs: true, + timeoutAt: true, + errorCode: true, + errorMessage: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + > & { + select: FunctionGraphExecutionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphExecution.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraphExecution + .findOne({ + id: answers.id as string, + select: { + startedAt: true, + id: true, + graphId: true, + invocationId: true, + databaseId: true, + entityId: true, + outputNode: true, + outputPort: true, + status: true, + inputPayload: true, + outputPayload: true, + nodeOutputs: true, + executionPlan: true, + currentWave: true, + parentExecutionId: true, + parentNodeName: true, + definitionsCommitId: true, + tickCount: true, + completedAt: true, + maxTicks: true, + maxPendingJobs: true, + timeoutAt: true, + errorCode: true, + errorMessage: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputNode', + message: 'outputNode', + required: true, + }, + { + type: 'text', + name: 'outputPort', + message: 'outputPort', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputPayload', + message: 'inputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'outputPayload', + message: 'outputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodeOutputs', + message: 'nodeOutputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'executionPlan', + message: 'executionPlan', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentWave', + message: 'currentWave', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentExecutionId', + message: 'parentExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentNodeName', + message: 'parentNodeName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tickCount', + message: 'tickCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxTicks', + message: 'maxTicks', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxPendingJobs', + message: 'maxPendingJobs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutAt', + message: 'timeoutAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphExecutionInput['functionGraphExecution']; + const client = getClient(); + const result = await client.functionGraphExecution + .create({ + data: { + startedAt: cleanedData.startedAt, + graphId: cleanedData.graphId, + invocationId: cleanedData.invocationId, + databaseId: cleanedData.databaseId, + entityId: cleanedData.entityId, + outputNode: cleanedData.outputNode, + outputPort: cleanedData.outputPort, + status: cleanedData.status, + inputPayload: cleanedData.inputPayload, + outputPayload: cleanedData.outputPayload, + nodeOutputs: cleanedData.nodeOutputs, + executionPlan: cleanedData.executionPlan, + currentWave: cleanedData.currentWave, + parentExecutionId: cleanedData.parentExecutionId, + parentNodeName: cleanedData.parentNodeName, + definitionsCommitId: cleanedData.definitionsCommitId, + tickCount: cleanedData.tickCount, + completedAt: cleanedData.completedAt, + maxTicks: cleanedData.maxTicks, + maxPendingJobs: cleanedData.maxPendingJobs, + timeoutAt: cleanedData.timeoutAt, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + }, + select: { + startedAt: true, + id: true, + graphId: true, + invocationId: true, + databaseId: true, + entityId: true, + outputNode: true, + outputPort: true, + status: true, + inputPayload: true, + outputPayload: true, + nodeOutputs: true, + executionPlan: true, + currentWave: true, + parentExecutionId: true, + parentNodeName: true, + definitionsCommitId: true, + tickCount: true, + completedAt: true, + maxTicks: true, + maxPendingJobs: true, + timeoutAt: true, + errorCode: true, + errorMessage: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: true, + }, + { + type: 'text', + name: 'graphId', + message: 'graphId', + required: false, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputNode', + message: 'outputNode', + required: false, + }, + { + type: 'text', + name: 'outputPort', + message: 'outputPort', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'inputPayload', + message: 'inputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'outputPayload', + message: 'outputPayload', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'nodeOutputs', + message: 'nodeOutputs', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'executionPlan', + message: 'executionPlan', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'currentWave', + message: 'currentWave', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentExecutionId', + message: 'parentExecutionId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentNodeName', + message: 'parentNodeName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'tickCount', + message: 'tickCount', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxTicks', + message: 'maxTicks', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'maxPendingJobs', + message: 'maxPendingJobs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'timeoutAt', + message: 'timeoutAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorCode', + message: 'errorCode', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'errorMessage', + message: 'errorMessage', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphExecutionPatch; + const client = getClient(); + const result = await client.functionGraphExecution + .update({ + where: { + id: answers.id as string, + startedAt: answers.startedAt as string, + }, + data: { + graphId: cleanedData.graphId, + invocationId: cleanedData.invocationId, + databaseId: cleanedData.databaseId, + entityId: cleanedData.entityId, + outputNode: cleanedData.outputNode, + outputPort: cleanedData.outputPort, + status: cleanedData.status, + inputPayload: cleanedData.inputPayload, + outputPayload: cleanedData.outputPayload, + nodeOutputs: cleanedData.nodeOutputs, + executionPlan: cleanedData.executionPlan, + currentWave: cleanedData.currentWave, + parentExecutionId: cleanedData.parentExecutionId, + parentNodeName: cleanedData.parentNodeName, + definitionsCommitId: cleanedData.definitionsCommitId, + tickCount: cleanedData.tickCount, + completedAt: cleanedData.completedAt, + maxTicks: cleanedData.maxTicks, + maxPendingJobs: cleanedData.maxPendingJobs, + timeoutAt: cleanedData.timeoutAt, + errorCode: cleanedData.errorCode, + errorMessage: cleanedData.errorMessage, + }, + select: { + startedAt: true, + id: true, + graphId: true, + invocationId: true, + databaseId: true, + entityId: true, + outputNode: true, + outputPort: true, + status: true, + inputPayload: true, + outputPayload: true, + nodeOutputs: true, + executionPlan: true, + currentWave: true, + parentExecutionId: true, + parentNodeName: true, + definitionsCommitId: true, + tickCount: true, + completedAt: true, + maxTicks: true, + maxPendingJobs: true, + timeoutAt: true, + errorCode: true, + errorMessage: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraphExecution + .delete({ + where: { + id: answers.id as string, + startedAt: answers.startedAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-object.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-object.ts new file mode 100644 index 0000000000..055b2fcefe --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-object.ts @@ -0,0 +1,338 @@ +/** + * CLI commands for FunctionGraphObject + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphObjectInput, + FunctionGraphObjectPatch, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + databaseId: 'uuid', + kids: 'uuid', + ktree: 'string', + data: 'json', + createdAt: 'string', +}; +const usage = + '\nfunction-graph-object \n\nCommands:\n list List functionGraphObject records\n find-first Find first matching functionGraphObject record\n get Get a functionGraphObject by ID\n create Create a new functionGraphObject\n update Update an existing functionGraphObject\n delete Delete a functionGraphObject\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + kids: true, + ktree: true, + data: true, + createdAt: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + > & { + select: FunctionGraphObjectSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphObject.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + kids: true, + ktree: true, + data: true, + createdAt: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + > & { + select: FunctionGraphObjectSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphObject.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraphObject + .findOne({ + id: answers.id as string, + select: { + id: true, + databaseId: true, + kids: true, + ktree: true, + data: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphObjectInput['functionGraphObject']; + const client = getClient(); + const result = await client.functionGraphObject + .create({ + data: { + databaseId: cleanedData.databaseId, + kids: cleanedData.kids, + ktree: cleanedData.ktree, + data: cleanedData.data, + }, + select: { + id: true, + databaseId: true, + kids: true, + ktree: true, + data: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'kids', + message: 'kids', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'ktree', + message: 'ktree', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphObjectPatch; + const client = getClient(); + const result = await client.functionGraphObject + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + kids: cleanedData.kids, + ktree: cleanedData.ktree, + data: cleanedData.data, + }, + select: { + id: true, + databaseId: true, + kids: true, + ktree: true, + data: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraphObject + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-ref.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-ref.ts new file mode 100644 index 0000000000..3a0701610e --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-ref.ts @@ -0,0 +1,320 @@ +/** + * CLI commands for FunctionGraphRef + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphRefInput, + FunctionGraphRefPatch, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + name: 'string', + databaseId: 'uuid', + storeId: 'uuid', + commitId: 'uuid', +}; +const usage = + '\nfunction-graph-ref \n\nCommands:\n list List functionGraphRef records\n find-first Find first matching functionGraphRef record\n get Get a functionGraphRef by ID\n create Create a new functionGraphRef\n update Update an existing functionGraphRef\n delete Delete a functionGraphRef\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + name: true, + databaseId: true, + storeId: true, + commitId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FunctionGraphRefSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphRef.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + name: true, + databaseId: true, + storeId: true, + commitId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FunctionGraphRefSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphRef.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraphRef + .findOne({ + id: answers.id as string, + select: { + id: true, + name: true, + databaseId: true, + storeId: true, + commitId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphRefInput['functionGraphRef']; + const client = getClient(); + const result = await client.functionGraphRef + .create({ + data: { + name: cleanedData.name, + databaseId: cleanedData.databaseId, + storeId: cleanedData.storeId, + commitId: cleanedData.commitId, + }, + select: { + id: true, + name: true, + databaseId: true, + storeId: true, + commitId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'commitId', + message: 'commitId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphRefPatch; + const client = getClient(); + const result = await client.functionGraphRef + .update({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + data: { + name: cleanedData.name, + storeId: cleanedData.storeId, + commitId: cleanedData.commitId, + }, + select: { + id: true, + name: true, + databaseId: true, + storeId: true, + commitId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraphRef + .delete({ + where: { + id: answers.id as string, + databaseId: answers.databaseId as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph-store.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph-store.ts new file mode 100644 index 0000000000..9cb67b3970 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-store.ts @@ -0,0 +1,307 @@ +/** + * CLI commands for FunctionGraphStore + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphStoreInput, + FunctionGraphStorePatch, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + name: 'string', + databaseId: 'uuid', + hash: 'uuid', + createdAt: 'string', +}; +const usage = + '\nfunction-graph-store \n\nCommands:\n list List functionGraphStore records\n find-first Find first matching functionGraphStore record\n get Get a functionGraphStore by ID\n create Create a new functionGraphStore\n update Update an existing functionGraphStore\n delete Delete a functionGraphStore\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + name: true, + databaseId: true, + hash: true, + createdAt: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + > & { + select: FunctionGraphStoreSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphStore.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + name: true, + databaseId: true, + hash: true, + createdAt: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + > & { + select: FunctionGraphStoreSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraphStore.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraphStore + .findOne({ + id: answers.id as string, + select: { + id: true, + name: true, + databaseId: true, + hash: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphStoreInput['functionGraphStore']; + const client = getClient(); + const result = await client.functionGraphStore + .create({ + data: { + name: cleanedData.name, + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + }, + select: { + id: true, + name: true, + databaseId: true, + hash: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'hash', + message: 'hash', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphStorePatch; + const client = getClient(); + const result = await client.functionGraphStore + .update({ + where: { + id: answers.id as string, + }, + data: { + name: cleanedData.name, + databaseId: cleanedData.databaseId, + hash: cleanedData.hash, + }, + select: { + id: true, + name: true, + databaseId: true, + hash: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraphStore + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts new file mode 100644 index 0000000000..0586972990 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts @@ -0,0 +1,443 @@ +/** + * CLI commands for FunctionGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionGraphInput, + FunctionGraphPatch, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + databaseId: 'uuid', + storeId: 'uuid', + entityId: 'uuid', + context: 'string', + name: 'string', + description: 'string', + definitionsCommitId: 'uuid', + isValid: 'boolean', + validationErrors: 'json', + createdBy: 'uuid', + createdAt: 'string', + updatedAt: 'string', +}; +const usage = + '\nfunction-graph \n\nCommands:\n list List functionGraph records\n find-first Find first matching functionGraph record\n get Get a functionGraph by ID\n create Create a new functionGraph\n update Update an existing functionGraph\n delete Delete a functionGraph\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + storeId: true, + entityId: true, + context: true, + name: true, + description: true, + definitionsCommitId: true, + isValid: true, + validationErrors: true, + createdBy: true, + createdAt: true, + updatedAt: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: FunctionGraphSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraph.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + storeId: true, + entityId: true, + context: true, + name: true, + description: true, + definitionsCommitId: true, + isValid: true, + validationErrors: true, + createdBy: true, + createdAt: true, + updatedAt: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: FunctionGraphSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionGraph.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionGraph + .findOne({ + id: answers.id as string, + select: { + id: true, + databaseId: true, + storeId: true, + entityId: true, + context: true, + name: true, + description: true, + definitionsCommitId: true, + isValid: true, + validationErrors: true, + createdBy: true, + createdAt: true, + updatedAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'context', + message: 'context', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: true, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: true, + }, + { + type: 'boolean', + name: 'isValid', + message: 'isValid', + required: true, + }, + { + type: 'json', + name: 'validationErrors', + message: 'validationErrors', + required: true, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionGraphInput['functionGraph']; + const client = getClient(); + const result = await client.functionGraph + .create({ + data: { + databaseId: cleanedData.databaseId, + storeId: cleanedData.storeId, + entityId: cleanedData.entityId, + context: cleanedData.context, + name: cleanedData.name, + description: cleanedData.description, + definitionsCommitId: cleanedData.definitionsCommitId, + isValid: cleanedData.isValid, + validationErrors: cleanedData.validationErrors, + createdBy: cleanedData.createdBy, + }, + select: { + id: true, + databaseId: true, + storeId: true, + entityId: true, + context: true, + name: true, + description: true, + definitionsCommitId: true, + isValid: true, + validationErrors: true, + createdBy: true, + createdAt: true, + updatedAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'storeId', + message: 'storeId', + required: false, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'context', + message: 'context', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + }, + { + type: 'text', + name: 'definitionsCommitId', + message: 'definitionsCommitId', + required: false, + }, + { + type: 'boolean', + name: 'isValid', + message: 'isValid', + required: false, + }, + { + type: 'json', + name: 'validationErrors', + message: 'validationErrors', + required: false, + }, + { + type: 'text', + name: 'createdBy', + message: 'createdBy', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionGraphPatch; + const client = getClient(); + const result = await client.functionGraph + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + storeId: cleanedData.storeId, + entityId: cleanedData.entityId, + context: cleanedData.context, + name: cleanedData.name, + description: cleanedData.description, + definitionsCommitId: cleanedData.definitionsCommitId, + isValid: cleanedData.isValid, + validationErrors: cleanedData.validationErrors, + createdBy: cleanedData.createdBy, + }, + select: { + id: true, + databaseId: true, + storeId: true, + entityId: true, + context: true, + name: true, + description: true, + definitionsCommitId: true, + isValid: true, + validationErrors: true, + createdBy: true, + createdAt: true, + updatedAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionGraph + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-invocation.ts b/sdk/constructive-cli/src/compute/cli/commands/function-invocation.ts new file mode 100644 index 0000000000..372156c907 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/function-invocation.ts @@ -0,0 +1,541 @@ +/** + * CLI commands for FunctionInvocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionInvocationInput, + FunctionInvocationPatch, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + createdAt: 'string', + id: 'uuid', + actorId: 'uuid', + databaseId: 'uuid', + taskIdentifier: 'string', + payload: 'json', + status: 'string', + result: 'json', + error: 'string', + durationMs: 'int', + jobId: 'int', + startedAt: 'string', + completedAt: 'string', + parentInvocationId: 'uuid', + graphExecutionId: 'uuid', +}; +const usage = + '\nfunction-invocation \n\nCommands:\n list List functionInvocation records\n find-first Find first matching functionInvocation record\n get Get a functionInvocation by ID\n create Create a new functionInvocation\n update Update an existing functionInvocation\n delete Delete a functionInvocation\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + actorId: true, + databaseId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + > & { + select: FunctionInvocationSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionInvocation.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + actorId: true, + databaseId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + > & { + select: FunctionInvocationSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionInvocation.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionInvocation + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + actorId: true, + databaseId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionInvocationInput['functionInvocation']; + const client = getClient(); + const result = await client.functionInvocation + .create({ + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + taskIdentifier: cleanedData.taskIdentifier, + payload: cleanedData.payload, + status: cleanedData.status, + result: cleanedData.result, + error: cleanedData.error, + durationMs: cleanedData.durationMs, + jobId: cleanedData.jobId, + startedAt: cleanedData.startedAt, + completedAt: cleanedData.completedAt, + parentInvocationId: cleanedData.parentInvocationId, + graphExecutionId: cleanedData.graphExecutionId, + }, + select: { + createdAt: true, + id: true, + actorId: true, + databaseId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionInvocationPatch; + const client = getClient(); + const result = await client.functionInvocation + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + databaseId: cleanedData.databaseId, + taskIdentifier: cleanedData.taskIdentifier, + payload: cleanedData.payload, + status: cleanedData.status, + result: cleanedData.result, + error: cleanedData.error, + durationMs: cleanedData.durationMs, + jobId: cleanedData.jobId, + startedAt: cleanedData.startedAt, + completedAt: cleanedData.completedAt, + parentInvocationId: cleanedData.parentInvocationId, + graphExecutionId: cleanedData.graphExecutionId, + }, + select: { + createdAt: true, + id: true, + actorId: true, + databaseId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionInvocation + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/get-all-record.ts b/sdk/constructive-cli/src/compute/cli/commands/get-all-record.ts new file mode 100644 index 0000000000..bb72aac01a --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/get-all-record.ts @@ -0,0 +1,150 @@ +/** + * CLI commands for GetAllRecord + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateGetAllRecordInput, + GetAllRecordPatch, + GetAllRecordSelect, + GetAllRecordFilter, + GetAllRecordsOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + path: 'string', + data: 'json', +}; +const usage = + '\nget-all-record \n\nCommands:\n list List getAllRecord records\n find-first Find first matching getAllRecord record\n create Create a new getAllRecord\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'create'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + path: true, + data: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: GetAllRecordSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.getAllRecord.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + path: true, + data: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: GetAllRecordSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.getAllRecord.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'path', + message: 'path', + required: true, + }, + { + type: 'json', + name: 'data', + message: 'data', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateGetAllRecordInput['getAllRecord']; + const client = getClient(); + const result = await client.getAllRecord + .create({ + data: { + path: cleanedData.path, + data: cleanedData.data, + }, + select: { + path: true, + data: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/import-definitions.ts b/sdk/constructive-cli/src/compute/cli/commands/import-definitions.ts new file mode 100644 index 0000000000..9f5fa2daa9 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/import-definitions.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation importDefinitions + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ImportDefinitionsVariables } from '../../orm/mutation'; +import type { ImportDefinitionsPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'import-definitions - importDefinitions\n\nUsage: import-definitions [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .importDefinitions( + parsedAnswers as unknown as ImportDefinitionsVariables, + { + select: selectFields, + } as unknown as { + select: ImportDefinitionsPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: importDefinitions'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/import-graph-json.ts b/sdk/constructive-cli/src/compute/cli/commands/import-graph-json.ts new file mode 100644 index 0000000000..cbe653e98e --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/import-graph-json.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation importGraphJson + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ImportGraphJsonVariables } from '../../orm/mutation'; +import type { ImportGraphJsonPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('import-graph-json - importGraphJson\n\nUsage: import-graph-json [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .importGraphJson( + parsedAnswers as unknown as ImportGraphJsonVariables, + { + select: selectFields, + } as unknown as { + select: ImportGraphJsonPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: importGraphJson'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/init-empty-repo.ts b/sdk/constructive-cli/src/compute/cli/commands/init-empty-repo.ts new file mode 100644 index 0000000000..85713a6542 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/init-empty-repo.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation initEmptyRepo + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InitEmptyRepoVariables } from '../../orm/mutation'; +import type { InitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('init-empty-repo - initEmptyRepo\n\nUsage: init-empty-repo [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .initEmptyRepo( + parsedAnswers as unknown as InitEmptyRepoVariables, + { + select: selectFields, + } as unknown as { + select: InitEmptyRepoPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: initEmptyRepo'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/insert-node-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/insert-node-at-path.ts new file mode 100644 index 0000000000..ded4cd5bb8 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/insert-node-at-path.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation insertNodeAtPath + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { InsertNodeAtPathVariables } from '../../orm/mutation'; +import type { InsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'insert-node-at-path - insertNodeAtPath\n\nUsage: insert-node-at-path [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .insertNodeAtPath( + parsedAnswers as unknown as InsertNodeAtPathVariables, + { + select: selectFields, + } as unknown as { + select: InsertNodeAtPathPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: insertNodeAtPath'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/org-function-execution-log.ts b/sdk/constructive-cli/src/compute/cli/commands/org-function-execution-log.ts new file mode 100644 index 0000000000..145f2d292a --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/org-function-execution-log.ts @@ -0,0 +1,389 @@ +/** + * CLI commands for OrgFunctionExecutionLog + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgFunctionExecutionLogInput, + OrgFunctionExecutionLogPatch, + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + createdAt: 'string', + id: 'uuid', + invocationId: 'uuid', + taskIdentifier: 'string', + logLevel: 'string', + message: 'string', + metadata: 'json', + actorId: 'uuid', +}; +const usage = + '\norg-function-execution-log \n\nCommands:\n list List orgFunctionExecutionLog records\n find-first Find first matching orgFunctionExecutionLog record\n get Get a orgFunctionExecutionLog by ID\n create Create a new orgFunctionExecutionLog\n update Update an existing orgFunctionExecutionLog\n delete Delete a orgFunctionExecutionLog\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + > & { + select: OrgFunctionExecutionLogSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.orgFunctionExecutionLog.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + > & { + select: OrgFunctionExecutionLogSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.orgFunctionExecutionLog.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.orgFunctionExecutionLog + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: true, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgFunctionExecutionLogInput['orgFunctionExecutionLog']; + const client = getClient(); + const result = await client.orgFunctionExecutionLog + .create({ + data: { + invocationId: cleanedData.invocationId, + taskIdentifier: cleanedData.taskIdentifier, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + actorId: cleanedData.actorId, + }, + select: { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'invocationId', + message: 'invocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'logLevel', + message: 'logLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'message', + message: 'message', + required: false, + }, + { + type: 'json', + name: 'metadata', + message: 'metadata', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as OrgFunctionExecutionLogPatch; + const client = getClient(); + const result = await client.orgFunctionExecutionLog + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + invocationId: cleanedData.invocationId, + taskIdentifier: cleanedData.taskIdentifier, + logLevel: cleanedData.logLevel, + message: cleanedData.message, + metadata: cleanedData.metadata, + actorId: cleanedData.actorId, + }, + select: { + createdAt: true, + id: true, + invocationId: true, + taskIdentifier: true, + logLevel: true, + message: true, + metadata: true, + actorId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.orgFunctionExecutionLog + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/org-function-invocation.ts b/sdk/constructive-cli/src/compute/cli/commands/org-function-invocation.ts new file mode 100644 index 0000000000..5b20916002 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/org-function-invocation.ts @@ -0,0 +1,521 @@ +/** + * CLI commands for OrgFunctionInvocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateOrgFunctionInvocationInput, + OrgFunctionInvocationPatch, + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + createdAt: 'string', + id: 'uuid', + actorId: 'uuid', + taskIdentifier: 'string', + payload: 'json', + status: 'string', + result: 'json', + error: 'string', + durationMs: 'int', + jobId: 'int', + startedAt: 'string', + completedAt: 'string', + parentInvocationId: 'uuid', + graphExecutionId: 'uuid', +}; +const usage = + '\norg-function-invocation \n\nCommands:\n list List orgFunctionInvocation records\n find-first Find first matching orgFunctionInvocation record\n get Get a orgFunctionInvocation by ID\n create Create a new orgFunctionInvocation\n update Update an existing orgFunctionInvocation\n delete Delete a orgFunctionInvocation\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + actorId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + > & { + select: OrgFunctionInvocationSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.orgFunctionInvocation.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + createdAt: true, + id: true, + actorId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + > & { + select: OrgFunctionInvocationSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.orgFunctionInvocation.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.orgFunctionInvocation + .findOne({ + id: answers.id as string, + select: { + createdAt: true, + id: true, + actorId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: true, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgFunctionInvocationInput['orgFunctionInvocation']; + const client = getClient(); + const result = await client.orgFunctionInvocation + .create({ + data: { + actorId: cleanedData.actorId, + taskIdentifier: cleanedData.taskIdentifier, + payload: cleanedData.payload, + status: cleanedData.status, + result: cleanedData.result, + error: cleanedData.error, + durationMs: cleanedData.durationMs, + jobId: cleanedData.jobId, + startedAt: cleanedData.startedAt, + completedAt: cleanedData.completedAt, + parentInvocationId: cleanedData.parentInvocationId, + graphExecutionId: cleanedData.graphExecutionId, + }, + select: { + createdAt: true, + id: true, + actorId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + { + type: 'text', + name: 'actorId', + message: 'actorId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'taskIdentifier', + message: 'taskIdentifier', + required: false, + }, + { + type: 'json', + name: 'payload', + message: 'payload', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'status', + message: 'status', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'result', + message: 'result', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'error', + message: 'error', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'durationMs', + message: 'durationMs', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'jobId', + message: 'jobId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'startedAt', + message: 'startedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'completedAt', + message: 'completedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'parentInvocationId', + message: 'parentInvocationId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphExecutionId', + message: 'graphExecutionId', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as OrgFunctionInvocationPatch; + const client = getClient(); + const result = await client.orgFunctionInvocation + .update({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + data: { + actorId: cleanedData.actorId, + taskIdentifier: cleanedData.taskIdentifier, + payload: cleanedData.payload, + status: cleanedData.status, + result: cleanedData.result, + error: cleanedData.error, + durationMs: cleanedData.durationMs, + jobId: cleanedData.jobId, + startedAt: cleanedData.startedAt, + completedAt: cleanedData.completedAt, + parentInvocationId: cleanedData.parentInvocationId, + graphExecutionId: cleanedData.graphExecutionId, + }, + select: { + createdAt: true, + id: true, + actorId: true, + taskIdentifier: true, + payload: true, + status: true, + result: true, + error: true, + durationMs: true, + jobId: true, + startedAt: true, + completedAt: true, + parentInvocationId: true, + graphExecutionId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.orgFunctionInvocation + .delete({ + where: { + id: answers.id as string, + createdAt: answers.createdAt as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/compute/cli/commands/provision-bucket.ts new file mode 100644 index 0000000000..ecd2e539d5 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/provision-bucket.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation provisionBucket + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: provisionBucket'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/read-function-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/read-function-graph.ts new file mode 100644 index 0000000000..ca5752bb22 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/read-function-graph.ts @@ -0,0 +1,40 @@ +/** + * CLI command for query readFunctionGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import type { ReadFunctionGraphVariables } from '../../orm/query'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'read-function-graph - readFunctionGraph\n\nUsage: read-function-graph [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'graphId', + message: 'graphId', + }, + ]); + const client = getClient(); + const result = await client.query + .readFunctionGraph(answers as unknown as ReadFunctionGraphVariables) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: readFunctionGraph'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/save-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/save-graph.ts new file mode 100644 index 0000000000..b6046724f1 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/save-graph.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation saveGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SaveGraphVariables } from '../../orm/mutation'; +import type { SaveGraphPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('save-graph - saveGraph\n\nUsage: save-graph [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .saveGraph( + parsedAnswers as unknown as SaveGraphVariables, + { + select: selectFields, + } as unknown as { + select: SaveGraphPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: saveGraph'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/secret-definition.ts b/sdk/constructive-cli/src/compute/cli/commands/secret-definition.ts new file mode 100644 index 0000000000..efaa11c98e --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/secret-definition.ts @@ -0,0 +1,371 @@ +/** + * CLI commands for SecretDefinition + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateSecretDefinitionInput, + SecretDefinitionPatch, + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + createdAt: 'string', + updatedAt: 'string', + name: 'string', + description: 'string', + isBuiltIn: 'boolean', + labels: 'json', + annotations: 'json', + databaseId: 'uuid', +}; +const usage = + '\nsecret-definition \n\nCommands:\n list List secretDefinition records\n find-first Find first matching secretDefinition record\n get Get a secretDefinition by ID\n create Create a new secretDefinition\n update Update an existing secretDefinition\n delete Delete a secretDefinition\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + isBuiltIn: true, + labels: true, + annotations: true, + databaseId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: SecretDefinitionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.secretDefinition.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + isBuiltIn: true, + labels: true, + annotations: true, + databaseId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: SecretDefinitionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.secretDefinition.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.secretDefinition + .findOne({ + id: answers.id as string, + select: { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + isBuiltIn: true, + labels: true, + annotations: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBuiltIn', + message: 'isBuiltIn', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateSecretDefinitionInput['secretDefinition']; + const client = getClient(); + const result = await client.secretDefinition + .create({ + data: { + name: cleanedData.name, + description: cleanedData.description, + isBuiltIn: cleanedData.isBuiltIn, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + isBuiltIn: true, + labels: true, + annotations: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBuiltIn', + message: 'isBuiltIn', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as SecretDefinitionPatch; + const client = getClient(); + const result = await client.secretDefinition + .update({ + where: { + id: answers.id as string, + }, + data: { + name: cleanedData.name, + description: cleanedData.description, + isBuiltIn: cleanedData.isBuiltIn, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + databaseId: cleanedData.databaseId, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + isBuiltIn: true, + labels: true, + annotations: true, + databaseId: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.secretDefinition + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/compute/cli/commands/set-data-at-path.ts b/sdk/constructive-cli/src/compute/cli/commands/set-data-at-path.ts new file mode 100644 index 0000000000..a815197cd6 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/set-data-at-path.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation setDataAtPath + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { SetDataAtPathVariables } from '../../orm/mutation'; +import type { SetDataAtPathPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('set-data-at-path - setDataAtPath\n\nUsage: set-data-at-path [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .setDataAtPath( + parsedAnswers as unknown as SetDataAtPathVariables, + { + select: selectFields, + } as unknown as { + select: SetDataAtPathPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: setDataAtPath'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/start-execution.ts b/sdk/constructive-cli/src/compute/cli/commands/start-execution.ts new file mode 100644 index 0000000000..eca3cb7bb1 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/start-execution.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation startExecution + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { StartExecutionVariables } from '../../orm/mutation'; +import type { StartExecutionPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('start-execution - startExecution\n\nUsage: start-execution [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .startExecution( + parsedAnswers as unknown as StartExecutionVariables, + { + select: selectFields, + } as unknown as { + select: StartExecutionPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: startExecution'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/commands/validate-function-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/validate-function-graph.ts new file mode 100644 index 0000000000..95dff06bf9 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/commands/validate-function-graph.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation validateFunctionGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ValidateFunctionGraphVariables } from '../../orm/mutation'; +import type { ValidateFunctionGraphPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'validate-function-graph - validateFunctionGraph\n\nUsage: validate-function-graph [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .validateFunctionGraph( + parsedAnswers as unknown as ValidateFunctionGraphVariables, + { + select: selectFields, + } as unknown as { + select: ValidateFunctionGraphPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: validateFunctionGraph'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/compute/cli/executor.ts b/sdk/constructive-cli/src/compute/cli/executor.ts new file mode 100644 index 0000000000..50d150bce8 --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/executor.ts @@ -0,0 +1,34 @@ +/** + * Executor and config store for CLI + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); +export const getStore = () => store; +export function getClient(contextName?: string) { + let ctx = null; + if (contextName) { + ctx = store.loadContext(contextName); + if (!ctx) { + throw new Error(`Context "${contextName}" not found.`); + } + } else { + ctx = store.getCurrentContext(); + if (!ctx) { + throw new Error('No active context. Run "context create" or "context use" first.'); + } + } + const headers: Record = {}; + if (store.hasValidCredentials(ctx.name)) { + const creds = store.getCredentials(ctx.name); + if (creds?.token) { + headers.Authorization = `Bearer ${creds.token}`; + } + } + return createClient({ + endpoint: ctx.endpoint, + headers: headers, + }); +} diff --git a/sdk/constructive-cli/src/compute/cli/index.ts b/sdk/constructive-cli/src/compute/cli/index.ts new file mode 100644 index 0000000000..9ca839a9ee --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/index.ts @@ -0,0 +1,29 @@ +/** + * CLI entry point + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLI, CLIOptions, getPackageJson } from 'inquirerer'; +import { commands } from './commands'; + +if (process.argv.includes('--version') || process.argv.includes('-v')) { + const pkg = getPackageJson(__dirname); + console.log(pkg.version); + process.exit(0); +} + +// Check for --tty false or --no-tty to enable non-interactive mode (noTty) +const ttyIdx = process.argv.indexOf('--tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); + +const options: Partial = { + noTty, + minimistOpts: { alias: { v: 'version', h: 'help' } }, +}; + +const app = new CLI(commands, options); +app.run().catch((e) => { + console.error('Unexpected error:', e); + process.exit(1); +}); diff --git a/sdk/constructive-cli/src/compute/cli/utils.ts b/sdk/constructive-cli/src/compute/cli/utils.ts new file mode 100644 index 0000000000..78a7defb6f --- /dev/null +++ b/sdk/constructive-cli/src/compute/cli/utils.ts @@ -0,0 +1,314 @@ +/** + * CLI utility functions for type coercion and input handling + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import objectPath from 'nested-obj'; + +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; + +export interface FieldSchema { + [fieldName: string]: FieldType; +} + +/** + * Coerce CLI string arguments to their proper GraphQL types based on a field schema. + * CLI args always arrive as strings from minimist, but GraphQL expects + * Boolean, Int, Float, JSON, etc. + */ +export function coerceAnswers( + answers: Record, + schema: FieldSchema +): Record { + const result: Record = { ...answers }; + + for (const [key, value] of Object.entries(result)) { + const fieldType = schema[key]; + if (!fieldType || value === undefined || value === null) continue; + + const strValue = String(value); + + // Empty strings become undefined for non-string types + if (strValue === '' && fieldType !== 'string') { + result[key] = undefined; + continue; + } + + switch (fieldType) { + case 'boolean': + if (typeof value === 'boolean') break; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; + break; + case 'int': + if (typeof value === 'number') break; + { + const parsed = parseInt(strValue, 10); + result[key] = isNaN(parsed) ? undefined : parsed; + } + break; + case 'float': + if (typeof value === 'number') break; + { + const parsed = parseFloat(strValue); + result[key] = isNaN(parsed) ? undefined : parsed; + } + break; + case 'json': + if (typeof value === 'object') break; + if (strValue === '') { + result[key] = undefined; + } else { + try { + result[key] = JSON.parse(strValue); + } catch { + result[key] = undefined; + } + } + break; + case 'uuid': + // Empty UUIDs become undefined + if (strValue === '') { + result[key] = undefined; + } + break; + case 'enum': + // Enums stay as strings but empty ones become undefined + if (strValue === '') { + result[key] = undefined; + } + break; + default: + // String type: empty strings also become undefined to avoid + // sending empty strings for optional fields + if (strValue === '') { + result[key] = undefined; + } + break; + } + } + + return result; +} + +/** + * Strip undefined values and filter to only schema-defined keys. + * This removes extra fields injected by minimist (like _, tty, etc.) + * and any fields that were coerced to undefined. + */ +export function stripUndefined( + obj: Record, + schema?: FieldSchema +): Record { + const result: Record = {}; + const allowedKeys = schema ? new Set(Object.keys(schema)) : null; + + for (const [key, value] of Object.entries(obj)) { + if (value === undefined) continue; + if (allowedKeys && !allowedKeys.has(key)) continue; + result[key] = value; + } + + return result; +} + +/** + * Parse mutation input from CLI. + * Custom mutation commands receive an `input` field as a JSON string + * from the CLI prompt. This parses it into a proper object. + */ +export function parseMutationInput(answers: Record): Record { + if (typeof answers.input === 'string') { + try { + const parsed = JSON.parse(answers.input); + return { ...answers, input: parsed }; + } catch { + return answers; + } + } + return answers; +} + +/** + * Reconstruct nested objects from dot-notation CLI answers. + * When INPUT_OBJECT args are flattened to dot-notation questions + * (e.g. `--input.email foo --input.password bar`), this function + * rebuilds the nested structure expected by the ORM: + * + * { 'input.email': 'foo', 'input.password': 'bar' } + * → { input: { email: 'foo', password: 'bar' } } + * + * Non-dotted keys are passed through unchanged. + * Uses `nested-obj` for safe nested property setting. + */ +export function unflattenDotNotation(answers: Record): Record { + const result: Record = {}; + + for (const [key, value] of Object.entries(answers)) { + if (key.includes('.')) { + objectPath.set(result, key, value); + } else { + result[key] = value; + } + } + + return result; +} + +/** + * Build a select object from a comma-separated list of dot-notation paths. + * Uses `nested-obj` to parse paths like 'clientMutationId,result.accessToken,result.userId' + * into the nested structure expected by the ORM: + * + * { clientMutationId: true, result: { select: { accessToken: true, userId: true } } } + * + * Paths without dots set the key to `true` (scalar select). + * Paths with dots create nested `{ select: { ... } }` wrappers, matching the + * ORM's expected structure for OBJECT sub-fields (e.g. `SignUpPayloadSelect.result`). + * + * @param paths - Comma-separated dot-notation field paths (e.g. 'clientMutationId,result.accessToken') + * @returns The nested select object for the ORM + */ +/** + * Parse a CLI flag as an integer. + * Handles minimist delivering numbers or strings depending on the input. + * Returns undefined when the flag is missing or not a valid number. + */ +export function parseIntFlag(argv: Record, name: string): number | undefined { + const val = argv[name]; + if (typeof val === 'number') return val; + if (typeof val === 'string') { + const n = parseInt(val, 10); + return isNaN(n) ? undefined : n; + } + return undefined; +} + +/** + * Parse a CLI flag as a string. + * Returns undefined when the flag is missing or not a string. + */ +export function parseStringFlag(argv: Record, name: string): string | undefined { + const val = argv[name]; + return typeof val === 'string' ? val : undefined; +} + +/** + * Parse --orderBy flag as a comma-separated list of enum values. + * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] + */ +export function parseOrderByFlag(argv: Record): string[] | undefined { + const val = argv.orderBy; + return typeof val === 'string' ? val.split(',') : undefined; +} + +/** + * Parse --select flag into a select object, falling back to a default. + * e.g. --select id,name → { id: true, name: true } + */ +export function parseSelectFlag( + argv: Record, + defaultSelect: Record +): Record { + const raw = argv.select; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; +} + +/** + * Build the full findManyArgs object from CLI argv. + * Parses all pagination, filtering, ordering, and field selection flags + * in one call. Accepts an optional `extraWhere` to merge with dot-notation + * --where flags (used by the search handler to inject search clauses). + * + * @example + * const findManyArgs = parseFindManyArgs(argv, { id: true, name: true }); + * const result = await client.user.findMany(findManyArgs).execute(); + */ +export function parseFindManyArgs>( + argv: Record, + defaultSelect: Record, + extraWhere?: Record +): T { + const limit = parseIntFlag(argv, 'limit'); + const last = parseIntFlag(argv, 'last'); + const offset = parseIntFlag(argv, 'offset'); + const after = parseStringFlag(argv, 'after'); + const before = parseStringFlag(argv, 'before'); + const select = parseSelectFlag(argv, defaultSelect); + const parsed = unflattenDotNotation(argv); + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; + const orderBy = parseOrderByFlag(argv); + + return { + select, + ...(limit !== undefined ? { first: limit } : {}), + ...(after !== undefined ? { after } : {}), + ...(last !== undefined ? { last } : {}), + ...(before !== undefined ? { before } : {}), + ...(offset !== undefined ? { offset } : {}), + ...(where !== undefined ? { where } : {}), + ...(orderBy !== undefined ? { orderBy } : {}), + } as unknown as T; +} + +/** + * Build findFirst args from CLI argv. + * Like parseFindManyArgs but without pagination flags (no limit/offset/after/before/last) + * — findFirst returns the first matching record. Supports select, where, and orderBy. + */ +export function parseFindFirstArgs>( + argv: Record, + defaultSelect: Record +): T { + const select = parseSelectFlag(argv, defaultSelect); + const parsed = unflattenDotNotation(argv); + const where = parsed.where; + const orderBy = parseOrderByFlag(argv); + + return { + select, + ...(where !== undefined ? { where } : {}), + ...(orderBy !== undefined ? { orderBy } : {}), + } as unknown as T; +} + +export function buildSelectFromPaths(paths: string): Record { + const result: Record = {}; + const trimmedPaths = paths + .split(',') + .map((p) => p.trim()) + .filter((p) => p.length > 0); + + for (const path of trimmedPaths) { + if (!path.includes('.')) { + // Simple scalar field: clientMutationId -> { clientMutationId: true } + result[path] = true; + } else { + // Nested path: result.accessToken -> { result: { select: { accessToken: true } } } + // Convert dot-notation to ORM's { select: { ... } } nesting pattern + const parts = path.split('.'); + let current = result; + for (let i = 0; i < parts.length; i++) { + const part = parts[i]; + if (i === parts.length - 1) { + // Leaf node: set to true + objectPath.set(current, part, true); + } else { + // Intermediate node: ensure { select: { ... } } wrapper exists + if (!current[part] || typeof current[part] !== 'object') { + current[part] = { select: {} }; + } + const wrapper = current[part] as Record; + if (!wrapper.select || typeof wrapper.select !== 'object') { + wrapper.select = {}; + } + current = wrapper.select as Record; + } + } + } + } + + return result; +} diff --git a/sdk/constructive-cli/src/compute/index.ts b/sdk/constructive-cli/src/compute/index.ts new file mode 100644 index 0000000000..df67cba476 --- /dev/null +++ b/sdk/constructive-cli/src/compute/index.ts @@ -0,0 +1,6 @@ +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/compute/orm/README.md b/sdk/constructive-cli/src/compute/orm/README.md new file mode 100644 index 0000000000..c266bdfcb7 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/README.md @@ -0,0 +1,986 @@ +# ORM Client + +

+ +

+ + + +## Setup + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); +``` + +## Models + +| Model | Operations | +|-------|------------| +| `getAllRecord` | findMany, findOne, create, update, delete | +| `functionApiBinding` | findMany, findOne, create, update, delete | +| `functionDeployment` | findMany, findOne, create, update, delete | +| `functionGraphRef` | findMany, findOne, create, update, delete | +| `functionGraphStore` | findMany, findOne, create, update, delete | +| `functionGraphObject` | findMany, findOne, create, update, delete | +| `functionDeploymentEvent` | findMany, findOne, create, update, delete | +| `orgFunctionExecutionLog` | findMany, findOne, create, update, delete | +| `functionGraphExecutionOutput` | findMany, findOne, create, update, delete | +| `functionGraphCommit` | findMany, findOne, create, update, delete | +| `secretDefinition` | findMany, findOne, create, update, delete | +| `functionExecutionLog` | findMany, findOne, create, update, delete | +| `functionGraphExecutionNodeState` | findMany, findOne, create, update, delete | +| `functionGraph` | findMany, findOne, create, update, delete | +| `orgFunctionInvocation` | findMany, findOne, create, update, delete | +| `functionInvocation` | findMany, findOne, create, update, delete | +| `functionGraphExecution` | findMany, findOne, create, update, delete | +| `functionDefinition` | findMany, findOne, create, update, delete | + +## Table Operations + +### `db.getAllRecord` + +CRUD operations for GetAllRecord records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `path` | String | Yes | +| `data` | JSON | Yes | + +**Operations:** + +```typescript +// List all getAllRecord records +const items = await db.getAllRecord.findMany({ select: { path: true, data: true } }).execute(); + +// Get one by id +const item = await db.getAllRecord.findOne({ id: '', select: { path: true, data: true } }).execute(); + +// Create +const created = await db.getAllRecord.create({ data: { path: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.getAllRecord.update({ where: { id: '' }, data: { path: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.getAllRecord.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionApiBinding` + +CRUD operations for FunctionApiBinding records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `functionDefinitionId` | UUID | Yes | +| `apiId` | UUID | Yes | +| `alias` | String | Yes | +| `config` | JSON | Yes | + +**Operations:** + +```typescript +// List all functionApiBinding records +const items = await db.functionApiBinding.findMany({ select: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }).execute(); + +// Get one by id +const item = await db.functionApiBinding.findOne({ id: '', select: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }).execute(); + +// Create +const created = await db.functionApiBinding.create({ data: { functionDefinitionId: '', apiId: '', alias: '', config: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionApiBinding.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionApiBinding.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDeployment` + +CRUD operations for FunctionDeployment records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `functionDefinitionId` | UUID | Yes | +| `namespaceId` | UUID | Yes | +| `status` | String | Yes | +| `serviceUrl` | String | Yes | +| `serviceName` | String | Yes | +| `revision` | Int | Yes | +| `image` | String | Yes | +| `concurrency` | Int | Yes | +| `scaleMin` | Int | Yes | +| `scaleMax` | Int | Yes | +| `timeoutSeconds` | Int | Yes | +| `resources` | JSON | Yes | +| `lastError` | String | Yes | +| `lastErrorAt` | Datetime | Yes | +| `errorCount` | Int | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionDeployment records +const items = await db.functionDeployment.findMany({ select: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionDeployment.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionDeployment.create({ data: { functionDefinitionId: '', namespaceId: '', status: '', serviceUrl: '', serviceName: '', revision: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', lastError: '', lastErrorAt: '', errorCount: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeployment.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeployment.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphRef` + +CRUD operations for FunctionGraphRef records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `name` | String | Yes | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `commitId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionGraphRef records +const items = await db.functionGraphRef.findMany({ select: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }).execute(); + +// Get one by id +const item = await db.functionGraphRef.findOne({ id: '', select: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }).execute(); + +// Create +const created = await db.functionGraphRef.create({ data: { name: '', databaseId: '', storeId: '', commitId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphRef.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphRef.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphStore` + +CRUD operations for FunctionGraphStore records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `name` | String | Yes | +| `databaseId` | UUID | Yes | +| `hash` | UUID | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraphStore records +const items = await db.functionGraphStore.findMany({ select: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraphStore.findOne({ id: '', select: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }).execute(); + +// Create +const created = await db.functionGraphStore.create({ data: { name: '', databaseId: '', hash: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphStore.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphStore.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphObject` + +CRUD operations for FunctionGraphObject records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `kids` | UUID | Yes | +| `ktree` | String | Yes | +| `data` | JSON | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraphObject records +const items = await db.functionGraphObject.findMany({ select: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraphObject.findOne({ id: '', select: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }).execute(); + +// Create +const created = await db.functionGraphObject.create({ data: { databaseId: '', kids: '', ktree: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphObject.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphObject.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDeploymentEvent` + +CRUD operations for FunctionDeploymentEvent records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `deploymentId` | UUID | Yes | +| `eventType` | String | Yes | +| `actorId` | UUID | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionDeploymentEvent records +const items = await db.functionDeploymentEvent.findMany({ select: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionDeploymentEvent.findOne({ id: '', select: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionDeploymentEvent.create({ data: { deploymentId: '', eventType: '', actorId: '', message: '', metadata: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeploymentEvent.update({ where: { id: '' }, data: { deploymentId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeploymentEvent.delete({ where: { id: '' } }).execute(); +``` + +### `db.orgFunctionExecutionLog` + +CRUD operations for OrgFunctionExecutionLog records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `invocationId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `logLevel` | String | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `actorId` | UUID | Yes | + +**Operations:** + +```typescript +// List all orgFunctionExecutionLog records +const items = await db.orgFunctionExecutionLog.findMany({ select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }).execute(); + +// Get one by id +const item = await db.orgFunctionExecutionLog.findOne({ id: '', select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }).execute(); + +// Create +const created = await db.orgFunctionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgFunctionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgFunctionExecutionLog.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecutionOutput` + +CRUD operations for FunctionGraphExecutionOutput records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `hash` | Base64EncodedBinary | Yes | +| `data` | JSON | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecutionOutput records +const items = await db.functionGraphExecutionOutput.findMany({ select: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecutionOutput.findOne({ id: '', select: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }).execute(); + +// Create +const created = await db.functionGraphExecutionOutput.create({ data: { databaseId: '', hash: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecutionOutput.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecutionOutput.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphCommit` + +CRUD operations for FunctionGraphCommit records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `message` | String | Yes | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `parentIds` | UUID | Yes | +| `authorId` | UUID | Yes | +| `committerId` | UUID | Yes | +| `treeId` | UUID | Yes | +| `date` | Datetime | Yes | + +**Operations:** + +```typescript +// List all functionGraphCommit records +const items = await db.functionGraphCommit.findMany({ select: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }).execute(); + +// Get one by id +const item = await db.functionGraphCommit.findOne({ id: '', select: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }).execute(); + +// Create +const created = await db.functionGraphCommit.create({ data: { message: '', databaseId: '', storeId: '', parentIds: '', authorId: '', committerId: '', treeId: '', date: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphCommit.update({ where: { id: '' }, data: { message: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphCommit.delete({ where: { id: '' } }).execute(); +``` + +### `db.secretDefinition` + +CRUD operations for SecretDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `name` | String | Yes | +| `description` | String | Yes | +| `isBuiltIn` | Boolean | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all secretDefinition records +const items = await db.secretDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.secretDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Create +const created = await db.secretDefinition.create({ data: { name: '', description: '', isBuiltIn: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.secretDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.secretDefinition.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionExecutionLog` + +CRUD operations for FunctionExecutionLog records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `invocationId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `logLevel` | String | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `actorId` | UUID | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionExecutionLog records +const items = await db.functionExecutionLog.findMany({ select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionExecutionLog.findOne({ id: '', select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionExecutionLog.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecutionNodeState` + +CRUD operations for FunctionGraphExecutionNodeState records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `executionId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `nodeName` | String | Yes | +| `nodePath` | String | Yes | +| `status` | String | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `errorCode` | String | Yes | +| `errorMessage` | String | Yes | +| `outputId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecutionNodeState records +const items = await db.functionGraphExecutionNodeState.findMany({ select: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecutionNodeState.findOne({ id: '', select: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }).execute(); + +// Create +const created = await db.functionGraphExecutionNodeState.create({ data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraph` + +CRUD operations for FunctionGraph records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `context` | String | Yes | +| `name` | String | Yes | +| `description` | String | Yes | +| `definitionsCommitId` | UUID | Yes | +| `isValid` | Boolean | Yes | +| `validationErrors` | JSON | Yes | +| `createdBy` | UUID | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraph records +const items = await db.functionGraph.findMany({ select: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraph.findOne({ id: '', select: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }).execute(); + +// Create +const created = await db.functionGraph.create({ data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); +``` + +### `db.orgFunctionInvocation` + +CRUD operations for OrgFunctionInvocation records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `actorId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `payload` | JSON | Yes | +| `status` | String | Yes | +| `result` | JSON | Yes | +| `error` | String | Yes | +| `durationMs` | Int | Yes | +| `jobId` | BigInt | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `parentInvocationId` | UUID | Yes | +| `graphExecutionId` | UUID | Yes | + +**Operations:** + +```typescript +// List all orgFunctionInvocation records +const items = await db.orgFunctionInvocation.findMany({ select: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Get one by id +const item = await db.orgFunctionInvocation.findOne({ id: '', select: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Create +const created = await db.orgFunctionInvocation.create({ data: { actorId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgFunctionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgFunctionInvocation.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionInvocation` + +CRUD operations for FunctionInvocation records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `actorId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `payload` | JSON | Yes | +| `status` | String | Yes | +| `result` | JSON | Yes | +| `error` | String | Yes | +| `durationMs` | Int | Yes | +| `jobId` | BigInt | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `parentInvocationId` | UUID | Yes | +| `graphExecutionId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionInvocation records +const items = await db.functionInvocation.findMany({ select: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Get one by id +const item = await db.functionInvocation.findOne({ id: '', select: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Create +const created = await db.functionInvocation.create({ data: { actorId: '', databaseId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionInvocation.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecution` + +CRUD operations for FunctionGraphExecution records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `startedAt` | Datetime | Yes | +| `id` | UUID | No | +| `graphId` | UUID | Yes | +| `invocationId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `outputNode` | String | Yes | +| `outputPort` | String | Yes | +| `status` | String | Yes | +| `inputPayload` | JSON | Yes | +| `outputPayload` | JSON | Yes | +| `nodeOutputs` | JSON | Yes | +| `executionPlan` | JSON | Yes | +| `currentWave` | Int | Yes | +| `parentExecutionId` | UUID | Yes | +| `parentNodeName` | String | Yes | +| `definitionsCommitId` | UUID | Yes | +| `tickCount` | Int | Yes | +| `completedAt` | Datetime | Yes | +| `maxTicks` | Int | Yes | +| `maxPendingJobs` | Int | Yes | +| `timeoutAt` | Datetime | Yes | +| `errorCode` | String | Yes | +| `errorMessage` | String | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecution records +const items = await db.functionGraphExecution.findMany({ select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecution.findOne({ id: '', select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }).execute(); + +// Create +const created = await db.functionGraphExecution.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', entityId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecution.update({ where: { id: '' }, data: { startedAt: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecution.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDefinition` + +CRUD operations for FunctionDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `scope` | String | Yes | +| `name` | String | Yes | +| `taskIdentifier` | String | Yes | +| `description` | String | Yes | +| `isInvocable` | Boolean | Yes | +| `maxAttempts` | Int | Yes | +| `priority` | Int | Yes | +| `queueName` | String | Yes | +| `runtime` | String | Yes | +| `image` | String | Yes | +| `concurrency` | Int | Yes | +| `scaleMin` | Int | Yes | +| `scaleMax` | Int | Yes | +| `timeoutSeconds` | Int | Yes | +| `resources` | JSON | Yes | +| `isBuiltIn` | Boolean | Yes | +| `requiredSecrets` | FunctionRequirement | Yes | +| `requiredConfigs` | FunctionRequirement | Yes | +| `requiredBuckets` | String | Yes | +| `requiredModels` | String | Yes | +| `inputs` | JSON | Yes | +| `outputs` | JSON | Yes | +| `props` | JSON | Yes | +| `volatile` | Boolean | Yes | +| `icon` | String | Yes | +| `category` | String | Yes | + +**Operations:** + +```typescript +// List all functionDefinition records +const items = await db.functionDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }).execute(); + +// Get one by id +const item = await db.functionDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }).execute(); + +// Create +const created = await db.functionDefinition.create({ data: { scope: '', name: '', taskIdentifier: '', description: '', isInvocable: '', maxAttempts: '', priority: '', queueName: '', runtime: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', isBuiltIn: '', requiredSecrets: '', requiredConfigs: '', requiredBuckets: '', requiredModels: '', inputs: '', outputs: '', props: '', volatile: '', icon: '', category: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDefinition.update({ where: { id: '' }, data: { scope: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDefinition.delete({ where: { id: '' } }).execute(); +``` + +## Custom Operations + +### `db.query.readFunctionGraph` + +readFunctionGraph + +- **Type:** query +- **Arguments:** + + | Argument | Type | + |----------|------| + | `graphId` | UUID | + +```typescript +const result = await db.query.readFunctionGraph({ graphId: '' }).execute(); +``` + +### `db.mutation.validateFunctionGraph` + +validateFunctionGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ValidateFunctionGraphInput (required) | + +```typescript +const result = await db.mutation.validateFunctionGraph({ input: { graphId: '' } }).execute(); +``` + +### `db.mutation.initEmptyRepo` + +initEmptyRepo + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InitEmptyRepoInput (required) | + +```typescript +const result = await db.mutation.initEmptyRepo({ input: { sId: '', storeId: '' } }).execute(); +``` + +### `db.mutation.setDataAtPath` + +setDataAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SetDataAtPathInput (required) | + +```typescript +const result = await db.mutation.setDataAtPath({ input: { sId: '', root: '', path: '', data: '' } }).execute(); +``` + +### `db.mutation.importDefinitions` + +importDefinitions + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportDefinitionsInput (required) | + +```typescript +const result = await db.mutation.importDefinitions({ input: { graphId: '', sourceScopeId: '', sourceCommitId: '', contexts: '' } }).execute(); +``` + +### `db.mutation.copyGraph` + +copyGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CopyGraphInput (required) | + +```typescript +const result = await db.mutation.copyGraph({ input: { databaseId: '', graphId: '', name: '' } }).execute(); +``` + +### `db.mutation.saveGraph` + +saveGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SaveGraphInput (required) | + +```typescript +const result = await db.mutation.saveGraph({ input: { graphId: '', rootHash: '', message: '' } }).execute(); +``` + +### `db.mutation.addEdgeAndSave` + +addEdgeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeAndSaveInput (required) | + +```typescript +const result = await db.mutation.addEdgeAndSave({ input: '' }).execute(); +``` + +### `db.mutation.addNodeAndSave` + +addNodeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeAndSaveInput (required) | + +```typescript +const result = await db.mutation.addNodeAndSave({ input: '' }).execute(); +``` + +### `db.mutation.addEdge` + +addEdge + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeInput (required) | + +```typescript +const result = await db.mutation.addEdge({ input: '' }).execute(); +``` + +### `db.mutation.addNode` + +addNode + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeInput (required) | + +```typescript +const result = await db.mutation.addNode({ input: '' }).execute(); +``` + +### `db.mutation.importGraphJson` + +importGraphJson + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportGraphJsonInput (required) | + +```typescript +const result = await db.mutation.importGraphJson({ input: '' }).execute(); +``` + +### `db.mutation.insertNodeAtPath` + +insertNodeAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InsertNodeAtPathInput (required) | + +```typescript +const result = await db.mutation.insertNodeAtPath({ input: '' }).execute(); +``` + +### `db.mutation.startExecution` + +startExecution + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | StartExecutionInput (required) | + +```typescript +const result = await db.mutation.startExecution({ input: '' }).execute(); +``` + +### `db.mutation.provisionBucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-cli/src/compute/orm/client.ts b/sdk/constructive-cli/src/compute/orm/client.ts new file mode 100644 index 0000000000..16e683c712 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/client.ts @@ -0,0 +1,244 @@ +/** + * ORM Client - Runtime GraphQL executor + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; +import { createFetch } from '@constructive-io/graphql-query/runtime'; + +import type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + Unsubscribe, +} from './realtime'; +import { RealtimeManager } from './realtime'; + +export type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; + +export type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + SubscriptionOperation, + Unsubscribe, + WsClient, +} from './realtime'; +export { RealtimeManager } from './realtime'; + +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +export class FetchAdapter implements GraphQLAdapter { + private headers: Record; + private fetchFn: typeof globalThis.fetch; + + constructor( + private endpoint: string, + headers?: Record, + fetchFn?: typeof globalThis.fetch + ) { + this.headers = headers ?? {}; + this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); + } + + async execute(document: string, variables?: Record): Promise> { + const response = await this.fetchFn(this.endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + ...this.headers, + }, + body: JSON.stringify({ + query: document, + variables: variables ?? {}, + }), + }); + + if (!response.ok) { + return { + ok: false, + data: null, + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], + }; + } + + const json = (await response.json()) as { + data?: T; + errors?: GraphQLError[]; + }; + + if (json.errors && json.errors.length > 0) { + return { + ok: false, + data: null, + errors: json.errors, + }; + } + + return { + ok: true, + data: json.data as T, + errors: undefined, + }; + } + + setHeaders(headers: Record): void { + this.headers = { ...this.headers, ...headers }; + } + + getEndpoint(): string { + return this.endpoint; + } +} + +/** + * Configuration for creating an ORM client. + * Either provide endpoint (and optional headers/fetch) for HTTP requests, + * or provide a custom adapter for alternative execution strategies. + */ +export interface OrmClientConfig { + /** GraphQL endpoint URL (required if adapter not provided) */ + endpoint?: string; + /** Default headers for HTTP requests (only used with endpoint) */ + headers?: Record; + /** + * Custom fetch implementation. Defaults to createFetch() from + * @constructive-io/graphql-query/runtime which handles *.localhost + * DNS and Host headers in Node.js. Pass your own for test mocking + * or custom proxy/credentials. + */ + fetch?: typeof globalThis.fetch; + /** Custom adapter for GraphQL execution (overrides endpoint/headers/fetch) */ + adapter?: GraphQLAdapter; + /** + * Optional realtime (WebSocket) configuration. + * When provided, enables subscription methods on models. + * The WebSocket connection is created lazily on first subscribe(). + */ + realtime?: RealtimeConfig; +} + +/** + * Error thrown when GraphQL request fails + */ +export class GraphQLRequestError extends Error { + constructor( + public readonly errors: GraphQLError[], + public readonly data: unknown = null + ) { + const messages = errors.map((e) => e.message).join('; '); + super(`GraphQL Error: ${messages}`); + this.name = 'GraphQLRequestError'; + } +} + +export class OrmClient { + private adapter: GraphQLAdapter; + private realtimeManager?: RealtimeManager; + + constructor(config: OrmClientConfig) { + if (config.adapter) { + this.adapter = config.adapter; + } else if (config.endpoint) { + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); + } else { + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); + } + + if (config.realtime) { + this.realtimeManager = new RealtimeManager(config.realtime); + } + } + + async execute(document: string, variables?: Record): Promise> { + return this.adapter.execute(document, variables); + } + + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + if (!this.realtimeManager) { + throw new Error( + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' + ); + } + return this.realtimeManager.subscribe(meta, document, variables, options); + } + + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers: Record): void { + if (this.adapter.setHeaders) { + this.adapter.setHeaders(headers); + } + } + + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint(): string { + return this.adapter.getEndpoint?.() ?? ''; + } + + /** Get current WebSocket connection state */ + getConnectionState(): ConnectionState { + return this.realtimeManager?.getConnectionState() ?? 'disconnected'; + } + + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + if (!this.realtimeManager) return () => {}; + return this.realtimeManager.onConnectionStateChange(listener); + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.realtimeManager?.getActiveSubscriptionCount() ?? 0; + } + + /** Whether realtime is configured */ + get isRealtimeEnabled(): boolean { + return this.realtimeManager !== undefined; + } + + /** Dispose the realtime manager (close WebSocket) */ + dispose(): void { + this.realtimeManager?.dispose(); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/index.ts b/sdk/constructive-cli/src/compute/orm/index.ts new file mode 100644 index 0000000000..99193c1d28 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/index.ts @@ -0,0 +1,82 @@ +/** + * ORM Client - createClient factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { GetAllRecordModel } from './models/getAllRecord'; +import { FunctionApiBindingModel } from './models/functionApiBinding'; +import { FunctionDeploymentModel } from './models/functionDeployment'; +import { FunctionGraphRefModel } from './models/functionGraphRef'; +import { FunctionGraphStoreModel } from './models/functionGraphStore'; +import { FunctionGraphObjectModel } from './models/functionGraphObject'; +import { FunctionDeploymentEventModel } from './models/functionDeploymentEvent'; +import { OrgFunctionExecutionLogModel } from './models/orgFunctionExecutionLog'; +import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecutionOutput'; +import { FunctionGraphCommitModel } from './models/functionGraphCommit'; +import { SecretDefinitionModel } from './models/secretDefinition'; +import { FunctionExecutionLogModel } from './models/functionExecutionLog'; +import { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; +import { FunctionGraphModel } from './models/functionGraph'; +import { OrgFunctionInvocationModel } from './models/orgFunctionInvocation'; +import { FunctionInvocationModel } from './models/functionInvocation'; +import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; +import { FunctionDefinitionModel } from './models/functionDefinition'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +export function createClient(config: OrmClientConfig) { + const client = new OrmClient(config); + return { + getAllRecord: new GetAllRecordModel(client), + functionApiBinding: new FunctionApiBindingModel(client), + functionDeployment: new FunctionDeploymentModel(client), + functionGraphRef: new FunctionGraphRefModel(client), + functionGraphStore: new FunctionGraphStoreModel(client), + functionGraphObject: new FunctionGraphObjectModel(client), + functionDeploymentEvent: new FunctionDeploymentEventModel(client), + orgFunctionExecutionLog: new OrgFunctionExecutionLogModel(client), + functionGraphExecutionOutput: new FunctionGraphExecutionOutputModel(client), + functionGraphCommit: new FunctionGraphCommitModel(client), + secretDefinition: new SecretDefinitionModel(client), + functionExecutionLog: new FunctionExecutionLogModel(client), + functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), + functionGraph: new FunctionGraphModel(client), + orgFunctionInvocation: new OrgFunctionInvocationModel(client), + functionInvocation: new FunctionInvocationModel(client), + functionGraphExecution: new FunctionGraphExecutionModel(client), + functionDefinition: new FunctionDefinitionModel(client), + query: createQueryOperations(client), + mutation: createMutationOperations(client), + }; +} diff --git a/sdk/constructive-cli/src/compute/orm/input-types.ts b/sdk/constructive-cli/src/compute/orm/input-types.ts new file mode 100644 index 0000000000..f88c3e77d1 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/input-types.ts @@ -0,0 +1,4706 @@ +/** + * GraphQL types for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// ============ Scalar Filter Types ============ +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: Record; + containedBy?: Record; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containsOrEqualTo?: string; + containedBy?: string; + containedByOrEqualTo?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +// ============ Custom Scalar Types ============ +export type Base64EncodedBinary = unknown; +export type FunctionRequirement = unknown; +// ============ Entity Types ============ +export interface GetAllRecord { + path?: string[] | null; + data?: Record | null; +} +/** Join table binding function definitions to API endpoints with per-binding alias and config */ +export interface FunctionApiBinding { + id: string; + /** Function definition this binding belongs to */ + functionDefinitionId?: string | null; + /** API endpoint this function is bound to */ + apiId?: string | null; + /** Binding alias (e.g. default, staging, production) */ + alias?: string | null; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: Record | null; +} +/** Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing */ +export interface FunctionDeployment { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Function definition being deployed to this namespace */ + functionDefinitionId?: string | null; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId?: string | null; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string | null; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string | null; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string | null; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number | null; + /** Container image override (NULL = inherit from function definition) */ + image?: string | null; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number | null; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number | null; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number | null; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number | null; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: Record | null; + /** Most recent provisioning or runtime error message */ + lastError?: string | null; + /** Timestamp of the most recent error */ + lastErrorAt?: string | null; + /** Cumulative error count for this deployment */ + errorCount?: number | null; + /** Key/value pairs for selecting and filtering deployments */ + labels?: Record | null; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Branch heads — mutable pointers into the commit chain */ +export interface FunctionGraphRef { + /** Unique ref identifier */ + id: string; + /** Ref name (e.g. HEAD, main) */ + name?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Store this ref belongs to */ + storeId?: string | null; + /** Commit this ref points to */ + commitId?: string | null; +} +/** Named stores — one per version-controlled tree (e.g. one graph, one definition set) */ +export interface FunctionGraphStore { + /** Unique store identifier */ + id: string; + /** Human-readable store name */ + name?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Current root object hash of this store */ + hash?: string | null; + /** Timestamp of store creation */ + createdAt?: string | null; +} +/** Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children */ +export interface FunctionGraphObject { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Ordered array of child object IDs */ + kids?: string[] | null; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[] | null; + /** Payload data for this object node */ + data?: Record | null; + /** Timestamp of object creation */ + createdAt?: string | null; +} +/** Deployment lifecycle events — audit log of provisioning, scaling, and failure events */ +export interface FunctionDeploymentEvent { + /** Event timestamp (partition key) */ + createdAt?: string | null; + /** Unique event identifier */ + id: string; + /** Deployment this event belongs to */ + deploymentId?: string | null; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType?: string | null; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string | null; + /** Human-readable description of the event */ + message?: string | null; + /** Structured context (old/new values, error details, etc.) */ + metadata?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Function execution logs — structured console output per invocation */ +export interface OrgFunctionExecutionLog { + /** Log entry timestamp (partition key) */ + createdAt?: string | null; + /** Unique log entry identifier */ + id: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string | null; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string | null; + /** Log severity: debug, info, warn, error */ + logLevel?: string | null; + /** Log message text */ + message?: string | null; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record | null; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string | null; +} +/** Content-addressed store for execution outputs — hash-referenced from node_outputs */ +export interface FunctionGraphExecutionOutput { + /** Timestamp of output creation */ + createdAt?: string | null; + /** Unique execution output identifier */ + id: string; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash?: Base64EncodedBinary | null; + /** The actual output payload from a completed node */ + data?: Record | null; +} +/** Commit history — each commit snapshots a tree root for a store */ +export interface FunctionGraphCommit { + /** Unique commit identifier */ + id: string; + /** Optional commit message */ + message?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Store this commit belongs to */ + storeId?: string | null; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[] | null; + /** User who authored the changes */ + authorId?: string | null; + /** User who committed (may differ from author) */ + committerId?: string | null; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string | null; + /** Commit timestamp */ + date?: string | null; +} +/** Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. */ +export interface SecretDefinition { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Secret name (must match app_secrets.name for resolution) */ + name?: string | null; + /** Human-readable description of what this secret is used for */ + description?: string | null; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean | null; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: Record | null; + /** Freeform metadata annotations for secret definitions */ + annotations?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Function execution logs — structured console output per invocation */ +export interface FunctionExecutionLog { + /** Log entry timestamp (partition key) */ + createdAt?: string | null; + /** Unique log entry identifier */ + id: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string | null; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string | null; + /** Log severity: debug, info, warn, error */ + logLevel?: string | null; + /** Log message text */ + message?: string | null; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record | null; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Per-node execution state — tracks individual node lifecycle for debugging */ +export interface FunctionGraphExecutionNodeState { + /** Timestamp of node state creation (partition key) */ + createdAt?: string | null; + /** Unique node state identifier */ + id: string; + /** FK to the parent graph execution */ + executionId?: string | null; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName?: string | null; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[] | null; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string | null; + /** Timestamp when the node began executing */ + startedAt?: string | null; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string | null; + /** Machine-readable error code when status = failed */ + errorCode?: string | null; + /** Human-readable error description when status = failed */ + errorMessage?: string | null; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string | null; +} +/** Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store */ +export interface FunctionGraph { + /** Unique graph identifier */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Graph store (Merkle store) holding the graph definition */ + storeId?: string | null; + /** Entity context (org/team) for scoped billing */ + entityId?: string | null; + /** Evaluator/runtime context (function, js, sql, system) */ + context?: string | null; + /** Graph name (unique per database) */ + name?: string | null; + /** Human-readable description of the graph */ + description?: string | null; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string | null; + /** Whether graph passes structural validation */ + isValid?: boolean | null; + /** Array of validation error objects when is_valid = false */ + validationErrors?: Record | null; + /** Actor who created this graph */ + createdBy?: string | null; + /** Timestamp of graph creation */ + createdAt?: string | null; + /** Timestamp of last modification */ + updatedAt?: string | null; +} +/** Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. */ +export interface OrgFunctionInvocation { + /** Invocation creation timestamp (partition key) */ + createdAt?: string | null; + /** Unique invocation identifier */ + id: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string | null; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string | null; + /** Function input payload */ + payload?: Record | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Function return value (success) or structured error (failure) */ + result?: Record | null; + /** Error message when status is failed */ + error?: string | null; + /** Wall-clock execution time in milliseconds */ + durationMs?: number | null; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string | null; + /** When execution started */ + startedAt?: string | null; + /** When execution completed */ + completedAt?: string | null; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string | null; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string | null; +} +/** Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. */ +export interface FunctionInvocation { + /** Invocation creation timestamp (partition key) */ + createdAt?: string | null; + /** Unique invocation identifier */ + id: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string | null; + /** Function input payload */ + payload?: Record | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Function return value (success) or structured error (failure) */ + result?: Record | null; + /** Error message when status is failed */ + error?: string | null; + /** Wall-clock execution time in milliseconds */ + durationMs?: number | null; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string | null; + /** When execution started */ + startedAt?: string | null; + /** When execution completed */ + completedAt?: string | null; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string | null; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string | null; +} +/** Ephemeral execution state for flow graph evaluation */ +export interface FunctionGraphExecution { + /** Execution start timestamp */ + startedAt?: string | null; + /** Unique execution identifier */ + id: string; + /** FK to the graph definition being executed */ + graphId?: string | null; + /** Parent function_invocations row (for metering) */ + invocationId?: string | null; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** Entity context (org/team) for scoped billing */ + entityId?: string | null; + /** Target output boundary node name to resolve */ + outputNode?: string | null; + /** Target output port name (default: value) */ + outputPort?: string | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Initial inputs provided at invocation time */ + inputPayload?: Record | null; + /** Final result extracted from terminal output node */ + outputPayload?: Record | null; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: Record | null; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: Record | null; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number | null; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string | null; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string | null; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string | null; + /** Number of evaluate_step ticks executed */ + tickCount?: number | null; + /** Execution completion timestamp */ + completedAt?: string | null; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number | null; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number | null; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string | null; + /** Machine-readable error code when status = failed */ + errorCode?: string | null; + /** Human-readable error description when status = failed */ + errorMessage?: string | null; +} +/** Function definitions — registered cloud functions with routing, queue, and retry configuration */ +export interface FunctionDefinition { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope?: string | null; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name?: string | null; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier?: string | null; + /** Human-readable description of what this function does */ + description?: string | null; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean | null; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number | null; + /** Job priority (lower = higher priority) */ + priority?: number | null; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string | null; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string | null; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string | null; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number | null; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number | null; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number | null; + /** Knative request timeout in seconds */ + timeoutSeconds?: number | null; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: Record | null; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean | null; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirement[] | null; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirement[] | null; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[] | null; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[] | null; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: Record | null; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: Record | null; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: Record | null; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean | null; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string | null; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string | null; +} +// ============ Relation Helper Types ============ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +// ============ Entity Relation Types ============ +export interface GetAllRecordRelations {} +export interface FunctionApiBindingRelations { + functionDefinition?: FunctionDefinition | null; +} +export interface FunctionDeploymentRelations { + functionDefinition?: FunctionDefinition | null; +} +export interface FunctionGraphRefRelations {} +export interface FunctionGraphStoreRelations {} +export interface FunctionGraphObjectRelations {} +export interface FunctionDeploymentEventRelations {} +export interface OrgFunctionExecutionLogRelations {} +export interface FunctionGraphExecutionOutputRelations {} +export interface FunctionGraphCommitRelations {} +export interface SecretDefinitionRelations {} +export interface FunctionExecutionLogRelations {} +export interface FunctionGraphExecutionNodeStateRelations {} +export interface FunctionGraphRelations {} +export interface OrgFunctionInvocationRelations {} +export interface FunctionInvocationRelations {} +export interface FunctionGraphExecutionRelations { + graph?: FunctionGraph | null; +} +export interface FunctionDefinitionRelations { + functionApiBindings?: ConnectionResult; + functionDeployments?: ConnectionResult; +} +// ============ Entity Types With Relations ============ +export type GetAllRecordWithRelations = GetAllRecord & GetAllRecordRelations; +export type FunctionApiBindingWithRelations = FunctionApiBinding & FunctionApiBindingRelations; +export type FunctionDeploymentWithRelations = FunctionDeployment & FunctionDeploymentRelations; +export type FunctionGraphRefWithRelations = FunctionGraphRef & FunctionGraphRefRelations; +export type FunctionGraphStoreWithRelations = FunctionGraphStore & FunctionGraphStoreRelations; +export type FunctionGraphObjectWithRelations = FunctionGraphObject & FunctionGraphObjectRelations; +export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & + FunctionDeploymentEventRelations; +export type OrgFunctionExecutionLogWithRelations = OrgFunctionExecutionLog & + OrgFunctionExecutionLogRelations; +export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & + FunctionGraphExecutionOutputRelations; +export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGraphCommitRelations; +export type SecretDefinitionWithRelations = SecretDefinition & SecretDefinitionRelations; +export type FunctionExecutionLogWithRelations = FunctionExecutionLog & + FunctionExecutionLogRelations; +export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & + FunctionGraphExecutionNodeStateRelations; +export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; +export type OrgFunctionInvocationWithRelations = OrgFunctionInvocation & + OrgFunctionInvocationRelations; +export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; +export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & + FunctionGraphExecutionRelations; +export type FunctionDefinitionWithRelations = FunctionDefinition & FunctionDefinitionRelations; +// ============ Entity Select Types ============ +export type GetAllRecordSelect = { + path?: boolean; + data?: boolean; +}; +export type FunctionApiBindingSelect = { + id?: boolean; + functionDefinitionId?: boolean; + apiId?: boolean; + alias?: boolean; + config?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; +}; +export type FunctionDeploymentSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + functionDefinitionId?: boolean; + namespaceId?: boolean; + status?: boolean; + serviceUrl?: boolean; + serviceName?: boolean; + revision?: boolean; + image?: boolean; + concurrency?: boolean; + scaleMin?: boolean; + scaleMax?: boolean; + timeoutSeconds?: boolean; + resources?: boolean; + lastError?: boolean; + lastErrorAt?: boolean; + errorCount?: boolean; + labels?: boolean; + annotations?: boolean; + databaseId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; +}; +export type FunctionGraphRefSelect = { + id?: boolean; + name?: boolean; + databaseId?: boolean; + storeId?: boolean; + commitId?: boolean; +}; +export type FunctionGraphStoreSelect = { + id?: boolean; + name?: boolean; + databaseId?: boolean; + hash?: boolean; + createdAt?: boolean; +}; +export type FunctionGraphObjectSelect = { + id?: boolean; + databaseId?: boolean; + kids?: boolean; + ktree?: boolean; + data?: boolean; + createdAt?: boolean; +}; +export type FunctionDeploymentEventSelect = { + createdAt?: boolean; + id?: boolean; + deploymentId?: boolean; + eventType?: boolean; + actorId?: boolean; + message?: boolean; + metadata?: boolean; + databaseId?: boolean; +}; +export type OrgFunctionExecutionLogSelect = { + createdAt?: boolean; + id?: boolean; + invocationId?: boolean; + taskIdentifier?: boolean; + logLevel?: boolean; + message?: boolean; + metadata?: boolean; + actorId?: boolean; +}; +export type FunctionGraphExecutionOutputSelect = { + createdAt?: boolean; + id?: boolean; + databaseId?: boolean; + hash?: boolean; + data?: boolean; +}; +export type FunctionGraphCommitSelect = { + id?: boolean; + message?: boolean; + databaseId?: boolean; + storeId?: boolean; + parentIds?: boolean; + authorId?: boolean; + committerId?: boolean; + treeId?: boolean; + date?: boolean; +}; +export type SecretDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + name?: boolean; + description?: boolean; + isBuiltIn?: boolean; + labels?: boolean; + annotations?: boolean; + databaseId?: boolean; +}; +export type FunctionExecutionLogSelect = { + createdAt?: boolean; + id?: boolean; + invocationId?: boolean; + taskIdentifier?: boolean; + logLevel?: boolean; + message?: boolean; + metadata?: boolean; + actorId?: boolean; + databaseId?: boolean; +}; +export type FunctionGraphExecutionNodeStateSelect = { + createdAt?: boolean; + id?: boolean; + executionId?: boolean; + databaseId?: boolean; + nodeName?: boolean; + nodePath?: boolean; + status?: boolean; + startedAt?: boolean; + completedAt?: boolean; + errorCode?: boolean; + errorMessage?: boolean; + outputId?: boolean; +}; +export type FunctionGraphSelect = { + id?: boolean; + databaseId?: boolean; + storeId?: boolean; + entityId?: boolean; + context?: boolean; + name?: boolean; + description?: boolean; + definitionsCommitId?: boolean; + isValid?: boolean; + validationErrors?: boolean; + createdBy?: boolean; + createdAt?: boolean; + updatedAt?: boolean; +}; +export type OrgFunctionInvocationSelect = { + createdAt?: boolean; + id?: boolean; + actorId?: boolean; + taskIdentifier?: boolean; + payload?: boolean; + status?: boolean; + result?: boolean; + error?: boolean; + durationMs?: boolean; + jobId?: boolean; + startedAt?: boolean; + completedAt?: boolean; + parentInvocationId?: boolean; + graphExecutionId?: boolean; +}; +export type FunctionInvocationSelect = { + createdAt?: boolean; + id?: boolean; + actorId?: boolean; + databaseId?: boolean; + taskIdentifier?: boolean; + payload?: boolean; + status?: boolean; + result?: boolean; + error?: boolean; + durationMs?: boolean; + jobId?: boolean; + startedAt?: boolean; + completedAt?: boolean; + parentInvocationId?: boolean; + graphExecutionId?: boolean; +}; +export type FunctionGraphExecutionSelect = { + startedAt?: boolean; + id?: boolean; + graphId?: boolean; + invocationId?: boolean; + databaseId?: boolean; + entityId?: boolean; + outputNode?: boolean; + outputPort?: boolean; + status?: boolean; + inputPayload?: boolean; + outputPayload?: boolean; + nodeOutputs?: boolean; + executionPlan?: boolean; + currentWave?: boolean; + parentExecutionId?: boolean; + parentNodeName?: boolean; + definitionsCommitId?: boolean; + tickCount?: boolean; + completedAt?: boolean; + maxTicks?: boolean; + maxPendingJobs?: boolean; + timeoutAt?: boolean; + errorCode?: boolean; + errorMessage?: boolean; + graph?: { + select: FunctionGraphSelect; + }; +}; +export type FunctionDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + scope?: boolean; + name?: boolean; + taskIdentifier?: boolean; + description?: boolean; + isInvocable?: boolean; + maxAttempts?: boolean; + priority?: boolean; + queueName?: boolean; + runtime?: boolean; + image?: boolean; + concurrency?: boolean; + scaleMin?: boolean; + scaleMax?: boolean; + timeoutSeconds?: boolean; + resources?: boolean; + isBuiltIn?: boolean; + requiredSecrets?: boolean; + requiredConfigs?: boolean; + requiredBuckets?: boolean; + requiredModels?: boolean; + inputs?: boolean; + outputs?: boolean; + props?: boolean; + volatile?: boolean; + icon?: boolean; + category?: boolean; + functionApiBindings?: { + select: FunctionApiBindingSelect; + first?: number; + filter?: FunctionApiBindingFilter; + orderBy?: FunctionApiBindingOrderBy[]; + }; + functionDeployments?: { + select: FunctionDeploymentSelect; + first?: number; + filter?: FunctionDeploymentFilter; + orderBy?: FunctionDeploymentOrderBy[]; + }; +}; +// ============ Table Filter Types ============ +export interface GetAllRecordFilter { + path?: StringListFilter; + data?: JSONFilter; + and?: GetAllRecordFilter[]; + or?: GetAllRecordFilter[]; + not?: GetAllRecordFilter; +} +export interface FunctionApiBindingFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `apiId` field. */ + apiId?: UUIDFilter; + /** Filter by the object’s `alias` field. */ + alias?: StringFilter; + /** Filter by the object’s `config` field. */ + config?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionApiBindingFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionApiBindingFilter[]; + /** Negates the expression. */ + not?: FunctionApiBindingFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +export interface FunctionDeploymentFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `serviceName` field. */ + serviceName?: StringFilter; + /** Filter by the object’s `revision` field. */ + revision?: IntFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `lastError` field. */ + lastError?: StringFilter; + /** Filter by the object’s `lastErrorAt` field. */ + lastErrorAt?: DatetimeFilter; + /** Filter by the object’s `errorCount` field. */ + errorCount?: IntFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +export interface FunctionGraphRefFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `commitId` field. */ + commitId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphRefFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphRefFilter[]; + /** Negates the expression. */ + not?: FunctionGraphRefFilter; +} +export interface FunctionGraphStoreFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphStoreFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphStoreFilter[]; + /** Negates the expression. */ + not?: FunctionGraphStoreFilter; +} +export interface FunctionGraphObjectFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `kids` field. */ + kids?: UUIDListFilter; + /** Filter by the object’s `ktree` field. */ + ktree?: StringListFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphObjectFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphObjectFilter[]; + /** Negates the expression. */ + not?: FunctionGraphObjectFilter; +} +export interface FunctionDeploymentEventFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `deploymentId` field. */ + deploymentId?: UUIDFilter; + /** Filter by the object’s `eventType` field. */ + eventType?: StringFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentEventFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentEventFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentEventFilter; +} +export interface OrgFunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: OrgFunctionExecutionLogFilter; +} +export interface FunctionGraphExecutionOutputFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: Base64EncodedBinaryFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionOutputFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionOutputFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionOutputFilter; +} +export interface FunctionGraphCommitFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `parentIds` field. */ + parentIds?: UUIDListFilter; + /** Filter by the object’s `authorId` field. */ + authorId?: UUIDFilter; + /** Filter by the object’s `committerId` field. */ + committerId?: UUIDFilter; + /** Filter by the object’s `treeId` field. */ + treeId?: UUIDFilter; + /** Filter by the object’s `date` field. */ + date?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphCommitFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphCommitFilter[]; + /** Negates the expression. */ + not?: FunctionGraphCommitFilter; +} +export interface SecretDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: SecretDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: SecretDefinitionFilter[]; + /** Negates the expression. */ + not?: SecretDefinitionFilter; +} +export interface FunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: FunctionExecutionLogFilter; +} +export interface FunctionGraphExecutionNodeStateFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `executionId` field. */ + executionId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `nodeName` field. */ + nodeName?: StringFilter; + /** Filter by the object’s `nodePath` field. */ + nodePath?: StringListFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Filter by the object’s `outputId` field. */ + outputId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionNodeStateFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionNodeStateFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionNodeStateFilter; +} +export interface FunctionGraphFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `context` field. */ + context?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `isValid` field. */ + isValid?: BooleanFilter; + /** Filter by the object’s `validationErrors` field. */ + validationErrors?: JSONFilter; + /** Filter by the object’s `createdBy` field. */ + createdBy?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphFilter[]; + /** Negates the expression. */ + not?: FunctionGraphFilter; +} +export interface OrgFunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionInvocationFilter[]; + /** Negates the expression. */ + not?: OrgFunctionInvocationFilter; +} +export interface FunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionInvocationFilter[]; + /** Negates the expression. */ + not?: FunctionInvocationFilter; +} +export interface FunctionGraphExecutionFilter { + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `graphId` field. */ + graphId?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `outputNode` field. */ + outputNode?: StringFilter; + /** Filter by the object’s `outputPort` field. */ + outputPort?: StringFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `inputPayload` field. */ + inputPayload?: JSONFilter; + /** Filter by the object’s `outputPayload` field. */ + outputPayload?: JSONFilter; + /** Filter by the object’s `nodeOutputs` field. */ + nodeOutputs?: JSONFilter; + /** Filter by the object’s `executionPlan` field. */ + executionPlan?: JSONFilter; + /** Filter by the object’s `currentWave` field. */ + currentWave?: IntFilter; + /** Filter by the object’s `parentExecutionId` field. */ + parentExecutionId?: UUIDFilter; + /** Filter by the object’s `parentNodeName` field. */ + parentNodeName?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `tickCount` field. */ + tickCount?: IntFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `maxTicks` field. */ + maxTicks?: IntFilter; + /** Filter by the object’s `maxPendingJobs` field. */ + maxPendingJobs?: IntFilter; + /** Filter by the object’s `timeoutAt` field. */ + timeoutAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionFilter; + /** Filter by the object’s `graph` relation. */ + graph?: FunctionGraphFilter; +} +export interface FunctionDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `runtime` field. */ + runtime?: StringFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `requiredBuckets` field. */ + requiredBuckets?: StringListFilter; + /** Filter by the object’s `requiredModels` field. */ + requiredModels?: StringListFilter; + /** Filter by the object’s `inputs` field. */ + inputs?: JSONFilter; + /** Filter by the object’s `outputs` field. */ + outputs?: JSONFilter; + /** Filter by the object’s `props` field. */ + props?: JSONFilter; + /** Filter by the object’s `volatile` field. */ + volatile?: BooleanFilter; + /** Filter by the object’s `icon` field. */ + icon?: StringFilter; + /** Filter by the object’s `category` field. */ + category?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: FunctionDefinitionFilter; + /** Filter by the object’s `functionApiBindings` relation. */ + functionApiBindings?: FunctionDefinitionToManyFunctionApiBindingFilter; + /** `functionApiBindings` exist. */ + functionApiBindingsExist?: boolean; + /** Filter by the object’s `functionDeployments` relation. */ + functionDeployments?: FunctionDefinitionToManyFunctionDeploymentFilter; + /** `functionDeployments` exist. */ + functionDeploymentsExist?: boolean; +} +// ============ OrderBy Types ============ +export type GetAllRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'DATA_ASC' + | 'DATA_DESC'; +export type FunctionApiBindingOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC'; +export type FunctionDeploymentOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionGraphRefOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC'; +export type FunctionGraphStoreOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +export type FunctionGraphObjectOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +export type FunctionDeploymentEventOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type OrgFunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC'; +export type FunctionGraphExecutionOutputOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'DATA_ASC' + | 'DATA_DESC'; +export type FunctionGraphCommitOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC'; +export type SecretDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionGraphExecutionNodeStateOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC'; +export type FunctionGraphOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgFunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +export type FunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +export type FunctionGraphExecutionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC'; +export type FunctionDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_INVOCABLE_ASC' + | 'IS_INVOCABLE_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC'; +// ============ CRUD Input Types ============ +export interface CreateGetAllRecordInput { + clientMutationId?: string; + getAllRecord: { + path?: string[]; + data?: Record; + }; +} +export interface GetAllRecordPatch { + path?: string[] | null; + data?: Record | null; +} +export interface UpdateGetAllRecordInput { + clientMutationId?: string; + id: string; + getAllRecordPatch: GetAllRecordPatch; +} +export interface DeleteGetAllRecordInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionApiBindingInput { + clientMutationId?: string; + functionApiBinding: { + functionDefinitionId: string; + apiId: string; + alias?: string; + config?: Record; + }; +} +export interface FunctionApiBindingPatch { + functionDefinitionId?: string | null; + apiId?: string | null; + alias?: string | null; + config?: Record | null; +} +export interface UpdateFunctionApiBindingInput { + clientMutationId?: string; + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; +} +export interface DeleteFunctionApiBindingInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDeploymentInput { + clientMutationId?: string; + functionDeployment: { + functionDefinitionId: string; + namespaceId: string; + status?: string; + serviceUrl?: string; + serviceName?: string; + revision?: number; + image?: string; + concurrency?: number; + scaleMin?: number; + scaleMax?: number; + timeoutSeconds?: number; + resources?: Record; + lastError?: string; + lastErrorAt?: string; + errorCount?: number; + labels?: Record; + annotations?: Record; + databaseId: string; + }; +} +export interface FunctionDeploymentPatch { + functionDefinitionId?: string | null; + namespaceId?: string | null; + status?: string | null; + serviceUrl?: string | null; + serviceName?: string | null; + revision?: number | null; + image?: string | null; + concurrency?: number | null; + scaleMin?: number | null; + scaleMax?: number | null; + timeoutSeconds?: number | null; + resources?: Record | null; + lastError?: string | null; + lastErrorAt?: string | null; + errorCount?: number | null; + labels?: Record | null; + annotations?: Record | null; + databaseId?: string | null; +} +export interface UpdateFunctionDeploymentInput { + clientMutationId?: string; + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; +} +export interface DeleteFunctionDeploymentInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphRefInput { + clientMutationId?: string; + functionGraphRef: { + name: string; + databaseId: string; + storeId: string; + commitId?: string; + }; +} +export interface FunctionGraphRefPatch { + name?: string | null; + databaseId?: string | null; + storeId?: string | null; + commitId?: string | null; +} +export interface UpdateFunctionGraphRefInput { + clientMutationId?: string; + id: string; + functionGraphRefPatch: FunctionGraphRefPatch; +} +export interface DeleteFunctionGraphRefInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphStoreInput { + clientMutationId?: string; + functionGraphStore: { + name: string; + databaseId: string; + hash?: string; + }; +} +export interface FunctionGraphStorePatch { + name?: string | null; + databaseId?: string | null; + hash?: string | null; +} +export interface UpdateFunctionGraphStoreInput { + clientMutationId?: string; + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; +} +export interface DeleteFunctionGraphStoreInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphObjectInput { + clientMutationId?: string; + functionGraphObject: { + databaseId: string; + kids?: string[]; + ktree?: string[]; + data?: Record; + }; +} +export interface FunctionGraphObjectPatch { + databaseId?: string | null; + kids?: string[] | null; + ktree?: string[] | null; + data?: Record | null; +} +export interface UpdateFunctionGraphObjectInput { + clientMutationId?: string; + id: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; +} +export interface DeleteFunctionGraphObjectInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDeploymentEventInput { + clientMutationId?: string; + functionDeploymentEvent: { + deploymentId: string; + eventType: string; + actorId?: string; + message?: string; + metadata?: Record; + databaseId: string; + }; +} +export interface FunctionDeploymentEventPatch { + deploymentId?: string | null; + eventType?: string | null; + actorId?: string | null; + message?: string | null; + metadata?: Record | null; + databaseId?: string | null; +} +export interface UpdateFunctionDeploymentEventInput { + clientMutationId?: string; + id: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; +} +export interface DeleteFunctionDeploymentEventInput { + clientMutationId?: string; + id: string; +} +export interface CreateOrgFunctionExecutionLogInput { + clientMutationId?: string; + orgFunctionExecutionLog: { + invocationId?: string; + taskIdentifier?: string; + logLevel?: string; + message: string; + metadata?: Record; + actorId?: string; + }; +} +export interface OrgFunctionExecutionLogPatch { + invocationId?: string | null; + taskIdentifier?: string | null; + logLevel?: string | null; + message?: string | null; + metadata?: Record | null; + actorId?: string | null; +} +export interface UpdateOrgFunctionExecutionLogInput { + clientMutationId?: string; + id: string; + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; +} +export interface DeleteOrgFunctionExecutionLogInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + functionGraphExecutionOutput: { + databaseId: string; + hash: Base64EncodedBinary; + data: Record; + }; +} +export interface FunctionGraphExecutionOutputPatch { + databaseId?: string | null; + hash?: Base64EncodedBinary | null; + data?: Record | null; +} +export interface UpdateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + id: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; +} +export interface DeleteFunctionGraphExecutionOutputInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphCommitInput { + clientMutationId?: string; + functionGraphCommit: { + message?: string; + databaseId: string; + storeId: string; + parentIds?: string[]; + authorId?: string; + committerId?: string; + treeId?: string; + date?: string; + }; +} +export interface FunctionGraphCommitPatch { + message?: string | null; + databaseId?: string | null; + storeId?: string | null; + parentIds?: string[] | null; + authorId?: string | null; + committerId?: string | null; + treeId?: string | null; + date?: string | null; +} +export interface UpdateFunctionGraphCommitInput { + clientMutationId?: string; + id: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; +} +export interface DeleteFunctionGraphCommitInput { + clientMutationId?: string; + id: string; +} +export interface CreateSecretDefinitionInput { + clientMutationId?: string; + secretDefinition: { + name: string; + description?: string; + isBuiltIn?: boolean; + labels?: Record; + annotations?: Record; + databaseId: string; + }; +} +export interface SecretDefinitionPatch { + name?: string | null; + description?: string | null; + isBuiltIn?: boolean | null; + labels?: Record | null; + annotations?: Record | null; + databaseId?: string | null; +} +export interface UpdateSecretDefinitionInput { + clientMutationId?: string; + id: string; + secretDefinitionPatch: SecretDefinitionPatch; +} +export interface DeleteSecretDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionExecutionLogInput { + clientMutationId?: string; + functionExecutionLog: { + invocationId?: string; + taskIdentifier?: string; + logLevel?: string; + message: string; + metadata?: Record; + actorId?: string; + databaseId: string; + }; +} +export interface FunctionExecutionLogPatch { + invocationId?: string | null; + taskIdentifier?: string | null; + logLevel?: string | null; + message?: string | null; + metadata?: Record | null; + actorId?: string | null; + databaseId?: string | null; +} +export interface UpdateFunctionExecutionLogInput { + clientMutationId?: string; + id: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; +} +export interface DeleteFunctionExecutionLogInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + functionGraphExecutionNodeState: { + executionId: string; + databaseId: string; + nodeName: string; + nodePath?: string[]; + status?: string; + startedAt?: string; + completedAt?: string; + errorCode?: string; + errorMessage?: string; + outputId?: string; + }; +} +export interface FunctionGraphExecutionNodeStatePatch { + executionId?: string | null; + databaseId?: string | null; + nodeName?: string | null; + nodePath?: string[] | null; + status?: string | null; + startedAt?: string | null; + completedAt?: string | null; + errorCode?: string | null; + errorMessage?: string | null; + outputId?: string | null; +} +export interface UpdateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + id: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; +} +export interface DeleteFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphInput { + clientMutationId?: string; + functionGraph: { + databaseId: string; + storeId: string; + entityId: string; + context?: string; + name?: string; + description?: string; + definitionsCommitId: string; + isValid?: boolean; + validationErrors?: Record; + createdBy?: string; + }; +} +export interface FunctionGraphPatch { + databaseId?: string | null; + storeId?: string | null; + entityId?: string | null; + context?: string | null; + name?: string | null; + description?: string | null; + definitionsCommitId?: string | null; + isValid?: boolean | null; + validationErrors?: Record | null; + createdBy?: string | null; +} +export interface UpdateFunctionGraphInput { + clientMutationId?: string; + id: string; + functionGraphPatch: FunctionGraphPatch; +} +export interface DeleteFunctionGraphInput { + clientMutationId?: string; + id: string; +} +export interface CreateOrgFunctionInvocationInput { + clientMutationId?: string; + orgFunctionInvocation: { + actorId?: string; + taskIdentifier: string; + payload?: Record; + status?: string; + result?: Record; + error?: string; + durationMs?: number; + jobId?: string; + startedAt?: string; + completedAt?: string; + parentInvocationId?: string; + graphExecutionId?: string; + }; +} +export interface OrgFunctionInvocationPatch { + actorId?: string | null; + taskIdentifier?: string | null; + payload?: Record | null; + status?: string | null; + result?: Record | null; + error?: string | null; + durationMs?: number | null; + jobId?: string | null; + startedAt?: string | null; + completedAt?: string | null; + parentInvocationId?: string | null; + graphExecutionId?: string | null; +} +export interface UpdateOrgFunctionInvocationInput { + clientMutationId?: string; + id: string; + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; +} +export interface DeleteOrgFunctionInvocationInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionInvocationInput { + clientMutationId?: string; + functionInvocation: { + actorId?: string; + databaseId: string; + taskIdentifier: string; + payload?: Record; + status?: string; + result?: Record; + error?: string; + durationMs?: number; + jobId?: string; + startedAt?: string; + completedAt?: string; + parentInvocationId?: string; + graphExecutionId?: string; + }; +} +export interface FunctionInvocationPatch { + actorId?: string | null; + databaseId?: string | null; + taskIdentifier?: string | null; + payload?: Record | null; + status?: string | null; + result?: Record | null; + error?: string | null; + durationMs?: number | null; + jobId?: string | null; + startedAt?: string | null; + completedAt?: string | null; + parentInvocationId?: string | null; + graphExecutionId?: string | null; +} +export interface UpdateFunctionInvocationInput { + clientMutationId?: string; + id: string; + functionInvocationPatch: FunctionInvocationPatch; +} +export interface DeleteFunctionInvocationInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionInput { + clientMutationId?: string; + functionGraphExecution: { + startedAt?: string; + graphId: string; + invocationId?: string; + databaseId: string; + entityId?: string; + outputNode: string; + outputPort?: string; + status?: string; + inputPayload?: Record; + outputPayload?: Record; + nodeOutputs?: Record; + executionPlan?: Record; + currentWave?: number; + parentExecutionId?: string; + parentNodeName?: string; + definitionsCommitId?: string; + tickCount?: number; + completedAt?: string; + maxTicks?: number; + maxPendingJobs?: number; + timeoutAt?: string; + errorCode?: string; + errorMessage?: string; + }; +} +export interface FunctionGraphExecutionPatch { + startedAt?: string | null; + graphId?: string | null; + invocationId?: string | null; + databaseId?: string | null; + entityId?: string | null; + outputNode?: string | null; + outputPort?: string | null; + status?: string | null; + inputPayload?: Record | null; + outputPayload?: Record | null; + nodeOutputs?: Record | null; + executionPlan?: Record | null; + currentWave?: number | null; + parentExecutionId?: string | null; + parentNodeName?: string | null; + definitionsCommitId?: string | null; + tickCount?: number | null; + completedAt?: string | null; + maxTicks?: number | null; + maxPendingJobs?: number | null; + timeoutAt?: string | null; + errorCode?: string | null; + errorMessage?: string | null; +} +export interface UpdateFunctionGraphExecutionInput { + clientMutationId?: string; + id: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; +} +export interface DeleteFunctionGraphExecutionInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDefinitionInput { + clientMutationId?: string; + functionDefinition: { + scope: string; + name: string; + taskIdentifier: string; + description?: string; + isInvocable?: boolean; + maxAttempts?: number; + priority?: number; + queueName?: string; + runtime?: string; + image?: string; + concurrency?: number; + scaleMin?: number; + scaleMax?: number; + timeoutSeconds?: number; + resources?: Record; + isBuiltIn?: boolean; + requiredSecrets?: FunctionRequirementInput[]; + requiredConfigs?: FunctionRequirementInput[]; + requiredBuckets?: string[]; + requiredModels?: string[]; + inputs?: Record; + outputs?: Record; + props?: Record; + volatile?: boolean; + icon?: string; + category?: string; + }; +} +export interface FunctionDefinitionPatch { + scope?: string | null; + name?: string | null; + taskIdentifier?: string | null; + description?: string | null; + isInvocable?: boolean | null; + maxAttempts?: number | null; + priority?: number | null; + queueName?: string | null; + runtime?: string | null; + image?: string | null; + concurrency?: number | null; + scaleMin?: number | null; + scaleMax?: number | null; + timeoutSeconds?: number | null; + resources?: Record | null; + isBuiltIn?: boolean | null; + requiredSecrets?: FunctionRequirementInput[] | null; + requiredConfigs?: FunctionRequirementInput[] | null; + requiredBuckets?: string[] | null; + requiredModels?: string[] | null; + inputs?: Record | null; + outputs?: Record | null; + props?: Record | null; + volatile?: boolean | null; + icon?: string | null; + category?: string | null; +} +export interface UpdateFunctionDefinitionInput { + clientMutationId?: string; + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; +} +export interface DeleteFunctionDefinitionInput { + clientMutationId?: string; + id: string; +} +// ============ Connection Fields Map ============ +export const connectionFieldsMap = { + FunctionDefinition: { + functionApiBindings: 'FunctionApiBinding', + functionDeployments: 'FunctionDeployment', + }, +} as Record>; +// ============ Custom Input Types (from schema) ============ +export interface ValidateFunctionGraphInput { + clientMutationId?: string; + graphId?: string; +} +export interface InitEmptyRepoInput { + clientMutationId?: string; + sId?: string; + storeId?: string; +} +export interface SetDataAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: Record; +} +export interface ImportDefinitionsInput { + clientMutationId?: string; + graphId?: string; + sourceScopeId?: string; + sourceCommitId?: string; + contexts?: string[]; +} +export interface CopyGraphInput { + clientMutationId?: string; + databaseId?: string; + graphId?: string; + name?: string; +} +export interface SaveGraphInput { + clientMutationId?: string; + graphId?: string; + rootHash?: string; + message?: string; +} +export interface AddEdgeAndSaveInput { + clientMutationId?: string; + graphId?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + message?: string; +} +export interface AddNodeAndSaveInput { + clientMutationId?: string; + graphId?: string; + nodeName?: string; + nodeType?: string; + props?: Record; + meta?: Record; + message?: string; +} +export interface AddEdgeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + context?: string; + graphName?: string; +} +export interface AddNodeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + nodeName?: string; + nodeType?: string; + context?: string; + graphName?: string; + props?: Record; + meta?: Record; +} +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: Record; + context?: string; + description?: string; + entityId?: string; + createdBy?: string; + definitionsCommitId?: string; +} +export interface InsertNodeAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: Record; + kids?: string[]; + ktree?: string[]; +} +export interface StartExecutionInput { + clientMutationId?: string; + graphId?: string; + inputPayload?: Record; + outputNode?: string; + outputPort?: string; + maxTicks?: number; + maxPendingJobs?: number; + timeoutInterval?: IntervalInput; + parentExecutionId?: string; + parentNodeName?: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** A filter to be used against Base64EncodedBinary fields. All fields are combined with a logical ‘and.’ */ +export interface Base64EncodedBinaryFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: Base64EncodedBinary; + /** Not equal to the specified value. */ + notEqualTo?: Base64EncodedBinary; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: Base64EncodedBinary; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: Base64EncodedBinary; + /** Included in the specified list. */ + in?: Base64EncodedBinary[]; + /** Not included in the specified list. */ + notIn?: Base64EncodedBinary[]; +} +/** A filter to be used against many `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionApiBindingFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionApiBindingFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionApiBindingFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionApiBindingFilter; +} +/** A filter to be used against many `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionDeploymentFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionDeploymentFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionDeploymentFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionDeploymentFilter; +} +/** An input for mutations affecting `FunctionApiBinding` */ +export interface FunctionApiBindingInput { + id?: string; + /** Function definition this binding belongs to */ + functionDefinitionId: string; + /** API endpoint this function is bound to */ + apiId: string; + /** Binding alias (e.g. default, staging, production) */ + alias?: string; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: Record; +} +/** An input for mutations affecting `FunctionDeployment` */ +export interface FunctionDeploymentInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function definition being deployed to this namespace */ + functionDefinitionId: string; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId: string; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number; + /** Container image override (NULL = inherit from function definition) */ + image?: string; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: Record; + /** Most recent provisioning or runtime error message */ + lastError?: string; + /** Timestamp of the most recent error */ + lastErrorAt?: string; + /** Cumulative error count for this deployment */ + errorCount?: number; + /** Key/value pairs for selecting and filtering deployments */ + labels?: Record; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionGraphRef` */ +export interface FunctionGraphRefInput { + /** Unique ref identifier */ + id?: string; + /** Ref name (e.g. HEAD, main) */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this ref belongs to */ + storeId: string; + /** Commit this ref points to */ + commitId?: string; +} +/** An input for mutations affecting `FunctionGraphStore` */ +export interface FunctionGraphStoreInput { + /** Unique store identifier */ + id?: string; + /** Human-readable store name */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Current root object hash of this store */ + hash?: string; + /** Timestamp of store creation */ + createdAt?: string; +} +/** An input for mutations affecting `FunctionGraphObject` */ +export interface FunctionGraphObjectInput { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Ordered array of child object IDs */ + kids?: string[]; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[]; + /** Payload data for this object node */ + data?: Record; + /** Timestamp of object creation */ + createdAt?: string; +} +/** An input for mutations affecting `FunctionDeploymentEvent` */ +export interface FunctionDeploymentEventInput { + /** Event timestamp (partition key) */ + createdAt?: string; + /** Unique event identifier */ + id?: string; + /** Deployment this event belongs to */ + deploymentId: string; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType: string; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string; + /** Human-readable description of the event */ + message?: string; + /** Structured context (old/new values, error details, etc.) */ + metadata?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `OrgFunctionExecutionLog` */ +export interface OrgFunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; +} +/** An input for mutations affecting `FunctionGraphExecutionOutput` */ +export interface FunctionGraphExecutionOutputInput { + /** Timestamp of output creation */ + createdAt?: string; + /** Unique execution output identifier */ + id?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash: Base64EncodedBinary; + /** The actual output payload from a completed node */ + data: Record; +} +/** An input for mutations affecting `FunctionGraphCommit` */ +export interface FunctionGraphCommitInput { + /** Unique commit identifier */ + id?: string; + /** Optional commit message */ + message?: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this commit belongs to */ + storeId: string; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[]; + /** User who authored the changes */ + authorId?: string; + /** User who committed (may differ from author) */ + committerId?: string; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string; + /** Commit timestamp */ + date?: string; +} +/** An input for mutations affecting `SecretDefinition` */ +export interface SecretDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Secret name (must match app_secrets.name for resolution) */ + name: string; + /** Human-readable description of what this secret is used for */ + description?: string; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: Record; + /** Freeform metadata annotations for secret definitions */ + annotations?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionExecutionLog` */ +export interface FunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionGraphExecutionNodeState` */ +export interface FunctionGraphExecutionNodeStateInput { + /** Timestamp of node state creation (partition key) */ + createdAt?: string; + /** Unique node state identifier */ + id?: string; + /** FK to the parent graph execution */ + executionId: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName: string; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[]; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string; + /** Timestamp when the node began executing */ + startedAt?: string; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string; +} +/** An input for mutations affecting `OrgFunctionInvocation` */ +export interface OrgFunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: Record; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: Record; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +/** An input for mutations affecting `FunctionInvocation` */ +export interface FunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: Record; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: Record; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +/** An input for mutations affecting `FunctionGraphExecution` */ +export interface FunctionGraphExecutionInput { + /** Execution start timestamp */ + startedAt?: string; + /** Unique execution identifier */ + id?: string; + /** FK to the graph definition being executed */ + graphId: string; + /** Parent function_invocations row (for metering) */ + invocationId?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Entity context (org/team) for scoped billing */ + entityId?: string; + /** Target output boundary node name to resolve */ + outputNode: string; + /** Target output port name (default: value) */ + outputPort?: string; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Initial inputs provided at invocation time */ + inputPayload?: Record; + /** Final result extracted from terminal output node */ + outputPayload?: Record; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: Record; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: Record; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string; + /** Number of evaluate_step ticks executed */ + tickCount?: number; + /** Execution completion timestamp */ + completedAt?: string; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; +} +/** An input for mutations affecting `FunctionDefinition` */ +export interface FunctionDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope: string; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name: string; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier: string; + /** Human-readable description of what this function does */ + description?: string; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number; + /** Job priority (lower = higher priority) */ + priority?: number; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number; + /** Knative request timeout in seconds */ + timeoutSeconds?: number; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: Record; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirementInput[]; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirementInput[]; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[]; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[]; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: Record; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: Record; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: Record; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string; +} +/** An input for mutations affecting `FunctionRequirement` */ +export interface FunctionRequirementInput { + name?: string; + required?: boolean; +} +/** An interval of time that has passed where the smallest distinct unit is a second. */ +export interface IntervalInput { + /** + * A quantity of seconds. This is the only non-integer field, as all the other + * fields will dump their overflow into a smaller unit of time. Intervals don’t + * have a smaller unit than seconds. + */ + seconds?: number; + /** A quantity of minutes. */ + minutes?: number; + /** A quantity of hours. */ + hours?: number; + /** A quantity of days. */ + days?: number; + /** A quantity of months. */ + months?: number; + /** A quantity of years. */ + years?: number; +} +/** A filter to be used against `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionApiBindingFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `apiId` field. */ + apiId?: UUIDFilter; + /** Filter by the object’s `alias` field. */ + alias?: StringFilter; + /** Filter by the object’s `config` field. */ + config?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionApiBindingFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionApiBindingFilter[]; + /** Negates the expression. */ + not?: FunctionApiBindingFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDeploymentFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `serviceName` field. */ + serviceName?: StringFilter; + /** Filter by the object’s `revision` field. */ + revision?: IntFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `lastError` field. */ + lastError?: StringFilter; + /** Filter by the object’s `lastErrorAt` field. */ + lastErrorAt?: DatetimeFilter; + /** Filter by the object’s `errorCount` field. */ + errorCount?: IntFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against UUID fields. All fields are combined with a logical ‘and.’ */ +export interface UUIDFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; +} +/** A filter to be used against String fields. All fields are combined with a logical ‘and.’ */ +export interface StringFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; + /** Contains the specified string (case-sensitive). */ + includes?: string; + /** Does not contain the specified string (case-sensitive). */ + notIncludes?: string; + /** Contains the specified string (case-insensitive). */ + includesInsensitive?: string; + /** Does not contain the specified string (case-insensitive). */ + notIncludesInsensitive?: string; + /** Starts with the specified string (case-sensitive). */ + startsWith?: string; + /** Does not start with the specified string (case-sensitive). */ + notStartsWith?: string; + /** Starts with the specified string (case-insensitive). */ + startsWithInsensitive?: string; + /** Does not start with the specified string (case-insensitive). */ + notStartsWithInsensitive?: string; + /** Ends with the specified string (case-sensitive). */ + endsWith?: string; + /** Does not end with the specified string (case-sensitive). */ + notEndsWith?: string; + /** Ends with the specified string (case-insensitive). */ + endsWithInsensitive?: string; + /** Does not end with the specified string (case-insensitive). */ + notEndsWithInsensitive?: string; + /** Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + like?: string; + /** Does not match the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + notLike?: string; + /** Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + likeInsensitive?: string; + /** Does not match the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + notLikeInsensitive?: string; + /** Equal to the specified value (case-insensitive). */ + equalToInsensitive?: string; + /** Not equal to the specified value (case-insensitive). */ + notEqualToInsensitive?: string; + /** Not equal to the specified value, treating null like an ordinary value (case-insensitive). */ + distinctFromInsensitive?: string; + /** Equal to the specified value, treating null like an ordinary value (case-insensitive). */ + notDistinctFromInsensitive?: string; + /** Included in the specified list (case-insensitive). */ + inInsensitive?: string[]; + /** Not included in the specified list (case-insensitive). */ + notInInsensitive?: string[]; + /** Less than the specified value (case-insensitive). */ + lessThanInsensitive?: string; + /** Less than or equal to the specified value (case-insensitive). */ + lessThanOrEqualToInsensitive?: string; + /** Greater than the specified value (case-insensitive). */ + greaterThanInsensitive?: string; + /** Greater than or equal to the specified value (case-insensitive). */ + greaterThanOrEqualToInsensitive?: string; +} +/** A filter to be used against JSON fields. All fields are combined with a logical ‘and.’ */ +export interface JSONFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: Record; + /** Not equal to the specified value. */ + notEqualTo?: Record; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: Record; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: Record; + /** Included in the specified list. */ + in?: Record[]; + /** Not included in the specified list. */ + notIn?: Record[]; + /** Less than the specified value. */ + lessThan?: Record; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: Record; + /** Greater than the specified value. */ + greaterThan?: Record; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: Record; + /** Contains the specified JSON. */ + contains?: Record; + /** Contains the specified key. */ + containsKey?: string; + /** Contains all of the specified keys. */ + containsAllKeys?: string[]; + /** Contains any of the specified keys. */ + containsAnyKeys?: string[]; + /** Contained by the specified JSON. */ + containedBy?: Record; +} +/** A filter to be used against `FunctionDefinition` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `runtime` field. */ + runtime?: StringFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `requiredBuckets` field. */ + requiredBuckets?: StringListFilter; + /** Filter by the object’s `requiredModels` field. */ + requiredModels?: StringListFilter; + /** Filter by the object’s `inputs` field. */ + inputs?: JSONFilter; + /** Filter by the object’s `outputs` field. */ + outputs?: JSONFilter; + /** Filter by the object’s `props` field. */ + props?: JSONFilter; + /** Filter by the object’s `volatile` field. */ + volatile?: BooleanFilter; + /** Filter by the object’s `icon` field. */ + icon?: StringFilter; + /** Filter by the object’s `category` field. */ + category?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: FunctionDefinitionFilter; + /** Filter by the object’s `functionApiBindings` relation. */ + functionApiBindings?: FunctionDefinitionToManyFunctionApiBindingFilter; + /** `functionApiBindings` exist. */ + functionApiBindingsExist?: boolean; + /** Filter by the object’s `functionDeployments` relation. */ + functionDeployments?: FunctionDefinitionToManyFunctionDeploymentFilter; + /** `functionDeployments` exist. */ + functionDeploymentsExist?: boolean; +} +/** A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ */ +export interface DatetimeFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; +} +/** A filter to be used against Int fields. All fields are combined with a logical ‘and.’ */ +export interface IntFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: number; + /** Not equal to the specified value. */ + notEqualTo?: number; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: number; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: number; + /** Included in the specified list. */ + in?: number[]; + /** Not included in the specified list. */ + notIn?: number[]; + /** Less than the specified value. */ + lessThan?: number; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: number; + /** Greater than the specified value. */ + greaterThan?: number; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: number; +} +/** A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ */ +export interface BooleanFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: boolean; + /** Not equal to the specified value. */ + notEqualTo?: boolean; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: boolean; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: boolean; + /** Included in the specified list. */ + in?: boolean[]; + /** Not included in the specified list. */ + notIn?: boolean[]; + /** Less than the specified value. */ + lessThan?: boolean; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: boolean; + /** Greater than the specified value. */ + greaterThan?: boolean; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: boolean; +} +/** A filter to be used against String List fields. All fields are combined with a logical ‘and.’ */ +export interface StringListFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string[]; + /** Not equal to the specified value. */ + notEqualTo?: string[]; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string[]; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string[]; + /** Less than the specified value. */ + lessThan?: string[]; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string[]; + /** Greater than the specified value. */ + greaterThan?: string[]; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string[]; + /** Contains the specified list of values. */ + contains?: string[]; + /** Contained by the specified list of values. */ + containedBy?: string[]; + /** Overlaps the specified list of values. */ + overlaps?: string[]; + /** Any array item is equal to the specified value. */ + anyEqualTo?: string; + /** Any array item is not equal to the specified value. */ + anyNotEqualTo?: string; + /** Any array item is less than the specified value. */ + anyLessThan?: string; + /** Any array item is less than or equal to the specified value. */ + anyLessThanOrEqualTo?: string; + /** Any array item is greater than the specified value. */ + anyGreaterThan?: string; + /** Any array item is greater than or equal to the specified value. */ + anyGreaterThanOrEqualTo?: string; +} +// ============ Payload/Return Types (for custom operations) ============ +export interface ValidateFunctionGraphPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type ValidateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface InitEmptyRepoPayload { + clientMutationId?: string | null; +} +export type InitEmptyRepoPayloadSelect = { + clientMutationId?: boolean; +}; +export interface SetDataAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type SetDataAtPathPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ImportDefinitionsPayload { + clientMutationId?: string | null; +} +export type ImportDefinitionsPayloadSelect = { + clientMutationId?: boolean; +}; +export interface CopyGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CopyGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface SaveGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type SaveGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddEdgeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddEdgeAndSavePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddNodeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddNodeAndSavePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddEdgePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddEdgePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddNodePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddNodePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ImportGraphJsonPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type ImportGraphJsonPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface InsertNodeAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type InsertNodeAtPathPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface StartExecutionPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type StartExecutionPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +export type ProvisionBucketPayloadSelect = { + success?: boolean; + bucketName?: boolean; + accessType?: boolean; + provider?: boolean; + endpoint?: boolean; + error?: boolean; +}; +export interface CreateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was created by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type CreateFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface UpdateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was updated by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type UpdateFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface DeleteFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was deleted by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type DeleteFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface CreateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was created by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type CreateFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was updated by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type UpdateFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was deleted by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type DeleteFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface CreateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was created by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type CreateFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface UpdateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was updated by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type UpdateFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface DeleteFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was deleted by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type DeleteFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface CreateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was created by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type CreateFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface UpdateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was updated by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type UpdateFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface DeleteFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was deleted by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type DeleteFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface CreateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was created by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type CreateFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface UpdateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was updated by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type UpdateFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface DeleteFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was deleted by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type DeleteFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface CreateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was created by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type CreateFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was updated by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type UpdateFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was deleted by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type DeleteFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface CreateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was created by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type CreateOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface UpdateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was updated by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type UpdateOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface DeleteOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was deleted by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type DeleteOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was created by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type CreateFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was updated by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type UpdateFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was deleted by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type DeleteFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface CreateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was created by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type CreateFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface UpdateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was updated by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type UpdateFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface DeleteFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was deleted by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type DeleteFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface CreateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was created by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type CreateSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface UpdateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was updated by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type UpdateSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface DeleteSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was deleted by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type DeleteSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface CreateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was created by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type CreateFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface UpdateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was updated by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type UpdateFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface DeleteFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was deleted by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type DeleteFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was created by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type CreateFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was updated by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type UpdateFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was deleted by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type DeleteFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface CreateFunctionGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface UpdateFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was updated by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export type UpdateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + functionGraph?: { + select: FunctionGraphSelect; + }; + functionGraphEdge?: { + select: FunctionGraphEdgeSelect; + }; +}; +export interface DeleteFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was deleted by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export type DeleteFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + functionGraph?: { + select: FunctionGraphSelect; + }; + functionGraphEdge?: { + select: FunctionGraphEdgeSelect; + }; +}; +export interface CreateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was created by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type CreateOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface UpdateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was updated by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type UpdateOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface DeleteOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was deleted by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type DeleteOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface CreateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was created by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type CreateFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface UpdateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was updated by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type UpdateFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface DeleteFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was deleted by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type DeleteFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was created by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type CreateFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was updated by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type UpdateFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was deleted by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type DeleteFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface CreateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was created by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type CreateFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +export interface UpdateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was updated by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type UpdateFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +export interface DeleteFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was deleted by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type DeleteFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +/** A `FunctionApiBinding` edge in the connection. */ +export interface FunctionApiBindingEdge { + cursor?: string | null; + /** The `FunctionApiBinding` at the end of the edge. */ + node?: FunctionApiBinding | null; +} +export type FunctionApiBindingEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionApiBindingSelect; + }; +}; +/** A `FunctionDeployment` edge in the connection. */ +export interface FunctionDeploymentEdge { + cursor?: string | null; + /** The `FunctionDeployment` at the end of the edge. */ + node?: FunctionDeployment | null; +} +export type FunctionDeploymentEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentSelect; + }; +}; +/** A `FunctionGraphRef` edge in the connection. */ +export interface FunctionGraphRefEdge { + cursor?: string | null; + /** The `FunctionGraphRef` at the end of the edge. */ + node?: FunctionGraphRef | null; +} +export type FunctionGraphRefEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphRefSelect; + }; +}; +/** A `FunctionGraphStore` edge in the connection. */ +export interface FunctionGraphStoreEdge { + cursor?: string | null; + /** The `FunctionGraphStore` at the end of the edge. */ + node?: FunctionGraphStore | null; +} +export type FunctionGraphStoreEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphStoreSelect; + }; +}; +/** A `FunctionGraphObject` edge in the connection. */ +export interface FunctionGraphObjectEdge { + cursor?: string | null; + /** The `FunctionGraphObject` at the end of the edge. */ + node?: FunctionGraphObject | null; +} +export type FunctionGraphObjectEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphObjectSelect; + }; +}; +/** A `FunctionDeploymentEvent` edge in the connection. */ +export interface FunctionDeploymentEventEdge { + cursor?: string | null; + /** The `FunctionDeploymentEvent` at the end of the edge. */ + node?: FunctionDeploymentEvent | null; +} +export type FunctionDeploymentEventEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentEventSelect; + }; +}; +/** A `OrgFunctionExecutionLog` edge in the connection. */ +export interface OrgFunctionExecutionLogEdge { + cursor?: string | null; + /** The `OrgFunctionExecutionLog` at the end of the edge. */ + node?: OrgFunctionExecutionLog | null; +} +export type OrgFunctionExecutionLogEdgeSelect = { + cursor?: boolean; + node?: { + select: OrgFunctionExecutionLogSelect; + }; +}; +/** A `FunctionGraphExecutionOutput` edge in the connection. */ +export interface FunctionGraphExecutionOutputEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionOutput` at the end of the edge. */ + node?: FunctionGraphExecutionOutput | null; +} +export type FunctionGraphExecutionOutputEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionOutputSelect; + }; +}; +/** A `FunctionGraphCommit` edge in the connection. */ +export interface FunctionGraphCommitEdge { + cursor?: string | null; + /** The `FunctionGraphCommit` at the end of the edge. */ + node?: FunctionGraphCommit | null; +} +export type FunctionGraphCommitEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphCommitSelect; + }; +}; +/** A `SecretDefinition` edge in the connection. */ +export interface SecretDefinitionEdge { + cursor?: string | null; + /** The `SecretDefinition` at the end of the edge. */ + node?: SecretDefinition | null; +} +export type SecretDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: SecretDefinitionSelect; + }; +}; +/** A `FunctionExecutionLog` edge in the connection. */ +export interface FunctionExecutionLogEdge { + cursor?: string | null; + /** The `FunctionExecutionLog` at the end of the edge. */ + node?: FunctionExecutionLog | null; +} +export type FunctionExecutionLogEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionExecutionLogSelect; + }; +}; +/** A `FunctionGraphExecutionNodeState` edge in the connection. */ +export interface FunctionGraphExecutionNodeStateEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionNodeState` at the end of the edge. */ + node?: FunctionGraphExecutionNodeState | null; +} +export type FunctionGraphExecutionNodeStateEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionNodeStateSelect; + }; +}; +/** A `FunctionGraph` edge in the connection. */ +export interface FunctionGraphEdge { + cursor?: string | null; + /** The `FunctionGraph` at the end of the edge. */ + node?: FunctionGraph | null; +} +export type FunctionGraphEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphSelect; + }; +}; +/** A `OrgFunctionInvocation` edge in the connection. */ +export interface OrgFunctionInvocationEdge { + cursor?: string | null; + /** The `OrgFunctionInvocation` at the end of the edge. */ + node?: OrgFunctionInvocation | null; +} +export type OrgFunctionInvocationEdgeSelect = { + cursor?: boolean; + node?: { + select: OrgFunctionInvocationSelect; + }; +}; +/** A `FunctionInvocation` edge in the connection. */ +export interface FunctionInvocationEdge { + cursor?: string | null; + /** The `FunctionInvocation` at the end of the edge. */ + node?: FunctionInvocation | null; +} +export type FunctionInvocationEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionInvocationSelect; + }; +}; +/** A `FunctionGraphExecution` edge in the connection. */ +export interface FunctionGraphExecutionEdge { + cursor?: string | null; + /** The `FunctionGraphExecution` at the end of the edge. */ + node?: FunctionGraphExecution | null; +} +export type FunctionGraphExecutionEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionSelect; + }; +}; +/** A `FunctionDefinition` edge in the connection. */ +export interface FunctionDefinitionEdge { + cursor?: string | null; + /** The `FunctionDefinition` at the end of the edge. */ + node?: FunctionDefinition | null; +} +export type FunctionDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDefinitionSelect; + }; +}; diff --git a/sdk/constructive-cli/src/compute/orm/models/functionApiBinding.ts b/sdk/constructive-cli/src/compute/orm/models/functionApiBinding.ts new file mode 100644 index 0000000000..a98f9d2a06 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionApiBinding.ts @@ -0,0 +1,245 @@ +/** + * FunctionApiBinding model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionApiBinding, + FunctionApiBindingWithRelations, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, + CreateFunctionApiBindingInput, + UpdateFunctionApiBindingInput, + FunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionApiBindingModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBindings: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBindings', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBinding: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', + document, + variables, + transform: (data: { + functionApiBindings?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBinding: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', + document, + variables, + transform: (data: { + functionApiBindings?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionApiBinding', + 'createFunctionApiBinding', + 'functionApiBinding', + args.select, + args.data, + 'CreateFunctionApiBindingInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'createFunctionApiBinding', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionApiBinding', + 'updateFunctionApiBinding', + 'functionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdateFunctionApiBindingInput', + 'id', + 'functionApiBindingPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'updateFunctionApiBinding', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionApiBinding', + 'deleteFunctionApiBinding', + 'functionApiBinding', + { + id: args.where.id, + }, + 'DeleteFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'deleteFunctionApiBinding', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionDefinition.ts b/sdk/constructive-cli/src/compute/orm/models/functionDefinition.ts new file mode 100644 index 0000000000..be6cb3ac27 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionDefinition.ts @@ -0,0 +1,245 @@ +/** + * FunctionDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDefinition, + FunctionDefinitionWithRelations, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, + CreateFunctionDefinitionInput, + UpdateFunctionDefinitionInput, + FunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinitions: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', + document, + variables, + transform: (data: { + functionDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', + document, + variables, + transform: (data: { + functionDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDefinition', + 'createFunctionDefinition', + 'functionDefinition', + args.select, + args.data, + 'CreateFunctionDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'createFunctionDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDefinition', + 'updateFunctionDefinition', + 'functionDefinition', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDefinitionInput', + 'id', + 'functionDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'updateFunctionDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDefinition', + 'deleteFunctionDefinition', + 'functionDefinition', + { + id: args.where.id, + }, + 'DeleteFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'deleteFunctionDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionDeployment.ts b/sdk/constructive-cli/src/compute/orm/models/functionDeployment.ts new file mode 100644 index 0000000000..d54820ebba --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionDeployment.ts @@ -0,0 +1,245 @@ +/** + * FunctionDeployment model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeployment, + FunctionDeploymentWithRelations, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, + CreateFunctionDeploymentInput, + UpdateFunctionDeploymentInput, + FunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployments: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployments', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployment: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', + document, + variables, + transform: (data: { + functionDeployments?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployment: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', + document, + variables, + transform: (data: { + functionDeployments?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeployment', + 'createFunctionDeployment', + 'functionDeployment', + args.select, + args.data, + 'CreateFunctionDeploymentInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'createFunctionDeployment', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeployment', + 'updateFunctionDeployment', + 'functionDeployment', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentInput', + 'id', + 'functionDeploymentPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'updateFunctionDeployment', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeployment', + 'deleteFunctionDeployment', + 'functionDeployment', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'deleteFunctionDeployment', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionDeploymentEvent.ts b/sdk/constructive-cli/src/compute/orm/models/functionDeploymentEvent.ts new file mode 100644 index 0000000000..6b95be6471 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionDeploymentEvent.ts @@ -0,0 +1,252 @@ +/** + * FunctionDeploymentEvent model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentEvent, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, + CreateFunctionDeploymentEventInput, + UpdateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentEventModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvents', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvent: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', + document, + variables, + transform: (data: { + functionDeploymentEvents?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvent: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', + document, + variables, + transform: (data: { + functionDeploymentEvents?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentEvent', + 'createFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.data, + 'CreateFunctionDeploymentEventInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'createFunctionDeploymentEvent', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentEvent', + 'updateFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentEventInput', + 'id', + 'functionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'updateFunctionDeploymentEvent', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentEvent', + 'deleteFunctionDeploymentEvent', + 'functionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'deleteFunctionDeploymentEvent', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionExecutionLog.ts b/sdk/constructive-cli/src/compute/orm/models/functionExecutionLog.ts new file mode 100644 index 0000000000..a581eeab83 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionExecutionLog.ts @@ -0,0 +1,252 @@ +/** + * FunctionExecutionLog model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionExecutionLog, + FunctionExecutionLogWithRelations, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, + CreateFunctionExecutionLogInput, + UpdateFunctionExecutionLogInput, + FunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionExecutionLogModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLogs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', + document, + variables, + transform: (data: { + functionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', + document, + variables, + transform: (data: { + functionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionExecutionLog', + 'createFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.data, + 'CreateFunctionExecutionLogInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'createFunctionExecutionLog', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionExecutionLog', + 'updateFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateFunctionExecutionLogInput', + 'id', + 'functionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'updateFunctionExecutionLog', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionExecutionLog', + 'deleteFunctionExecutionLog', + 'functionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'deleteFunctionExecutionLog', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraph.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraph.ts new file mode 100644 index 0000000000..8355e31658 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraph.ts @@ -0,0 +1,245 @@ +/** + * FunctionGraph model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraph, + FunctionGraphWithRelations, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, + CreateFunctionGraphInput, + UpdateFunctionGraphInput, + FunctionGraphPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraphs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraph: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', + document, + variables, + transform: (data: { + functionGraphs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraph: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', + document, + variables, + transform: (data: { + functionGraphs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraph', + 'createFunctionGraph', + 'functionGraph', + args.select, + args.data, + 'CreateFunctionGraphInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'createFunctionGraph', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraph', + 'updateFunctionGraph', + 'functionGraph', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphInput', + 'id', + 'functionGraphPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'updateFunctionGraph', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraph', + 'deleteFunctionGraph', + 'functionGraph', + { + id: args.where.id, + }, + 'DeleteFunctionGraphInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'deleteFunctionGraph', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphCommit.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphCommit.ts new file mode 100644 index 0000000000..65426339ae --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphCommit.ts @@ -0,0 +1,250 @@ +/** + * FunctionGraphCommit model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphCommit, + FunctionGraphCommitWithRelations, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, + CreateFunctionGraphCommitInput, + UpdateFunctionGraphCommitInput, + FunctionGraphCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphCommitModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommits: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommits', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommit: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', + document, + variables, + transform: (data: { + functionGraphCommits?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommit: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', + document, + variables, + transform: (data: { + functionGraphCommits?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphCommit', + 'createFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.data, + 'CreateFunctionGraphCommitInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'createFunctionGraphCommit', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphCommit', + 'updateFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphCommitInput', + 'id', + 'functionGraphCommitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'updateFunctionGraphCommit', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphCommit', + 'deleteFunctionGraphCommit', + 'functionGraphCommit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphCommitInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'deleteFunctionGraphCommit', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecution.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecution.ts new file mode 100644 index 0000000000..36ba0d39b8 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecution.ts @@ -0,0 +1,252 @@ +/** + * FunctionGraphExecution model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecution, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, + CreateFunctionGraphExecutionInput, + UpdateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecutions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecution: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', + document, + variables, + transform: (data: { + functionGraphExecutions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecution: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', + document, + variables, + transform: (data: { + functionGraphExecutions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecution', + 'createFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.data, + 'CreateFunctionGraphExecutionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'createFunctionGraphExecution', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + startedAt: string; + }, + FunctionGraphExecutionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecution', + 'updateFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionInput', + 'id', + 'functionGraphExecutionPatch', + connectionFieldsMap, + { + startedAt: args.where.startedAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'updateFunctionGraphExecution', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + startedAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecution', + 'deleteFunctionGraphExecution', + 'functionGraphExecution', + { + id: args.where.id, + startedAt: args.where.startedAt, + }, + 'DeleteFunctionGraphExecutionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'deleteFunctionGraphExecution', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionNodeState.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionNodeState.ts new file mode 100644 index 0000000000..734317c006 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionNodeState.ts @@ -0,0 +1,278 @@ +/** + * FunctionGraphExecutionNodeState model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionNodeState, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, + CreateFunctionGraphExecutionNodeStateInput, + UpdateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionNodeStateModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeStates', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', + document, + variables, + transform: (data: { + functionGraphExecutionNodeStates?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', + document, + variables, + transform: (data: { + functionGraphExecutionNodeStates?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs< + S, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionNodeState', + 'createFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.data, + 'CreateFunctionGraphExecutionNodeStateInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'createFunctionGraphExecutionNodeState', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionNodeStatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionNodeState', + 'updateFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionNodeStateInput', + 'id', + 'functionGraphExecutionNodeStatePatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'updateFunctionGraphExecutionNodeState', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionNodeState', + 'deleteFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionNodeStateInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'deleteFunctionGraphExecutionNodeState', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionOutput.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionOutput.ts new file mode 100644 index 0000000000..c9a5085e5e --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphExecutionOutput.ts @@ -0,0 +1,266 @@ +/** + * FunctionGraphExecutionOutput model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionOutput, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, + CreateFunctionGraphExecutionOutputInput, + UpdateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionOutputModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutputs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', + document, + variables, + transform: (data: { + functionGraphExecutionOutputs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', + document, + variables, + transform: (data: { + functionGraphExecutionOutputs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionOutput', + 'createFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.data, + 'CreateFunctionGraphExecutionOutputInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'createFunctionGraphExecutionOutput', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionOutputPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionOutput', + 'updateFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionOutputInput', + 'id', + 'functionGraphExecutionOutputPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'updateFunctionGraphExecutionOutput', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionOutput', + 'deleteFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionOutputInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'deleteFunctionGraphExecutionOutput', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphObject.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphObject.ts new file mode 100644 index 0000000000..cf946855ac --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphObject.ts @@ -0,0 +1,236 @@ +/** + * FunctionGraphObject model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphObject, + FunctionGraphObjectWithRelations, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, + CreateFunctionGraphObjectInput, + UpdateFunctionGraphObjectInput, + FunctionGraphObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphObjectModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObjects: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObjects', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObject: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', + document, + variables, + transform: (data: { + functionGraphObjects?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphObject: data.functionGraphObjects?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObject: InferSelectResult | null; + }> { + const { document, variables } = buildFindOneDocument( + 'FunctionGraphObject', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', + document, + variables, + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphObject', + 'createFunctionGraphObject', + 'functionGraphObject', + args.select, + args.data, + 'CreateFunctionGraphObjectInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'createFunctionGraphObject', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphObject', + 'updateFunctionGraphObject', + 'functionGraphObject', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphObjectInput', + 'id', + 'functionGraphObjectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'updateFunctionGraphObject', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphObject', + 'deleteFunctionGraphObject', + 'functionGraphObject', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphObjectInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'deleteFunctionGraphObject', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphRef.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphRef.ts new file mode 100644 index 0000000000..22d8769625 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphRef.ts @@ -0,0 +1,250 @@ +/** + * FunctionGraphRef model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphRef, + FunctionGraphRefWithRelations, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, + CreateFunctionGraphRefInput, + UpdateFunctionGraphRefInput, + FunctionGraphRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphRefModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRefs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRefs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRef: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', + document, + variables, + transform: (data: { + functionGraphRefs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRef: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', + document, + variables, + transform: (data: { + functionGraphRefs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphRef', + 'createFunctionGraphRef', + 'functionGraphRef', + args.select, + args.data, + 'CreateFunctionGraphRefInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'createFunctionGraphRef', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphRef', + 'updateFunctionGraphRef', + 'functionGraphRef', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphRefInput', + 'id', + 'functionGraphRefPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'updateFunctionGraphRef', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphRef', + 'deleteFunctionGraphRef', + 'functionGraphRef', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphRefInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'deleteFunctionGraphRef', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionGraphStore.ts b/sdk/constructive-cli/src/compute/orm/models/functionGraphStore.ts new file mode 100644 index 0000000000..6d1f384449 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionGraphStore.ts @@ -0,0 +1,245 @@ +/** + * FunctionGraphStore model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphStore, + FunctionGraphStoreWithRelations, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, + CreateFunctionGraphStoreInput, + UpdateFunctionGraphStoreInput, + FunctionGraphStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphStoreModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStores: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStores', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStore: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', + document, + variables, + transform: (data: { + functionGraphStores?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStore: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', + document, + variables, + transform: (data: { + functionGraphStores?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphStore', + 'createFunctionGraphStore', + 'functionGraphStore', + args.select, + args.data, + 'CreateFunctionGraphStoreInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'createFunctionGraphStore', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphStore', + 'updateFunctionGraphStore', + 'functionGraphStore', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphStoreInput', + 'id', + 'functionGraphStorePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'updateFunctionGraphStore', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphStore', + 'deleteFunctionGraphStore', + 'functionGraphStore', + { + id: args.where.id, + }, + 'DeleteFunctionGraphStoreInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'deleteFunctionGraphStore', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/functionInvocation.ts b/sdk/constructive-cli/src/compute/orm/models/functionInvocation.ts new file mode 100644 index 0000000000..3589bf5a1d --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/functionInvocation.ts @@ -0,0 +1,250 @@ +/** + * FunctionInvocation model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionInvocation, + FunctionInvocationWithRelations, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, + CreateFunctionInvocationInput, + UpdateFunctionInvocationInput, + FunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionInvocationModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocations: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocations', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', + document, + variables, + transform: (data: { + functionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', + document, + variables, + transform: (data: { + functionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionInvocation', + 'createFunctionInvocation', + 'functionInvocation', + args.select, + args.data, + 'CreateFunctionInvocationInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'createFunctionInvocation', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocation', + 'updateFunctionInvocation', + 'functionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationInput', + 'id', + 'functionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'updateFunctionInvocation', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocation', + 'deleteFunctionInvocation', + 'functionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'deleteFunctionInvocation', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/getAllRecord.ts b/sdk/constructive-cli/src/compute/orm/models/getAllRecord.ts new file mode 100644 index 0000000000..39a82fbbba --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/getAllRecord.ts @@ -0,0 +1,134 @@ +/** + * GetAllRecord model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GetAllRecord, + GetAllRecordWithRelations, + GetAllRecordSelect, + GetAllRecordFilter, + GetAllRecordsOrderBy, + CreateGetAllRecordInput, + UpdateGetAllRecordInput, + GetAllRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class GetAllRecordModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + getAll: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'GetAllRecord', + 'getAll', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GetAllRecordFilter', + 'GetAllRecordsOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GetAllRecord', + fieldName: 'getAll', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + getAllRecord: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'GetAllRecord', + 'getAll', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllRecordFilter', + 'GetAllRecordsOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GetAllRecord', + fieldName: 'getAllRecord', + document, + variables, + transform: (data: { + getAll?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + getAllRecord: data.getAll?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createGetAllRecord: { + getAllRecord: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'GetAllRecord', + 'createGetAllRecord', + 'getAllRecord', + args.select, + args.data, + 'CreateGetAllRecordInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GetAllRecord', + fieldName: 'createGetAllRecord', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/index.ts b/sdk/constructive-cli/src/compute/orm/models/index.ts new file mode 100644 index 0000000000..51e9b9f05d --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/index.ts @@ -0,0 +1,23 @@ +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export { GetAllRecordModel } from './getAllRecord'; +export { FunctionApiBindingModel } from './functionApiBinding'; +export { FunctionDeploymentModel } from './functionDeployment'; +export { FunctionGraphRefModel } from './functionGraphRef'; +export { FunctionGraphStoreModel } from './functionGraphStore'; +export { FunctionGraphObjectModel } from './functionGraphObject'; +export { FunctionDeploymentEventModel } from './functionDeploymentEvent'; +export { OrgFunctionExecutionLogModel } from './orgFunctionExecutionLog'; +export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutput'; +export { FunctionGraphCommitModel } from './functionGraphCommit'; +export { SecretDefinitionModel } from './secretDefinition'; +export { FunctionExecutionLogModel } from './functionExecutionLog'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; +export { FunctionGraphModel } from './functionGraph'; +export { OrgFunctionInvocationModel } from './orgFunctionInvocation'; +export { FunctionInvocationModel } from './functionInvocation'; +export { FunctionGraphExecutionModel } from './functionGraphExecution'; +export { FunctionDefinitionModel } from './functionDefinition'; diff --git a/sdk/constructive-cli/src/compute/orm/models/orgFunctionExecutionLog.ts b/sdk/constructive-cli/src/compute/orm/models/orgFunctionExecutionLog.ts new file mode 100644 index 0000000000..95b37a939d --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/orgFunctionExecutionLog.ts @@ -0,0 +1,252 @@ +/** + * OrgFunctionExecutionLog model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + OrgFunctionExecutionLog, + OrgFunctionExecutionLogWithRelations, + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy, + CreateOrgFunctionExecutionLogInput, + UpdateOrgFunctionExecutionLogInput, + OrgFunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgFunctionExecutionLogModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLogs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLog', + document, + variables, + transform: (data: { + orgFunctionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionExecutionLog: data.orgFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLog', + document, + variables, + transform: (data: { + orgFunctionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionExecutionLog: data.orgFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgFunctionExecutionLog', + 'createOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + args.select, + args.data, + 'CreateOrgFunctionExecutionLogInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'createOrgFunctionExecutionLog', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgFunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'OrgFunctionExecutionLog', + 'updateOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateOrgFunctionExecutionLogInput', + 'id', + 'orgFunctionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'updateOrgFunctionExecutionLog', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'OrgFunctionExecutionLog', + 'deleteOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'deleteOrgFunctionExecutionLog', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/orgFunctionInvocation.ts b/sdk/constructive-cli/src/compute/orm/models/orgFunctionInvocation.ts new file mode 100644 index 0000000000..3f3eaab557 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/orgFunctionInvocation.ts @@ -0,0 +1,252 @@ +/** + * OrgFunctionInvocation model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + OrgFunctionInvocation, + OrgFunctionInvocationWithRelations, + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy, + CreateOrgFunctionInvocationInput, + UpdateOrgFunctionInvocationInput, + OrgFunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgFunctionInvocationModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocations: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocations', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocation', + document, + variables, + transform: (data: { + orgFunctionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionInvocation: data.orgFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocation', + document, + variables, + transform: (data: { + orgFunctionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionInvocation: data.orgFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgFunctionInvocation', + 'createOrgFunctionInvocation', + 'orgFunctionInvocation', + args.select, + args.data, + 'CreateOrgFunctionInvocationInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'createOrgFunctionInvocation', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgFunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'OrgFunctionInvocation', + 'updateOrgFunctionInvocation', + 'orgFunctionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateOrgFunctionInvocationInput', + 'id', + 'orgFunctionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'updateOrgFunctionInvocation', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'OrgFunctionInvocation', + 'deleteOrgFunctionInvocation', + 'orgFunctionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgFunctionInvocationInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'deleteOrgFunctionInvocation', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/models/secretDefinition.ts b/sdk/constructive-cli/src/compute/orm/models/secretDefinition.ts new file mode 100644 index 0000000000..09b9a0b956 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/models/secretDefinition.ts @@ -0,0 +1,245 @@ +/** + * SecretDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + SecretDefinition, + SecretDefinitionWithRelations, + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy, + CreateSecretDefinitionInput, + UpdateSecretDefinitionInput, + SecretDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class SecretDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinitions: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinition', + document, + variables, + transform: (data: { + secretDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + secretDefinition: data.secretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinition', + document, + variables, + transform: (data: { + secretDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + secretDefinition: data.secretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'SecretDefinition', + 'createSecretDefinition', + 'secretDefinition', + args.select, + args.data, + 'CreateSecretDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'createSecretDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + SecretDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'SecretDefinition', + 'updateSecretDefinition', + 'secretDefinition', + args.select, + args.where.id, + args.data, + 'UpdateSecretDefinitionInput', + 'id', + 'secretDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'updateSecretDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'SecretDefinition', + 'deleteSecretDefinition', + 'secretDefinition', + { + id: args.where.id, + }, + 'DeleteSecretDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'deleteSecretDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/compute/orm/mutation/index.ts b/sdk/constructive-cli/src/compute/orm/mutation/index.ts new file mode 100644 index 0000000000..b4abf9132b --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/mutation/index.ts @@ -0,0 +1,512 @@ +/** + * Custom mutation operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ValidateFunctionGraphInput, + InitEmptyRepoInput, + SetDataAtPathInput, + ImportDefinitionsInput, + CopyGraphInput, + SaveGraphInput, + AddEdgeAndSaveInput, + AddNodeAndSaveInput, + AddEdgeInput, + AddNodeInput, + ImportGraphJsonInput, + InsertNodeAtPathInput, + StartExecutionInput, + ProvisionBucketInput, + ValidateFunctionGraphPayload, + InitEmptyRepoPayload, + SetDataAtPathPayload, + ImportDefinitionsPayload, + CopyGraphPayload, + SaveGraphPayload, + AddEdgeAndSavePayload, + AddNodeAndSavePayload, + AddEdgePayload, + AddNodePayload, + ImportGraphJsonPayload, + InsertNodeAtPathPayload, + StartExecutionPayload, + ProvisionBucketPayload, + ValidateFunctionGraphPayloadSelect, + InitEmptyRepoPayloadSelect, + SetDataAtPathPayloadSelect, + ImportDefinitionsPayloadSelect, + CopyGraphPayloadSelect, + SaveGraphPayloadSelect, + AddEdgeAndSavePayloadSelect, + AddNodeAndSavePayloadSelect, + AddEdgePayloadSelect, + AddNodePayloadSelect, + ImportGraphJsonPayloadSelect, + InsertNodeAtPathPayloadSelect, + StartExecutionPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export interface ValidateFunctionGraphVariables { + input: ValidateFunctionGraphInput; +} +export interface InitEmptyRepoVariables { + input: InitEmptyRepoInput; +} +export interface SetDataAtPathVariables { + input: SetDataAtPathInput; +} +export interface ImportDefinitionsVariables { + input: ImportDefinitionsInput; +} +export interface CopyGraphVariables { + input: CopyGraphInput; +} +export interface SaveGraphVariables { + input: SaveGraphInput; +} +export interface AddEdgeAndSaveVariables { + input: AddEdgeAndSaveInput; +} +export interface AddNodeAndSaveVariables { + input: AddNodeAndSaveInput; +} +export interface AddEdgeVariables { + input: AddEdgeInput; +} +export interface AddNodeVariables { + input: AddNodeInput; +} +export interface ImportGraphJsonVariables { + input: ImportGraphJsonInput; +} +export interface InsertNodeAtPathVariables { + input: InsertNodeAtPathInput; +} +export interface StartExecutionVariables { + input: StartExecutionInput; +} +/** + * Variables for provisionBucket + * Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + */ +export interface ProvisionBucketVariables { + input: ProvisionBucketInput; +} +export function createMutationOperations(client: OrmClient) { + return { + validateFunctionGraph: ( + args: ValidateFunctionGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + validateFunctionGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ValidateFunctionGraph', + fieldName: 'validateFunctionGraph', + ...buildCustomDocument( + 'mutation', + 'ValidateFunctionGraph', + 'validateFunctionGraph', + options.select, + args, + [ + { + name: 'input', + type: 'ValidateFunctionGraphInput!', + }, + ], + connectionFieldsMap, + 'ValidateFunctionGraphPayload' + ), + }), + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), + importDefinitions: ( + args: ImportDefinitionsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importDefinitions: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportDefinitions', + fieldName: 'importDefinitions', + ...buildCustomDocument( + 'mutation', + 'ImportDefinitions', + 'importDefinitions', + options.select, + args, + [ + { + name: 'input', + type: 'ImportDefinitionsInput!', + }, + ], + connectionFieldsMap, + 'ImportDefinitionsPayload' + ), + }), + copyGraph: ( + args: CopyGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyGraph', + fieldName: 'copyGraph', + ...buildCustomDocument( + 'mutation', + 'CopyGraph', + 'copyGraph', + options.select, + args, + [ + { + name: 'input', + type: 'CopyGraphInput!', + }, + ], + connectionFieldsMap, + 'CopyGraphPayload' + ), + }), + saveGraph: ( + args: SaveGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + saveGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SaveGraph', + fieldName: 'saveGraph', + ...buildCustomDocument( + 'mutation', + 'SaveGraph', + 'saveGraph', + options.select, + args, + [ + { + name: 'input', + type: 'SaveGraphInput!', + }, + ], + connectionFieldsMap, + 'SaveGraphPayload' + ), + }), + addEdgeAndSave: ( + args: AddEdgeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdgeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdgeAndSave', + fieldName: 'addEdgeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddEdgeAndSave', + 'addEdgeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddEdgeAndSavePayload' + ), + }), + addNodeAndSave: ( + args: AddNodeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNodeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNodeAndSave', + fieldName: 'addNodeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddNodeAndSave', + 'addNodeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddNodeAndSavePayload' + ), + }), + addEdge: ( + args: AddEdgeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdge: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdge', + fieldName: 'addEdge', + ...buildCustomDocument( + 'mutation', + 'AddEdge', + 'addEdge', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeInput!', + }, + ], + connectionFieldsMap, + 'AddEdgePayload' + ), + }), + addNode: ( + args: AddNodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNode', + fieldName: 'addNode', + ...buildCustomDocument( + 'mutation', + 'AddNode', + 'addNode', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeInput!', + }, + ], + connectionFieldsMap, + 'AddNodePayload' + ), + }), + importGraphJson: ( + args: ImportGraphJsonVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importGraphJson: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportGraphJson', + fieldName: 'importGraphJson', + ...buildCustomDocument( + 'mutation', + 'ImportGraphJson', + 'importGraphJson', + options.select, + args, + [ + { + name: 'input', + type: 'ImportGraphJsonInput!', + }, + ], + connectionFieldsMap, + 'ImportGraphJsonPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + startExecution: ( + args: StartExecutionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + startExecution: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'StartExecution', + fieldName: 'startExecution', + ...buildCustomDocument( + 'mutation', + 'StartExecution', + 'startExecution', + options.select, + args, + [ + { + name: 'input', + type: 'StartExecutionInput!', + }, + ], + connectionFieldsMap, + 'StartExecutionPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + }; +} diff --git a/sdk/constructive-cli/src/compute/orm/query-builder.ts b/sdk/constructive-cli/src/compute/orm/query-builder.ts new file mode 100644 index 0000000000..fd785bbae6 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/query-builder.ts @@ -0,0 +1,1047 @@ +/** + * Query Builder - Builds and executes GraphQL operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { parseType, print } from '@constructive-io/graphql-query/runtime'; +import * as t from 'gql-ast'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; + +import { GraphQLRequestError, OrmClient, QueryResult } from './client'; + +export interface QueryBuilderConfig { + client: OrmClient; + operation: 'query' | 'mutation'; + operationName: string; + fieldName: string; + document: string; + variables?: Record; + transform?: (data: any) => TResult; +} + +export class QueryBuilder { + private config: QueryBuilderConfig; + + constructor(config: QueryBuilderConfig) { + this.config = config; + } + + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + async execute(): Promise> { + const rawResult = await this.config.client.execute( + this.config.document, + this.config.variables + ); + if (!rawResult.ok) { + return rawResult; + } + if (!this.config.transform) { + return rawResult as unknown as QueryResult; + } + return { + ok: true, + data: this.config.transform(rawResult.data), + errors: undefined, + }; + } + + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + async unwrap(): Promise { + const result = await this.execute(); + if (!result.ok) { + throw new GraphQLRequestError(result.errors, result.data); + } + return result.data; + } + + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + async unwrapOr(defaultValue: D): Promise { + const result = await this.execute(); + if (!result.ok) { + return defaultValue; + } + return result.data; + } + + /** + * Execute and unwrap, calling onError callback on failure + */ + async unwrapOrElse( + onError: (errors: import('./client').GraphQLError[]) => D + ): Promise { + const result = await this.execute(); + if (!result.ok) { + return onError(result.errors); + } + return result.data; + } + + toGraphQL(): string { + return this.config.document; + } + + getVariables(): Record | undefined { + return this.config.variables; + } +} + +const OP_QUERY = 'query' as unknown as import('graphql').OperationTypeNode; +const OP_MUTATION = 'mutation' as unknown as import('graphql').OperationTypeNode; +const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; + +// ============================================================================ +// Selection Builders +// ============================================================================ + +export function buildSelections( + select: Record | undefined, + connectionFieldsMap?: Record>, + entityType?: string +): FieldNode[] { + if (!select) { + return []; + } + + const fields: FieldNode[] = []; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; + + for (const [key, value] of Object.entries(select)) { + if (value === false || value === undefined) { + continue; + } + + if (value === true) { + fields.push(t.field({ name: key })); + continue; + } + + if (typeof value === 'object' && value !== null) { + const nested = value as { + select?: Record; + args?: Record; + first?: number; + filter?: Record; + orderBy?: string[]; + connection?: boolean; + }; + + // Field with arguments (e.g. requestUploadUrl on bucket types) + if (nested.args && typeof nested.args === 'object') { + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) + ); + const nestedSelect = nested.select; + if (nestedSelect && typeof nestedSelect === 'object') { + const subSelections = Object.entries(nestedSelect) + .filter(([, v]) => v) + .map(([name]) => t.field({ name })); + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: subSelections.length + ? t.selectionSet({ selections: subSelections }) + : undefined, + }) + ); + } else { + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + }) + ); + } + continue; + } + + if (!nested.select || typeof nested.select !== 'object') { + throw new Error( + `Invalid selection for field "${key}": nested selections must include a "select" object.` + ); + } + + const relatedEntityType = entityConnections?.[key]; + const nestedSelections = buildSelections( + nested.select, + connectionFieldsMap, + relatedEntityType + ); + const isConnection = + nested.connection === true || + nested.first !== undefined || + nested.filter !== undefined || + relatedEntityType !== undefined; + const args = buildArgs([ + buildOptionalArg('first', nested.first), + nested.filter + ? t.argument({ + name: 'filter', + value: buildValueAst(nested.filter), + }) + : null, + buildEnumListArg('orderBy', nested.orderBy), + ]); + + if (isConnection) { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(nestedSelections), + }), + }) + ); + } else { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ selections: nestedSelections }), + }) + ); + } + } + } + + return fields; +} + +// ============================================================================ +// Document Builders +// ============================================================================ + +export function buildFindManyDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { + where?: TWhere; + orderBy?: string[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; + }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'first', typeName: 'Int', value: args.first }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'last', typeName: 'Int', value: args.last }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'after', typeName: 'Cursor', value: args.after }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'before', typeName: 'Cursor', value: args.before }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'offset', typeName: 'Int', value: args.offset }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs.length ? queryArgs : undefined, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(selections), + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildFindFirstDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { where?: TWhere; orderBy?: string[] }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + // Always add first: 1 for findFirst + addVariable( + { varName: 'first', typeName: 'Int', value: 1 }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildCreateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [entityField]: data, + }, + }, + }; +} + +export function buildUpdateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + patchFieldName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + id: where.id, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildUpdateByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + id: string | number, + data: TData, + inputTypeName: string, + idFieldName: string, + patchFieldName: string, + connectionFieldsMap?: Record>, + extraKeys?: Record +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [idFieldName]: id, + ...extraKeys, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildFindOneDocument( + operationName: string, + queryField: string, + id: string | number, + select: TSelect, + idArgName: string, + idTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = [ + t.variableDefinition({ + variable: t.variable({ name: idArgName }), + type: parseType(idTypeName), + }), + ]; + + const queryArgs: ArgumentNode[] = [ + t.argument({ + name: idArgName, + value: t.variable({ name: idArgName }), + }), + ]; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: { [idArgName]: id }, + }; +} + +export function buildDeleteDocument( + operationName: string, + mutationField: string, + entityField: string, + where: TWhere, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ + selections: entitySelections, + }), + }), + ], + }), + variables: { + input: { + id: where.id, + }, + }, + }; +} + +export function buildDeleteByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + keys: Record, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections: entitySelections }), + }), + ], + }), + variables: { + input: keys, + }, + }; +} + +export function buildJunctionRemoveDocument( + operationName: string, + mutationField: string, + keys: Record, + inputTypeName: string +): { document: string; variables: Record } { + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [t.field({ name: 'clientMutationId' })], + }), + variables: { + input: keys, + }, + }; +} + +export function buildCustomDocument( + operationType: 'query' | 'mutation', + operationName: string, + fieldName: string, + select: TSelect, + args: TArgs, + variableDefinitions: Array<{ name: string; type: string }>, + connectionFieldsMap?: Record>, + entityType?: string +): { document: string; variables: Record } { + let actualSelect: TSelect = select; + let isConnection = false; + + if (isCustomSelectionWrapper(select)) { + actualSelect = select.select as TSelect; + isConnection = select.connection === true; + } + + const selections = actualSelect + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) + : []; + + const variableDefs = variableDefinitions.map((definition) => + t.variableDefinition({ + variable: t.variable({ name: definition.name }), + type: parseType(definition.type), + }) + ); + const fieldArgs = variableDefinitions.map((definition) => + t.argument({ + name: definition.name, + value: t.variable({ name: definition.name }), + }) + ); + + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY, + name: operationName, + variableDefinitions: variableDefs.length ? variableDefs : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: fieldName, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: fieldSelections.length + ? t.selectionSet({ selections: fieldSelections }) + : undefined, + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: (args ?? {}) as Record, + }; +} + +function isCustomSelectionWrapper( + value: unknown +): value is { select: Record; connection?: boolean } { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + + const record = value as Record; + const keys = Object.keys(record); + + if (!keys.includes('select') || !keys.includes('connection')) { + return false; + } + + if (keys.some((key) => key !== 'select' && key !== 'connection')) { + return false; + } + + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); +} + +// ============================================================================ +// Helper Functions +// ============================================================================ + +function buildArgs(args: Array): ArgumentNode[] { + return args.filter((arg): arg is ArgumentNode => arg !== null); +} + +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { + if (value === undefined) { + return null; + } + const valueNode = + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); + return t.argument({ name, value: valueNode }); +} + +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { + if (!values || values.length === 0) { + return null; + } + return t.argument({ + name, + value: t.listValue({ + values: values.map((value) => buildEnumValue(value)), + }), + }); +} + +function buildEnumValue(value: string): EnumValueNode { + return { + kind: ENUM_VALUE_KIND, + value, + }; +} + +function buildPageInfoSelections(): FieldNode[] { + return [ + t.field({ name: 'hasNextPage' }), + t.field({ name: 'hasPreviousPage' }), + t.field({ name: 'startCursor' }), + t.field({ name: 'endCursor' }), + ]; +} + +function buildConnectionSelections(nodeSelections: FieldNode[]): FieldNode[] { + return [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections: nodeSelections }), + }), + t.field({ name: 'totalCount' }), + t.field({ + name: 'pageInfo', + selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }), + }), + ]; +} + +interface VariableSpec { + varName: string; + argName?: string; + typeName?: string; + value: unknown; +} + +interface InputMutationConfig { + operationName: string; + mutationField: string; + inputTypeName: string; + resultSelections: FieldNode[]; +} + +function buildInputMutationDocument(config: InputMutationConfig): string { + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_MUTATION, + name: config.operationName + 'Mutation', + variableDefinitions: [ + t.variableDefinition({ + variable: t.variable({ name: 'input' }), + type: parseType(config.inputTypeName + '!'), + }), + ], + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: config.mutationField, + args: [ + t.argument({ + name: 'input', + value: t.variable({ name: 'input' }), + }), + ], + selectionSet: t.selectionSet({ + selections: config.resultSelections, + }), + }), + ], + }), + }), + ], + }); + return print(document); +} + +function addVariable( + spec: VariableSpec, + definitions: VariableDefinitionNode[], + args: ArgumentNode[], + variables: Record +): void { + if (spec.value === undefined || !spec.typeName) return; + + definitions.push( + t.variableDefinition({ + variable: t.variable({ name: spec.varName }), + type: parseType(spec.typeName), + }) + ); + args.push( + t.argument({ + name: spec.argName ?? spec.varName, + value: t.variable({ name: spec.varName }), + }) + ); + variables[spec.varName] = spec.value; +} + +function buildValueAst( + value: unknown +): + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | EnumValueNode { + if (value === null) { + return t.nullValue(); + } + + if (typeof value === 'boolean') { + return t.booleanValue({ value }); + } + + if (typeof value === 'number') { + return Number.isInteger(value) + ? t.intValue({ value: value.toString() }) + : t.floatValue({ value: value.toString() }); + } + + if (typeof value === 'string') { + return t.stringValue({ value }); + } + + if (Array.isArray(value)) { + return t.listValue({ + values: value.map((item) => buildValueAst(item)), + }); + } + + if (typeof value === 'object' && value !== null) { + const obj = value as Record; + return t.objectValue({ + fields: Object.entries(obj).map(([key, val]) => + t.objectField({ + name: key, + value: buildValueAst(val), + }) + ), + }); + } + + throw new Error('Unsupported value type: ' + typeof value); +} + +// ============================================================================ +// Bulk Mutation Document Builders +// ============================================================================ + +export function buildBulkInsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict?: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + ...(onConflict ? { onConflict } : {}), + }, + }, + }; +} + +export function buildBulkUpsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + onConflict, + }, + }, + }; +} + +export function buildBulkUpdateDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + patch: data, + }, + }, + }; +} + +export function buildBulkDeleteDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + }, + }, + }; +} diff --git a/sdk/constructive-cli/src/compute/orm/query/index.ts b/sdk/constructive-cli/src/compute/orm/query/index.ts new file mode 100644 index 0000000000..505264ae62 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/query/index.ts @@ -0,0 +1,45 @@ +/** + * Custom query operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; +export interface ReadFunctionGraphVariables { + graphId?: string; +} +export function createQueryOperations(client: OrmClient) { + return { + readFunctionGraph: ( + args: ReadFunctionGraphVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + readFunctionGraph: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ReadFunctionGraph', + fieldName: 'readFunctionGraph', + ...buildCustomDocument( + 'query', + 'ReadFunctionGraph', + 'readFunctionGraph', + options?.select, + args, + [ + { + name: 'graphId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + }; +} diff --git a/sdk/constructive-cli/src/compute/orm/realtime.ts b/sdk/constructive-cli/src/compute/orm/realtime.ts new file mode 100644 index 0000000000..214eb56203 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/realtime.ts @@ -0,0 +1,244 @@ +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// Minimal type shims so this module compiles without graphql-ws +// installed. Consumers supply a WsClient via RealtimeConfig; +// the SDK itself never imports or requires graphql-ws. + +interface WsGraphQLError { + readonly message: string; + readonly [key: string]: unknown; +} + +interface WsExecutionResult> { + data?: TData | null; + errors?: readonly WsGraphQLError[]; + extensions?: Record; +} + +interface WsSink { + next(value: T): void; + error(error: unknown): void; + complete(): void; +} + +/** + * Minimal interface matching the graphql-ws Client. + * Consumers pass a concrete instance via RealtimeConfig.client. + */ +export interface WsClient { + subscribe>( + payload: { query: string; variables?: Record }, + sink: WsSink> + ): () => void; + dispose(): void; +} + +// ============================================================================ +// Types +// ============================================================================ + +/** The DML operation that triggered the subscription event */ +export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; + +/** Connection state of the WebSocket */ +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; + +/** Listener for connection state changes */ +export type ConnectionStateListener = (state: ConnectionState) => void; + +/** Function returned by subscribe() to cancel the subscription */ +export type Unsubscribe = () => void; + +/** + * A realtime subscription event delivered to the client. + * + * @typeParam T - The row type of the subscribed table + */ +export interface SubscriptionEvent { + /** The DML operation that triggered this event */ + operation: SubscriptionOperation; + /** The current row data (null for DELETE if row is no longer visible) */ + data: T | null; + /** Previous field values (populated on UPDATE when available) */ + previousValues?: Partial; + /** Server-side timestamp of when the change occurred */ + timestamp: string; +} + +/** + * Options for creating a subscription. + * + * @typeParam T - The row type of the subscribed table + * @typeParam TFilter - The filter type for the table + */ +export interface SubscribeOptions> { + /** Server-side filter to limit which events are delivered */ + filter?: TFilter; + /** Called when a subscription event is received */ + onEvent: (event: SubscriptionEvent) => void; + /** Called when the subscription encounters an error */ + onError?: (error: Error) => void; + /** Called when the subscription completes (server-initiated close) */ + onComplete?: () => void; +} + +/** + * Metadata about a subscription field, used internally to map + * table names to GraphQL subscription field names and types. + */ +export interface SubscriptionFieldMeta { + /** The GraphQL subscription field name (e.g., 'onContactChanged') */ + fieldName: string; + /** The table name in the source schema (e.g., 'contact') */ + tableName: string; + /** The data field name inside the subscription payload (e.g., 'contact') */ + dataFieldName: string; +} + +/** + * Configuration for the realtime (WebSocket) connection. + * Pass this as the `realtime` option in OrmClientConfig. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * + * const client = createOrmClient({ + * endpoint: 'https://api.example.com/graphql', + * realtime: { + * client: createClient({ url: 'wss://api.example.com/graphql' }), + * }, + * }); + * ``` + */ +export interface RealtimeConfig { + /** + * A graphql-ws Client instance (or any object satisfying WsClient). + * The consumer creates this themselves, giving full control over + * connection options, auth, and transport. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * const wsClient = createClient({ url: 'wss://...' }); + * ``` + */ + client: WsClient; +} + +// ============================================================================ +// RealtimeManager +// ============================================================================ + +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +export class RealtimeManager { + private wsClient: WsClient; + private connectionState: ConnectionState = 'disconnected'; + private stateListeners: Set = new Set(); + private activeSubscriptions = 0; + + constructor(config: RealtimeConfig) { + this.wsClient = config.client; + } + + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + this.activeSubscriptions++; + let disposed = false; + + const cleanup = this.wsClient.subscribe>( + { query: document, variables }, + { + next: (result) => { + if (disposed) return; + if (result.errors) { + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); + return; + } + + const payload = result.data?.[meta.fieldName] as + | { event?: string; [key: string]: unknown } + | undefined; + + if (!payload) return; + + const event: SubscriptionEvent = { + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', + data: (payload[meta.dataFieldName] as T) ?? null, + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), + }; + options.onEvent(event); + }, + error: (err) => { + if (disposed) return; + options.onError?.(err instanceof Error ? err : new Error(String(err))); + }, + complete: () => { + if (disposed) return; + options.onComplete?.(); + }, + } + ); + + return () => { + if (disposed) return; + disposed = true; + this.activeSubscriptions--; + cleanup(); + }; + } + + /** Register a listener for connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + this.stateListeners.add(listener); + return () => { + this.stateListeners.delete(listener); + }; + } + + /** Get current connection state */ + getConnectionState(): ConnectionState { + return this.connectionState; + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.activeSubscriptions; + } + + /** Dispose the manager and close the WebSocket connection */ + dispose(): void { + this.wsClient.dispose(); + this.stateListeners.clear(); + this.activeSubscriptions = 0; + this.setConnectionState('disconnected'); + } + + private setConnectionState(state: ConnectionState): void { + if (this.connectionState === state) return; + this.connectionState = state; + for (const listener of this.stateListeners) { + listener(state); + } + } +} diff --git a/sdk/constructive-cli/src/compute/orm/select-types.ts b/sdk/constructive-cli/src/compute/orm/select-types.ts new file mode 100644 index 0000000000..4b39d7e820 --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/select-types.ts @@ -0,0 +1,169 @@ +/** + * Type utilities for select inference + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} + +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} + +export interface FindManyArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +export interface FindFirstArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; +} + +export interface CreateArgs { + data: TData; + select?: TSelect; +} + +export interface UpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export type FindOneArgs = { + select?: TSelect; +} & Record; + +export interface DeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkInsertArgs { + data: TData[]; + select?: TSelect; + onConflict?: TOnConflict; +} + +export interface BulkUpsertArgs { + data: TData[]; + select?: TSelect; + onConflict: TOnConflict; +} + +export interface BulkUpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export interface BulkDeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkMutationResult { + affectedCount: number; + returning: T[]; +} + +type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +type DecrementDepth = { + 0: 0; + 1: 0; + 2: 1; + 3: 2; + 4: 3; + 5: 4; + 6: 5; + 7: 6; + 8: 7; + 9: 8; + 10: 9; +}; + +/** + * Recursively validates select objects, rejecting unknown keys. + * + * NOTE: Depth is intentionally capped to avoid circular-instantiation issues + * in very large cyclic schemas. + */ +export type DeepExact = Depth extends 0 + ? T extends Shape + ? T + : never + : T extends Shape + ? Exclude extends never + ? { + [K in keyof T]: K extends keyof Shape + ? T[K] extends { select: infer NS } + ? Extract extends { + select?: infer ShapeNS; + } + ? DeepExact< + Omit & { + select: DeepExact, DecrementDepth[Depth]>; + }, + Extract, + DecrementDepth[Depth] + > + : never + : T[K] + : never; + } + : never + : never; + +/** + * Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`. + * Use this as an intersection in overloads: + * `{ select: S } & StrictSelect`. + */ +export type StrictSelect = S extends DeepExact ? {} : never; + +/** + * Hook-optimized strict select variant. + * + * Uses a shallower recursion depth to keep editor autocomplete responsive + * in large schemas while still validating common nested-select mistakes. + */ +export type HookStrictSelect = S extends DeepExact ? {} : never; + +/** + * Infer result type from select configuration + */ +export type InferSelectResult = TSelect extends undefined + ? TEntity + : { + [K in keyof TSelect as TSelect[K] extends false | undefined + ? never + : K]: TSelect[K] extends true + ? K extends keyof TEntity + ? TEntity[K] + : never + : TSelect[K] extends { select: infer NestedSelect } + ? K extends keyof TEntity + ? NonNullable extends ConnectionResult + ? ConnectionResult> + : + | InferSelectResult, NestedSelect> + | (null extends TEntity[K] ? null : never) + : never + : K extends keyof TEntity + ? TEntity[K] + : never; + }; diff --git a/sdk/constructive-cli/src/compute/orm/types.ts b/sdk/constructive-cli/src/compute/orm/types.ts new file mode 100644 index 0000000000..7c1120bcdf --- /dev/null +++ b/sdk/constructive-cli/src/compute/orm/types.ts @@ -0,0 +1,8 @@ +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// Re-export all types from input-types +export * from './input-types'; diff --git a/sdk/constructive-cli/src/config-store.ts b/sdk/constructive-cli/src/config-store.ts new file mode 100644 index 0000000000..f324ec8fde --- /dev/null +++ b/sdk/constructive-cli/src/config-store.ts @@ -0,0 +1,149 @@ +/** + * Config store for the csdk CLI — manages named contexts (endpoint + credentials). + * Uses appstash for XDG-compliant directory resolution. + */ + +import * as fs from 'fs'; +import * as path from 'path'; +import { appstash, resolve } from 'appstash'; + +interface ContextConfig { + name: string; + endpoint: string; + createdAt?: string; + updatedAt?: string; +} + +interface GlobalSettings { + currentContext?: string; +} + +interface ContextCredentials { + token: string; + expiresAt?: string; + refreshToken?: string; +} + +interface Credentials { + tokens: Record; +} + +interface ConfigStore { + loadSettings(): GlobalSettings; + createContext(name: string, opts: { endpoint: string }): void; + listContexts(): ContextConfig[]; + setCurrentContext(name: string): void; + getCurrentContext(): (ContextConfig & { name: string }) | null; + deleteContext(name: string): void; + hasValidCredentials(name: string): boolean; +} + +export function getConfigStore(toolName: string): ConfigStore { + const dirs = appstash(toolName, { ensure: true }); + + function configPath(filename: string): string { + return resolve(dirs, 'config', filename); + } + + function contextsDir(): string { + const dir = resolve(dirs, 'config', 'contexts'); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + return dir; + } + + function loadSettings(): GlobalSettings { + const p = configPath('settings.json'); + if (fs.existsSync(p)) { + try { + return JSON.parse(fs.readFileSync(p, 'utf8')); + } catch { + return {}; + } + } + return {}; + } + + function saveSettings(settings: GlobalSettings): void { + const p = configPath('settings.json'); + const dir = path.dirname(p); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } + fs.writeFileSync(p, JSON.stringify(settings, null, 2)); + } + + function loadCredentials(): Credentials { + const p = configPath('credentials.json'); + if (fs.existsSync(p)) { + try { + return JSON.parse(fs.readFileSync(p, 'utf8')); + } catch { + return { tokens: {} }; + } + } + return { tokens: {} }; + } + + return { + loadSettings, + + createContext(name: string, opts: { endpoint: string }): void { + const now = new Date().toISOString(); + const ctx: ContextConfig = { name, endpoint: opts.endpoint, createdAt: now, updatedAt: now }; + const p = path.join(contextsDir(), `${name}.json`); + fs.writeFileSync(p, JSON.stringify(ctx, null, 2)); + }, + + listContexts(): ContextConfig[] { + const dir = contextsDir(); + const files = fs.readdirSync(dir).filter((f) => f.endsWith('.json')); + const contexts: ContextConfig[] = []; + for (const file of files) { + try { + contexts.push(JSON.parse(fs.readFileSync(path.join(dir, file), 'utf8'))); + } catch { + // skip + } + } + return contexts; + }, + + setCurrentContext(name: string): void { + const settings = loadSettings(); + settings.currentContext = name; + saveSettings(settings); + }, + + getCurrentContext(): (ContextConfig & { name: string }) | null { + const settings = loadSettings(); + if (!settings.currentContext) return null; + const p = path.join(contextsDir(), `${settings.currentContext}.json`); + if (!fs.existsSync(p)) return null; + try { + return JSON.parse(fs.readFileSync(p, 'utf8')); + } catch { + return null; + } + }, + + deleteContext(name: string): void { + const p = path.join(contextsDir(), `${name}.json`); + if (fs.existsSync(p)) fs.unlinkSync(p); + const settings = loadSettings(); + if (settings.currentContext === name) { + delete settings.currentContext; + saveSettings(settings); + } + }, + + hasValidCredentials(name: string): boolean { + const creds = loadCredentials(); + const ctx = creds.tokens[name]; + if (!ctx || !ctx.token) return false; + if (ctx.expiresAt && new Date(ctx.expiresAt) <= new Date()) return false; + return true; + }, + }; +} diff --git a/sdk/constructive-cli/src/config/README.md b/sdk/constructive-cli/src/config/README.md new file mode 100644 index 0000000000..43932f559c --- /dev/null +++ b/sdk/constructive-cli/src/config/README.md @@ -0,0 +1,47 @@ +# Generated GraphQL SDK + +

+ +

+ + + +## Overview + +- **Tables:** 2 +- **Custom queries:** 0 +- **Custom mutations:** 9 + +**Generators:** ORM, CLI + +## Modules + +### ORM Client (`./orm`) + +Prisma-like ORM client for programmatic GraphQL access. + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', +}); +``` + +See [orm/README.md](./orm/README.md) for full API reference. + +### CLI Commands (`./cli`) + +inquirerer-based CLI commands for `csdk`. + +See [cli/README.md](./cli/README.md) for command reference. + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-cli/src/config/app-dirs.ts b/sdk/constructive-cli/src/config/app-dirs.ts deleted file mode 100644 index 443ef7bff7..0000000000 --- a/sdk/constructive-cli/src/config/app-dirs.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Application directory management using appstash. - * - * Provides a standardized way to manage CLI tool configuration directories, - * including config, cache, data, and log directories following XDG conventions. - */ - -import { appstash, createConfigStore } from 'appstash'; - -/** - * Options for initializing application directories. - */ -export interface AppDirOptions { - /** Ensure directories are created if they don't exist */ - ensure?: boolean; -} - -/** - * Get the application directory paths for a CLI tool. - * Creates directories under ~/.toolName/ with standard subdirectories. - * - * @param toolName - The name of the CLI tool (e.g. 'my-cli') - * @param options - Options for directory initialization - * @returns Object with paths to config, cache, data, and log directories - */ -export function getAppDirs(toolName: string, options: AppDirOptions = {}) { - return appstash(toolName, { ensure: options.ensure ?? true }); -} - -/** - * Create a config store for a CLI tool. - * The config store manages contexts, credentials, and settings - * persisted to the filesystem. - * - * @param toolName - The name of the CLI tool - * @returns A config store instance with context and credential management - */ -export function getConfigStore(toolName: string) { - return createConfigStore(toolName); -} diff --git a/sdk/constructive-cli/src/config/cli/README.md b/sdk/constructive-cli/src/config/cli/README.md new file mode 100644 index 0000000000..921229256b --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/README.md @@ -0,0 +1,304 @@ +# csdk CLI + +

+ +

+ + + +## Setup + +```bash +# Create a context pointing at your GraphQL endpoint +csdk context create production --endpoint https://api.example.com/graphql + +# Set the active context +csdk context use production + +# Authenticate +csdk auth set-token +``` + +## Commands + +| Command | Description | +|---------|-------------| +| `context` | Manage API contexts (endpoints) | +| `auth` | Manage authentication tokens | +| `config` | Manage config key-value store (per-context) | +| `platform-config-definition` | platformConfigDefinition CRUD operations | +| `platform-config` | platformConfig CRUD operations | +| `platform-secrets-del` | platformSecretsDel | +| `org-secrets-del` | orgSecretsDel | +| `platform-secrets-remove-array` | platformSecretsRemoveArray | +| `org-secrets-remove-array` | orgSecretsRemoveArray | +| `platform-secrets-rotate` | platformSecretsRotate | +| `platform-secrets-set` | platformSecretsSet | +| `org-secrets-rotate` | orgSecretsRotate | +| `org-secrets-set` | orgSecretsSet | +| `provision-bucket` | Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. | + +## Infrastructure Commands + +### `context` + +Manage named API contexts (kubectl-style). + +| Subcommand | Description | +|------------|-------------| +| `create --endpoint ` | Create a new context | +| `list` | List all contexts | +| `use ` | Set the active context | +| `current` | Show current context | +| `delete ` | Delete a context | + +Configuration is stored at `~/.csdk/config/`. + +### `auth` + +Manage authentication tokens per context. + +| Subcommand | Description | +|------------|-------------| +| `set-token ` | Store bearer token for current context | +| `status` | Show auth status across all contexts | +| `logout` | Remove credentials for current context | + +### `config` + +Manage per-context key-value configuration variables. + +| Subcommand | Description | +|------------|-------------| +| `get ` | Get a config value | +| `set ` | Set a config value | +| `list` | List all config values | +| `delete ` | Delete a config value | + +Variables are scoped to the active context and stored at `~/.csdk/config/`. + +## Table Commands + +### `platform-config-definition` + +CRUD operations for PlatformConfigDefinition records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all platformConfigDefinition records | +| `find-first` | Find first matching platformConfigDefinition record | +| `get` | Get a platformConfigDefinition by id | +| `create` | Create a new platformConfigDefinition | +| `update` | Update an existing platformConfigDefinition | +| `delete` | Delete a platformConfigDefinition | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `name` | String | +| `description` | String | +| `defaultValue` | String | +| `isBuiltIn` | Boolean | +| `labels` | JSON | +| `annotations` | JSON | + +**Required create fields:** `name` +**Optional create fields (backend defaults):** `description`, `defaultValue`, `isBuiltIn`, `labels`, `annotations` + +### `platform-config` + +CRUD operations for PlatformConfig records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all platformConfig records | +| `find-first` | Find first matching platformConfig record | +| `get` | Get a platformConfig by id | +| `create` | Create a new platformConfig | +| `update` | Update an existing platformConfig | +| `delete` | Delete a platformConfig | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `namespaceId` | UUID | +| `name` | String | +| `value` | String | +| `labels` | JSON | +| `annotations` | JSON | +| `description` | String | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `expiresAt` | Datetime | + +**Required create fields:** `namespaceId`, `name` +**Optional create fields (backend defaults):** `value`, `labels`, `annotations`, `description`, `expiresAt` + +## Custom Operations + +### `platform-secrets-del` + +platformSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.secretName` | String | + | `--input.namespaceId` | UUID | + +### `org-secrets-del` + +orgSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.ownerId` | UUID | + | `--input.secretName` | String | + | `--input.namespaceId` | UUID | + +### `platform-secrets-remove-array` + +platformSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.secretNames` | String | + | `--input.namespaceId` | UUID | + +### `org-secrets-remove-array` + +orgSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.ownerId` | UUID | + | `--input.secretNames` | String | + | `--input.namespaceId` | UUID | + +### `platform-secrets-rotate` + +platformSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.secretName` | String | + | `--input.secretValue` | String | + | `--input.namespaceId` | UUID | + | `--input.algo` | String | + +### `platform-secrets-set` + +platformSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.secretName` | String | + | `--input.secretValue` | String | + | `--input.secretNamespaceId` | UUID | + | `--input.algo` | String | + +### `org-secrets-rotate` + +orgSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.ownerId` | UUID | + | `--input.secretName` | String | + | `--input.secretValue` | String | + | `--input.namespaceId` | UUID | + | `--input.algo` | String | + +### `org-secrets-set` + +orgSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.scopeOwnerId` | UUID | + | `--input.secretName` | String | + | `--input.secretValue` | String | + | `--input.secretNamespaceId` | UUID | + | `--input.algo` | String | + +### `provision-bucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.bucketKey` | String (required) | + | `--input.ownerId` | UUID | + +## Output + +All commands output JSON to stdout. Pipe to `jq` for formatting: + +```bash +csdk car list | jq '.[]' +csdk car get --id | jq '.' +``` + +## Non-Interactive Mode + +Use `--no-tty` to skip all interactive prompts (useful for scripts and CI): + +```bash +csdk --no-tty car create --name "Sedan" --year 2024 +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-cli/src/config/cli/commands.ts b/sdk/constructive-cli/src/config/cli/commands.ts new file mode 100644 index 0000000000..dddc9888c3 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands.ts @@ -0,0 +1,75 @@ +/** + * CLI command map and entry point + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import contextCmd from './commands/context'; +import authCmd from './commands/auth'; +import platformConfigDefinitionCmd from './commands/platform-config-definition'; +import platformConfigCmd from './commands/platform-config'; +import platformSecretsDelCmd from './commands/platform-secrets-del'; +import orgSecretsDelCmd from './commands/org-secrets-del'; +import platformSecretsRemoveArrayCmd from './commands/platform-secrets-remove-array'; +import orgSecretsRemoveArrayCmd from './commands/org-secrets-remove-array'; +import platformSecretsRotateCmd from './commands/platform-secrets-rotate'; +import platformSecretsSetCmd from './commands/platform-secrets-set'; +import orgSecretsRotateCmd from './commands/org-secrets-rotate'; +import orgSecretsSetCmd from './commands/org-secrets-set'; +import provisionBucketCmd from './commands/provision-bucket'; +const createCommandMap: () => Record< + string, + ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions + ) => Promise +> = () => ({ + context: contextCmd, + auth: authCmd, + 'platform-config-definition': platformConfigDefinitionCmd, + 'platform-config': platformConfigCmd, + 'platform-secrets-del': platformSecretsDelCmd, + 'org-secrets-del': orgSecretsDelCmd, + 'platform-secrets-remove-array': platformSecretsRemoveArrayCmd, + 'org-secrets-remove-array': orgSecretsRemoveArrayCmd, + 'platform-secrets-rotate': platformSecretsRotateCmd, + 'platform-secrets-set': platformSecretsSetCmd, + 'org-secrets-rotate': orgSecretsRotateCmd, + 'org-secrets-set': orgSecretsSetCmd, + 'provision-bucket': provisionBucketCmd, +}); +const usage = + '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n platform-config-definition platformConfigDefinition CRUD operations\n platform-config platformConfig CRUD operations\n platform-secrets-del platformSecretsDel\n org-secrets-del orgSecretsDel\n platform-secrets-remove-array platformSecretsRemoveArray\n org-secrets-remove-array orgSecretsRemoveArray\n platform-secrets-rotate platformSecretsRotate\n platform-secrets-set platformSecretsSet\n org-secrets-rotate orgSecretsRotate\n org-secrets-set orgSecretsSet\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n'; +export const commands = async ( + argv: Partial>, + prompter: Inquirerer, + options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + let { first: command, newArgv } = extractFirst(argv); + const commandMap = createCommandMap(); + if (!command) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'command', + message: 'What do you want to do?', + options: Object.keys(commandMap), + }, + ]); + command = answer.command as string; + } + const commandFn = commandMap[command]; + if (!commandFn) { + console.log(usage); + console.error(`Unknown command: ${command}`); + process.exit(1); + } + await commandFn(newArgv, prompter, options); + prompter.close(); + return argv; +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/auth.ts b/sdk/constructive-cli/src/config/cli/commands/auth.ts new file mode 100644 index 0000000000..c731ba27ca --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/auth.ts @@ -0,0 +1,122 @@ +/** + * Authentication commands + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk auth \n\nCommands:\n set-token Set API token for the current context\n status Show authentication status\n logout Remove credentials for the current context\n\nOptions:\n --context Specify context (defaults to current context)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const store = getStore(); + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['set-token', 'status', 'logout'], + }, + ]); + return handleAuthSubcommand(answer.subcommand as string, newArgv, prompter, store); + } + return handleAuthSubcommand(subcommand, newArgv, prompter, store); +}; +async function handleAuthSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + switch (subcommand) { + case 'set-token': + return handleSetToken(argv, prompter, store); + case 'status': + return handleStatus(store); + case 'logout': + return handleLogout(argv, prompter, store); + default: + console.log(usage); + process.exit(1); + } +} +async function handleSetToken( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const current = store.getCurrentContext(); + if (!current) { + console.error('No active context. Run "context create" first.'); + process.exit(1); + } + const { first: token } = extractFirst(argv); + let tokenValue = token; + if (!tokenValue) { + const answer = await prompter.prompt(argv, [ + { + type: 'password', + name: 'token', + message: 'API Token', + required: true, + }, + ]); + tokenValue = answer.token as string; + } + store.setCredentials(current.name, { + token: String(tokenValue || '').trim(), + }); + console.log(`Token saved for context: ${current.name}`); +} +function handleStatus(store: ReturnType) { + const contexts = store.listContexts(); + const settings = store.loadSettings(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + console.log('Authentication Status:'); + for (const ctx of contexts) { + const isCurrent = ctx.name === settings.currentContext; + const hasAuth = store.hasValidCredentials(ctx.name); + const marker = isCurrent ? '* ' : ' '; + const status = hasAuth ? 'authenticated' : 'no token'; + console.log(`${marker}${ctx.name} [${status}]`); + } +} +async function handleLogout( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const current = store.getCurrentContext(); + if (!current) { + console.log('No active context.'); + return; + } + const confirm = await prompter.prompt(argv, [ + { + type: 'confirm', + name: 'confirm', + message: `Remove credentials for "${current.name}"?`, + default: false, + }, + ]); + if (!(confirm.confirm as boolean)) { + return; + } + if (store.removeCredentials(current.name)) { + console.log(`Credentials removed for: ${current.name}`); + } else { + console.log(`No credentials found for: ${current.name}`); + } +} diff --git a/sdk/constructive-cli/src/config/cli/commands/context.ts b/sdk/constructive-cli/src/config/cli/commands/context.ts new file mode 100644 index 0000000000..52d12c666b --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/context.ts @@ -0,0 +1,179 @@ +/** + * Context management commands + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getStore } from '../executor'; +const usage = + '\ncsdk context \n\nCommands:\n create Create a new context\n list List all contexts\n use Set the active context\n current Show current context\n delete Delete a context\n\nCreate Options:\n --endpoint GraphQL endpoint URL\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const store = getStore(); + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['create', 'list', 'use', 'current', 'delete'], + }, + ]); + return handleSubcommand(answer.subcommand as string, newArgv, prompter, store); + } + return handleSubcommand(subcommand, newArgv, prompter, store); +}; +async function handleSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + switch (subcommand) { + case 'create': + return handleCreate(argv, prompter, store); + case 'list': + return handleList(store); + case 'use': + return handleUse(argv, prompter, store); + case 'current': + return handleCurrent(store); + case 'delete': + return handleDelete(argv, prompter, store); + default: + console.log(usage); + process.exit(1); + } +} +async function handleCreate( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name, newArgv: restArgv } = extractFirst(argv); + const answers = (await prompter.prompt( + { + name, + ...restArgv, + }, + [ + { + type: 'text', + name: 'name', + message: 'Context name', + required: true, + }, + { + type: 'text', + name: 'endpoint', + message: 'GraphQL endpoint URL', + required: true, + }, + ] + )) as unknown as Record; + const contextName = answers.name; + const endpoint = answers.endpoint; + store.createContext(contextName, { + endpoint: endpoint, + }); + const settings = store.loadSettings(); + if (!settings.currentContext) { + store.setCurrentContext(contextName); + } + console.log(`Created context: ${contextName}`); + console.log(` Endpoint: ${endpoint}`); +} +function handleList(store: ReturnType) { + const contexts = store.listContexts(); + const settings = store.loadSettings(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + console.log('Contexts:'); + for (const ctx of contexts) { + const marker = ctx.name === settings.currentContext ? '* ' : ' '; + const authStatus = store.hasValidCredentials(ctx.name) ? '[authenticated]' : '[no token]'; + console.log(`${marker}${ctx.name} ${authStatus}`); + console.log(` Endpoint: ${ctx.endpoint}`); + } +} +async function handleUse( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); + const contexts = store.listContexts(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + let contextName = name; + if (!contextName) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context', + options: contexts.map((c) => c.name), + }, + ]); + contextName = answer.name as string; + } + if (store.setCurrentContext(contextName)) { + console.log(`Switched to context: ${contextName}`); + } else { + console.error(`Context "${contextName}" not found.`); + process.exit(1); + } +} +function handleCurrent(store: ReturnType) { + const current = store.getCurrentContext(); + if (!current) { + console.log('No current context set.'); + return; + } + console.log(`Current context: ${current.name}`); + console.log(` Endpoint: ${current.endpoint}`); + const hasAuth = store.hasValidCredentials(current.name); + console.log(` Auth: ${hasAuth ? 'authenticated' : 'not authenticated'}`); +} +async function handleDelete( + argv: Partial>, + prompter: Inquirerer, + store: ReturnType +) { + const { first: name } = extractFirst(argv); + const contexts = store.listContexts(); + if (contexts.length === 0) { + console.log('No contexts configured.'); + return; + } + let contextName = name; + if (!contextName) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'name', + message: 'Select context to delete', + options: contexts.map((c) => c.name), + }, + ]); + contextName = answer.name as string; + } + if (store.deleteContext(contextName)) { + console.log(`Deleted context: ${contextName}`); + } else { + console.error(`Context "${contextName}" not found.`); + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/config/cli/commands/org-secrets-del.ts b/sdk/constructive-cli/src/config/cli/commands/org-secrets-del.ts new file mode 100644 index 0000000000..a01ebabe32 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/org-secrets-del.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation orgSecretsDel + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { OrgSecretsDelVariables } from '../../orm/mutation'; +import type { OrgSecretsDelPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('org-secrets-del - orgSecretsDel\n\nUsage: org-secrets-del [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .orgSecretsDel( + parsedAnswers as unknown as OrgSecretsDelVariables, + { + select: selectFields, + } as unknown as { + select: OrgSecretsDelPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: orgSecretsDel'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/org-secrets-remove-array.ts b/sdk/constructive-cli/src/config/cli/commands/org-secrets-remove-array.ts new file mode 100644 index 0000000000..e8c120b6e2 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/org-secrets-remove-array.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation orgSecretsRemoveArray + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { OrgSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { OrgSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'org-secrets-remove-array - orgSecretsRemoveArray\n\nUsage: org-secrets-remove-array [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .orgSecretsRemoveArray( + parsedAnswers as unknown as OrgSecretsRemoveArrayVariables, + { + select: selectFields, + } as unknown as { + select: OrgSecretsRemoveArrayPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: orgSecretsRemoveArray'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/org-secrets-rotate.ts b/sdk/constructive-cli/src/config/cli/commands/org-secrets-rotate.ts new file mode 100644 index 0000000000..465a4eceb7 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/org-secrets-rotate.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation orgSecretsRotate + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { OrgSecretsRotateVariables } from '../../orm/mutation'; +import type { OrgSecretsRotatePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('org-secrets-rotate - orgSecretsRotate\n\nUsage: org-secrets-rotate [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .orgSecretsRotate( + parsedAnswers as unknown as OrgSecretsRotateVariables, + { + select: selectFields, + } as unknown as { + select: OrgSecretsRotatePayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: orgSecretsRotate'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/org-secrets-set.ts b/sdk/constructive-cli/src/config/cli/commands/org-secrets-set.ts new file mode 100644 index 0000000000..f7a440ee00 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/org-secrets-set.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation orgSecretsSet + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { OrgSecretsSetVariables } from '../../orm/mutation'; +import type { OrgSecretsSetPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('org-secrets-set - orgSecretsSet\n\nUsage: org-secrets-set [OPTIONS]\n'); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .orgSecretsSet( + parsedAnswers as unknown as OrgSecretsSetVariables, + { + select: selectFields, + } as unknown as { + select: OrgSecretsSetPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: orgSecretsSet'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-config-definition.ts b/sdk/constructive-cli/src/config/cli/commands/platform-config-definition.ts new file mode 100644 index 0000000000..6a6cb0991b --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/platform-config-definition.ts @@ -0,0 +1,381 @@ +/** + * CLI commands for PlatformConfigDefinition + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformConfigDefinitionInput, + PlatformConfigDefinitionPatch, + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + createdAt: 'string', + updatedAt: 'string', + name: 'string', + description: 'string', + defaultValue: 'string', + isBuiltIn: 'boolean', + labels: 'json', + annotations: 'json', +}; +const usage = + '\nplatform-config-definition \n\nCommands:\n list List platformConfigDefinition records\n find-first Find first matching platformConfigDefinition record\n get Get a platformConfigDefinition by ID\n create Create a new platformConfigDefinition\n update Update an existing platformConfigDefinition\n delete Delete a platformConfigDefinition\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + defaultValue: true, + isBuiltIn: true, + labels: true, + annotations: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + > & { + select: PlatformConfigDefinitionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.platformConfigDefinition.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + defaultValue: true, + isBuiltIn: true, + labels: true, + annotations: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + > & { + select: PlatformConfigDefinitionSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.platformConfigDefinition.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.platformConfigDefinition + .findOne({ + id: answers.id as string, + select: { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + defaultValue: true, + isBuiltIn: true, + labels: true, + annotations: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultValue', + message: 'defaultValue', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBuiltIn', + message: 'isBuiltIn', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformConfigDefinitionInput['platformConfigDefinition']; + const client = getClient(); + const result = await client.platformConfigDefinition + .create({ + data: { + name: cleanedData.name, + description: cleanedData.description, + defaultValue: cleanedData.defaultValue, + isBuiltIn: cleanedData.isBuiltIn, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + defaultValue: true, + isBuiltIn: true, + labels: true, + annotations: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultValue', + message: 'defaultValue', + required: false, + skipPrompt: true, + }, + { + type: 'boolean', + name: 'isBuiltIn', + message: 'isBuiltIn', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as PlatformConfigDefinitionPatch; + const client = getClient(); + const result = await client.platformConfigDefinition + .update({ + where: { + id: answers.id as string, + }, + data: { + name: cleanedData.name, + description: cleanedData.description, + defaultValue: cleanedData.defaultValue, + isBuiltIn: cleanedData.isBuiltIn, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + name: true, + description: true, + defaultValue: true, + isBuiltIn: true, + labels: true, + annotations: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.platformConfigDefinition + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-config.ts b/sdk/constructive-cli/src/config/cli/commands/platform-config.ts new file mode 100644 index 0000000000..d8e1398c75 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/platform-config.ts @@ -0,0 +1,393 @@ +/** + * CLI commands for PlatformConfig + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreatePlatformConfigInput, + PlatformConfigPatch, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + namespaceId: 'uuid', + name: 'string', + value: 'string', + labels: 'json', + annotations: 'json', + description: 'string', + createdAt: 'string', + updatedAt: 'string', + expiresAt: 'string', +}; +const usage = + '\nplatform-config \n\nCommands:\n list List platformConfig records\n find-first Find first matching platformConfig record\n get Get a platformConfig by ID\n create Create a new platformConfig\n update Update an existing platformConfig\n delete Delete a platformConfig\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + namespaceId: true, + name: true, + value: true, + labels: true, + annotations: true, + description: true, + createdAt: true, + updatedAt: true, + expiresAt: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PlatformConfigSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.platformConfig.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + namespaceId: true, + name: true, + value: true, + labels: true, + annotations: true, + description: true, + createdAt: true, + updatedAt: true, + expiresAt: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PlatformConfigSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.platformConfig.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.platformConfig + .findOne({ + id: answers.id as string, + select: { + id: true, + namespaceId: true, + name: true, + value: true, + labels: true, + annotations: true, + description: true, + createdAt: true, + updatedAt: true, + expiresAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'value', + message: 'value', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePlatformConfigInput['platformConfig']; + const client = getClient(); + const result = await client.platformConfig + .create({ + data: { + namespaceId: cleanedData.namespaceId, + name: cleanedData.name, + value: cleanedData.value, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + description: cleanedData.description, + expiresAt: cleanedData.expiresAt, + }, + select: { + id: true, + namespaceId: true, + name: true, + value: true, + labels: true, + annotations: true, + description: true, + createdAt: true, + updatedAt: true, + expiresAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'namespaceId', + message: 'namespaceId', + required: false, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + }, + { + type: 'text', + name: 'value', + message: 'value', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'labels', + message: 'labels', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'annotations', + message: 'annotations', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'description', + message: 'description', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as PlatformConfigPatch; + const client = getClient(); + const result = await client.platformConfig + .update({ + where: { + id: answers.id as string, + }, + data: { + namespaceId: cleanedData.namespaceId, + name: cleanedData.name, + value: cleanedData.value, + labels: cleanedData.labels, + annotations: cleanedData.annotations, + description: cleanedData.description, + expiresAt: cleanedData.expiresAt, + }, + select: { + id: true, + namespaceId: true, + name: true, + value: true, + labels: true, + annotations: true, + description: true, + createdAt: true, + updatedAt: true, + expiresAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.platformConfig + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-del.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-del.ts new file mode 100644 index 0000000000..d652e01e14 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-del.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation platformSecretsDel + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsDelVariables } from '../../orm/mutation'; +import type { PlatformSecretsDelPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'platform-secrets-del - platformSecretsDel\n\nUsage: platform-secrets-del [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsDel( + parsedAnswers as unknown as PlatformSecretsDelVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsDelPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: platformSecretsDel'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-remove-array.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-remove-array.ts new file mode 100644 index 0000000000..51fc5b749f --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-remove-array.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation platformSecretsRemoveArray + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { PlatformSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'platform-secrets-remove-array - platformSecretsRemoveArray\n\nUsage: platform-secrets-remove-array [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsRemoveArray( + parsedAnswers as unknown as PlatformSecretsRemoveArrayVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsRemoveArrayPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: platformSecretsRemoveArray'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-rotate.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-rotate.ts new file mode 100644 index 0000000000..5e9969743e --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-rotate.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation platformSecretsRotate + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsRotateVariables } from '../../orm/mutation'; +import type { PlatformSecretsRotatePayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'platform-secrets-rotate - platformSecretsRotate\n\nUsage: platform-secrets-rotate [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsRotate( + parsedAnswers as unknown as PlatformSecretsRotateVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsRotatePayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: platformSecretsRotate'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/platform-secrets-set.ts b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-set.ts new file mode 100644 index 0000000000..9be1d837db --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/platform-secrets-set.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation platformSecretsSet + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { PlatformSecretsSetVariables } from '../../orm/mutation'; +import type { PlatformSecretsSetPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'platform-secrets-set - platformSecretsSet\n\nUsage: platform-secrets-set [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .platformSecretsSet( + parsedAnswers as unknown as PlatformSecretsSetVariables, + { + select: selectFields, + } as unknown as { + select: PlatformSecretsSetPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: platformSecretsSet'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/commands/provision-bucket.ts b/sdk/constructive-cli/src/config/cli/commands/provision-bucket.ts new file mode 100644 index 0000000000..ecd2e539d5 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/commands/provision-bucket.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation provisionBucket + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer } from 'inquirerer'; +import { getClient } from '../executor'; +import { unflattenDotNotation, buildSelectFromPaths } from '../utils'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'provision-bucket - Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\nUsage: provision-bucket [OPTIONS]\n' + ); + process.exit(0); + } + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'input', + message: + 'The exclusive input argument for this mutation. An object type, make sure to see documentation for this object\u2019s fields.', + required: true, + }, + ]); + const client = getClient(); + const parsedAnswers = unflattenDotNotation(answers); + const selectFields = buildSelectFromPaths((argv.select as string) ?? 'clientMutationId'); + const result = await client.mutation + .provisionBucket( + parsedAnswers as unknown as ProvisionBucketVariables, + { + select: selectFields, + } as unknown as { + select: ProvisionBucketPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: provisionBucket'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/config/cli/executor.ts b/sdk/constructive-cli/src/config/cli/executor.ts new file mode 100644 index 0000000000..50d150bce8 --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/executor.ts @@ -0,0 +1,34 @@ +/** + * Executor and config store for CLI + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { createConfigStore } from 'appstash'; +import { createClient } from '../orm'; +const store = createConfigStore('csdk'); +export const getStore = () => store; +export function getClient(contextName?: string) { + let ctx = null; + if (contextName) { + ctx = store.loadContext(contextName); + if (!ctx) { + throw new Error(`Context "${contextName}" not found.`); + } + } else { + ctx = store.getCurrentContext(); + if (!ctx) { + throw new Error('No active context. Run "context create" or "context use" first.'); + } + } + const headers: Record = {}; + if (store.hasValidCredentials(ctx.name)) { + const creds = store.getCredentials(ctx.name); + if (creds?.token) { + headers.Authorization = `Bearer ${creds.token}`; + } + } + return createClient({ + endpoint: ctx.endpoint, + headers: headers, + }); +} diff --git a/sdk/constructive-cli/src/config/cli/index.ts b/sdk/constructive-cli/src/config/cli/index.ts new file mode 100644 index 0000000000..9ca839a9ee --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/index.ts @@ -0,0 +1,29 @@ +/** + * CLI entry point + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLI, CLIOptions, getPackageJson } from 'inquirerer'; +import { commands } from './commands'; + +if (process.argv.includes('--version') || process.argv.includes('-v')) { + const pkg = getPackageJson(__dirname); + console.log(pkg.version); + process.exit(0); +} + +// Check for --tty false or --no-tty to enable non-interactive mode (noTty) +const ttyIdx = process.argv.indexOf('--tty'); +const noTty = + (ttyIdx !== -1 && process.argv[ttyIdx + 1] === 'false') || process.argv.includes('--no-tty'); + +const options: Partial = { + noTty, + minimistOpts: { alias: { v: 'version', h: 'help' } }, +}; + +const app = new CLI(commands, options); +app.run().catch((e) => { + console.error('Unexpected error:', e); + process.exit(1); +}); diff --git a/sdk/constructive-cli/src/config/cli/utils.ts b/sdk/constructive-cli/src/config/cli/utils.ts new file mode 100644 index 0000000000..78a7defb6f --- /dev/null +++ b/sdk/constructive-cli/src/config/cli/utils.ts @@ -0,0 +1,314 @@ +/** + * CLI utility functions for type coercion and input handling + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import objectPath from 'nested-obj'; + +export type FieldType = 'string' | 'boolean' | 'int' | 'float' | 'json' | 'uuid' | 'enum'; + +export interface FieldSchema { + [fieldName: string]: FieldType; +} + +/** + * Coerce CLI string arguments to their proper GraphQL types based on a field schema. + * CLI args always arrive as strings from minimist, but GraphQL expects + * Boolean, Int, Float, JSON, etc. + */ +export function coerceAnswers( + answers: Record, + schema: FieldSchema +): Record { + const result: Record = { ...answers }; + + for (const [key, value] of Object.entries(result)) { + const fieldType = schema[key]; + if (!fieldType || value === undefined || value === null) continue; + + const strValue = String(value); + + // Empty strings become undefined for non-string types + if (strValue === '' && fieldType !== 'string') { + result[key] = undefined; + continue; + } + + switch (fieldType) { + case 'boolean': + if (typeof value === 'boolean') break; + result[key] = strValue === 'true' || strValue === '1' || strValue === 'yes'; + break; + case 'int': + if (typeof value === 'number') break; + { + const parsed = parseInt(strValue, 10); + result[key] = isNaN(parsed) ? undefined : parsed; + } + break; + case 'float': + if (typeof value === 'number') break; + { + const parsed = parseFloat(strValue); + result[key] = isNaN(parsed) ? undefined : parsed; + } + break; + case 'json': + if (typeof value === 'object') break; + if (strValue === '') { + result[key] = undefined; + } else { + try { + result[key] = JSON.parse(strValue); + } catch { + result[key] = undefined; + } + } + break; + case 'uuid': + // Empty UUIDs become undefined + if (strValue === '') { + result[key] = undefined; + } + break; + case 'enum': + // Enums stay as strings but empty ones become undefined + if (strValue === '') { + result[key] = undefined; + } + break; + default: + // String type: empty strings also become undefined to avoid + // sending empty strings for optional fields + if (strValue === '') { + result[key] = undefined; + } + break; + } + } + + return result; +} + +/** + * Strip undefined values and filter to only schema-defined keys. + * This removes extra fields injected by minimist (like _, tty, etc.) + * and any fields that were coerced to undefined. + */ +export function stripUndefined( + obj: Record, + schema?: FieldSchema +): Record { + const result: Record = {}; + const allowedKeys = schema ? new Set(Object.keys(schema)) : null; + + for (const [key, value] of Object.entries(obj)) { + if (value === undefined) continue; + if (allowedKeys && !allowedKeys.has(key)) continue; + result[key] = value; + } + + return result; +} + +/** + * Parse mutation input from CLI. + * Custom mutation commands receive an `input` field as a JSON string + * from the CLI prompt. This parses it into a proper object. + */ +export function parseMutationInput(answers: Record): Record { + if (typeof answers.input === 'string') { + try { + const parsed = JSON.parse(answers.input); + return { ...answers, input: parsed }; + } catch { + return answers; + } + } + return answers; +} + +/** + * Reconstruct nested objects from dot-notation CLI answers. + * When INPUT_OBJECT args are flattened to dot-notation questions + * (e.g. `--input.email foo --input.password bar`), this function + * rebuilds the nested structure expected by the ORM: + * + * { 'input.email': 'foo', 'input.password': 'bar' } + * → { input: { email: 'foo', password: 'bar' } } + * + * Non-dotted keys are passed through unchanged. + * Uses `nested-obj` for safe nested property setting. + */ +export function unflattenDotNotation(answers: Record): Record { + const result: Record = {}; + + for (const [key, value] of Object.entries(answers)) { + if (key.includes('.')) { + objectPath.set(result, key, value); + } else { + result[key] = value; + } + } + + return result; +} + +/** + * Build a select object from a comma-separated list of dot-notation paths. + * Uses `nested-obj` to parse paths like 'clientMutationId,result.accessToken,result.userId' + * into the nested structure expected by the ORM: + * + * { clientMutationId: true, result: { select: { accessToken: true, userId: true } } } + * + * Paths without dots set the key to `true` (scalar select). + * Paths with dots create nested `{ select: { ... } }` wrappers, matching the + * ORM's expected structure for OBJECT sub-fields (e.g. `SignUpPayloadSelect.result`). + * + * @param paths - Comma-separated dot-notation field paths (e.g. 'clientMutationId,result.accessToken') + * @returns The nested select object for the ORM + */ +/** + * Parse a CLI flag as an integer. + * Handles minimist delivering numbers or strings depending on the input. + * Returns undefined when the flag is missing or not a valid number. + */ +export function parseIntFlag(argv: Record, name: string): number | undefined { + const val = argv[name]; + if (typeof val === 'number') return val; + if (typeof val === 'string') { + const n = parseInt(val, 10); + return isNaN(n) ? undefined : n; + } + return undefined; +} + +/** + * Parse a CLI flag as a string. + * Returns undefined when the flag is missing or not a string. + */ +export function parseStringFlag(argv: Record, name: string): string | undefined { + const val = argv[name]; + return typeof val === 'string' ? val : undefined; +} + +/** + * Parse --orderBy flag as a comma-separated list of enum values. + * e.g. --orderBy NAME_ASC,CREATED_AT_DESC → ['NAME_ASC', 'CREATED_AT_DESC'] + */ +export function parseOrderByFlag(argv: Record): string[] | undefined { + const val = argv.orderBy; + return typeof val === 'string' ? val.split(',') : undefined; +} + +/** + * Parse --select flag into a select object, falling back to a default. + * e.g. --select id,name → { id: true, name: true } + */ +export function parseSelectFlag( + argv: Record, + defaultSelect: Record +): Record { + const raw = argv.select; + return typeof raw === 'string' ? buildSelectFromPaths(raw) : defaultSelect; +} + +/** + * Build the full findManyArgs object from CLI argv. + * Parses all pagination, filtering, ordering, and field selection flags + * in one call. Accepts an optional `extraWhere` to merge with dot-notation + * --where flags (used by the search handler to inject search clauses). + * + * @example + * const findManyArgs = parseFindManyArgs(argv, { id: true, name: true }); + * const result = await client.user.findMany(findManyArgs).execute(); + */ +export function parseFindManyArgs>( + argv: Record, + defaultSelect: Record, + extraWhere?: Record +): T { + const limit = parseIntFlag(argv, 'limit'); + const last = parseIntFlag(argv, 'last'); + const offset = parseIntFlag(argv, 'offset'); + const after = parseStringFlag(argv, 'after'); + const before = parseStringFlag(argv, 'before'); + const select = parseSelectFlag(argv, defaultSelect); + const parsed = unflattenDotNotation(argv); + const where = + (parsed.where ?? extraWhere) + ? { ...(extraWhere ?? {}), ...((parsed.where as Record) ?? {}) } + : undefined; + const orderBy = parseOrderByFlag(argv); + + return { + select, + ...(limit !== undefined ? { first: limit } : {}), + ...(after !== undefined ? { after } : {}), + ...(last !== undefined ? { last } : {}), + ...(before !== undefined ? { before } : {}), + ...(offset !== undefined ? { offset } : {}), + ...(where !== undefined ? { where } : {}), + ...(orderBy !== undefined ? { orderBy } : {}), + } as unknown as T; +} + +/** + * Build findFirst args from CLI argv. + * Like parseFindManyArgs but without pagination flags (no limit/offset/after/before/last) + * — findFirst returns the first matching record. Supports select, where, and orderBy. + */ +export function parseFindFirstArgs>( + argv: Record, + defaultSelect: Record +): T { + const select = parseSelectFlag(argv, defaultSelect); + const parsed = unflattenDotNotation(argv); + const where = parsed.where; + const orderBy = parseOrderByFlag(argv); + + return { + select, + ...(where !== undefined ? { where } : {}), + ...(orderBy !== undefined ? { orderBy } : {}), + } as unknown as T; +} + +export function buildSelectFromPaths(paths: string): Record { + const result: Record = {}; + const trimmedPaths = paths + .split(',') + .map((p) => p.trim()) + .filter((p) => p.length > 0); + + for (const path of trimmedPaths) { + if (!path.includes('.')) { + // Simple scalar field: clientMutationId -> { clientMutationId: true } + result[path] = true; + } else { + // Nested path: result.accessToken -> { result: { select: { accessToken: true } } } + // Convert dot-notation to ORM's { select: { ... } } nesting pattern + const parts = path.split('.'); + let current = result; + for (let i = 0; i < parts.length; i++) { + const part = parts[i]; + if (i === parts.length - 1) { + // Leaf node: set to true + objectPath.set(current, part, true); + } else { + // Intermediate node: ensure { select: { ... } } wrapper exists + if (!current[part] || typeof current[part] !== 'object') { + current[part] = { select: {} }; + } + const wrapper = current[part] as Record; + if (!wrapper.select || typeof wrapper.select !== 'object') { + wrapper.select = {}; + } + current = wrapper.select as Record; + } + } + } + } + + return result; +} diff --git a/sdk/constructive-cli/src/config/index.ts b/sdk/constructive-cli/src/config/index.ts index 9636f677cb..df67cba476 100644 --- a/sdk/constructive-cli/src/config/index.ts +++ b/sdk/constructive-cli/src/config/index.ts @@ -1,2 +1,6 @@ -export { getAppDirs, getConfigStore } from './app-dirs'; -export type { AppDirOptions } from './app-dirs'; +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +export * from './orm'; +export * from './cli'; diff --git a/sdk/constructive-cli/src/config/orm/README.md b/sdk/constructive-cli/src/config/orm/README.md new file mode 100644 index 0000000000..803661dc8e --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/README.md @@ -0,0 +1,252 @@ +# ORM Client + +

+ +

+ + + +## Setup + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); +``` + +## Models + +| Model | Operations | +|-------|------------| +| `platformConfigDefinition` | findMany, findOne, create, update, delete | +| `platformConfig` | findMany, findOne, create, update, delete | + +## Table Operations + +### `db.platformConfigDefinition` + +CRUD operations for PlatformConfigDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `name` | String | Yes | +| `description` | String | Yes | +| `defaultValue` | String | Yes | +| `isBuiltIn` | Boolean | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | + +**Operations:** + +```typescript +// List all platformConfigDefinition records +const items = await db.platformConfigDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }).execute(); + +// Get one by id +const item = await db.platformConfigDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }).execute(); + +// Create +const created = await db.platformConfigDefinition.create({ data: { name: '', description: '', defaultValue: '', isBuiltIn: '', labels: '', annotations: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.platformConfigDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.platformConfigDefinition.delete({ where: { id: '' } }).execute(); +``` + +### `db.platformConfig` + +CRUD operations for PlatformConfig records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `namespaceId` | UUID | Yes | +| `name` | String | Yes | +| `value` | String | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `description` | String | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `expiresAt` | Datetime | Yes | + +**Operations:** + +```typescript +// List all platformConfig records +const items = await db.platformConfig.findMany({ select: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }).execute(); + +// Get one by id +const item = await db.platformConfig.findOne({ id: '', select: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }).execute(); + +// Create +const created = await db.platformConfig.create({ data: { namespaceId: '', name: '', value: '', labels: '', annotations: '', description: '', expiresAt: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.platformConfig.update({ where: { id: '' }, data: { namespaceId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.platformConfig.delete({ where: { id: '' } }).execute(); +``` + +## Custom Operations + +### `db.mutation.platformSecretsDel` + +platformSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsDelInput (required) | + +```typescript +const result = await db.mutation.platformSecretsDel({ input: { secretName: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.orgSecretsDel` + +orgSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsDelInput (required) | + +```typescript +const result = await db.mutation.orgSecretsDel({ input: { ownerId: '', secretName: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.platformSecretsRemoveArray` + +platformSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRemoveArrayInput (required) | + +```typescript +const result = await db.mutation.platformSecretsRemoveArray({ input: { secretNames: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.orgSecretsRemoveArray` + +orgSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRemoveArrayInput (required) | + +```typescript +const result = await db.mutation.orgSecretsRemoveArray({ input: { ownerId: '', secretNames: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.platformSecretsRotate` + +platformSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRotateInput (required) | + +```typescript +const result = await db.mutation.platformSecretsRotate({ input: { secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.platformSecretsSet` + +platformSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsSetInput (required) | + +```typescript +const result = await db.mutation.platformSecretsSet({ input: { secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.orgSecretsRotate` + +orgSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRotateInput (required) | + +```typescript +const result = await db.mutation.orgSecretsRotate({ input: { ownerId: '', secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.orgSecretsSet` + +orgSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsSetInput (required) | + +```typescript +const result = await db.mutation.orgSecretsSet({ input: { scopeOwnerId: '', secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.provisionBucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-cli/src/config/orm/client.ts b/sdk/constructive-cli/src/config/orm/client.ts new file mode 100644 index 0000000000..16e683c712 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/client.ts @@ -0,0 +1,244 @@ +/** + * ORM Client - Runtime GraphQL executor + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; +import { createFetch } from '@constructive-io/graphql-query/runtime'; + +import type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + Unsubscribe, +} from './realtime'; +import { RealtimeManager } from './realtime'; + +export type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; + +export type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + SubscriptionOperation, + Unsubscribe, + WsClient, +} from './realtime'; +export { RealtimeManager } from './realtime'; + +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +export class FetchAdapter implements GraphQLAdapter { + private headers: Record; + private fetchFn: typeof globalThis.fetch; + + constructor( + private endpoint: string, + headers?: Record, + fetchFn?: typeof globalThis.fetch + ) { + this.headers = headers ?? {}; + this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); + } + + async execute(document: string, variables?: Record): Promise> { + const response = await this.fetchFn(this.endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + ...this.headers, + }, + body: JSON.stringify({ + query: document, + variables: variables ?? {}, + }), + }); + + if (!response.ok) { + return { + ok: false, + data: null, + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], + }; + } + + const json = (await response.json()) as { + data?: T; + errors?: GraphQLError[]; + }; + + if (json.errors && json.errors.length > 0) { + return { + ok: false, + data: null, + errors: json.errors, + }; + } + + return { + ok: true, + data: json.data as T, + errors: undefined, + }; + } + + setHeaders(headers: Record): void { + this.headers = { ...this.headers, ...headers }; + } + + getEndpoint(): string { + return this.endpoint; + } +} + +/** + * Configuration for creating an ORM client. + * Either provide endpoint (and optional headers/fetch) for HTTP requests, + * or provide a custom adapter for alternative execution strategies. + */ +export interface OrmClientConfig { + /** GraphQL endpoint URL (required if adapter not provided) */ + endpoint?: string; + /** Default headers for HTTP requests (only used with endpoint) */ + headers?: Record; + /** + * Custom fetch implementation. Defaults to createFetch() from + * @constructive-io/graphql-query/runtime which handles *.localhost + * DNS and Host headers in Node.js. Pass your own for test mocking + * or custom proxy/credentials. + */ + fetch?: typeof globalThis.fetch; + /** Custom adapter for GraphQL execution (overrides endpoint/headers/fetch) */ + adapter?: GraphQLAdapter; + /** + * Optional realtime (WebSocket) configuration. + * When provided, enables subscription methods on models. + * The WebSocket connection is created lazily on first subscribe(). + */ + realtime?: RealtimeConfig; +} + +/** + * Error thrown when GraphQL request fails + */ +export class GraphQLRequestError extends Error { + constructor( + public readonly errors: GraphQLError[], + public readonly data: unknown = null + ) { + const messages = errors.map((e) => e.message).join('; '); + super(`GraphQL Error: ${messages}`); + this.name = 'GraphQLRequestError'; + } +} + +export class OrmClient { + private adapter: GraphQLAdapter; + private realtimeManager?: RealtimeManager; + + constructor(config: OrmClientConfig) { + if (config.adapter) { + this.adapter = config.adapter; + } else if (config.endpoint) { + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); + } else { + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); + } + + if (config.realtime) { + this.realtimeManager = new RealtimeManager(config.realtime); + } + } + + async execute(document: string, variables?: Record): Promise> { + return this.adapter.execute(document, variables); + } + + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + if (!this.realtimeManager) { + throw new Error( + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' + ); + } + return this.realtimeManager.subscribe(meta, document, variables, options); + } + + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers: Record): void { + if (this.adapter.setHeaders) { + this.adapter.setHeaders(headers); + } + } + + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint(): string { + return this.adapter.getEndpoint?.() ?? ''; + } + + /** Get current WebSocket connection state */ + getConnectionState(): ConnectionState { + return this.realtimeManager?.getConnectionState() ?? 'disconnected'; + } + + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + if (!this.realtimeManager) return () => {}; + return this.realtimeManager.onConnectionStateChange(listener); + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.realtimeManager?.getActiveSubscriptionCount() ?? 0; + } + + /** Whether realtime is configured */ + get isRealtimeEnabled(): boolean { + return this.realtimeManager !== undefined; + } + + /** Dispose the realtime manager (close WebSocket) */ + dispose(): void { + this.realtimeManager?.dispose(); + } +} diff --git a/sdk/constructive-cli/src/config/orm/index.ts b/sdk/constructive-cli/src/config/orm/index.ts new file mode 100644 index 0000000000..9ea4028079 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/index.ts @@ -0,0 +1,47 @@ +/** + * ORM Client - createClient factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { PlatformConfigDefinitionModel } from './models/platformConfigDefinition'; +import { PlatformConfigModel } from './models/platformConfig'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +export function createClient(config: OrmClientConfig) { + const client = new OrmClient(config); + return { + platformConfigDefinition: new PlatformConfigDefinitionModel(client), + platformConfig: new PlatformConfigModel(client), + mutation: createMutationOperations(client), + }; +} diff --git a/sdk/constructive-cli/src/config/orm/input-types.ts b/sdk/constructive-cli/src/config/orm/input-types.ts new file mode 100644 index 0000000000..693309a1fb --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/input-types.ts @@ -0,0 +1,774 @@ +/** + * GraphQL types for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// ============ Scalar Filter Types ============ +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: Record; + containedBy?: Record; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containsOrEqualTo?: string; + containedBy?: string; + containedByOrEqualTo?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +/** Registry of valid config keys — declares which config entries the platform recognizes */ +// ============ Entity Types ============ +export interface PlatformConfigDefinition { + /** Unique identifier for this config definition */ + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Config key name (must match config table name for resolution) */ + name?: string | null; + /** Human-readable description of what this config key controls */ + description?: string | null; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string | null; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean | null; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: Record | null; + /** Freeform metadata annotations for config definitions */ + annotations?: Record | null; +} +/** App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed */ +export interface PlatformConfig { + /** Unique identifier for this config entry */ + id: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId?: string | null; + /** Key name identifying the config entry */ + name?: string | null; + /** Plaintext config value */ + value?: string | null; + /** Key/value pairs for selecting/filtering config entries */ + labels?: Record | null; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record | null; + /** Human-readable note about this config entry */ + description?: string | null; + createdAt?: string | null; + updatedAt?: string | null; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string | null; +} +// ============ Relation Helper Types ============ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +// ============ Entity Relation Types ============ +export interface PlatformConfigDefinitionRelations {} +export interface PlatformConfigRelations {} +// ============ Entity Types With Relations ============ +export type PlatformConfigDefinitionWithRelations = PlatformConfigDefinition & + PlatformConfigDefinitionRelations; +export type PlatformConfigWithRelations = PlatformConfig & PlatformConfigRelations; +// ============ Entity Select Types ============ +export type PlatformConfigDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + name?: boolean; + description?: boolean; + defaultValue?: boolean; + isBuiltIn?: boolean; + labels?: boolean; + annotations?: boolean; +}; +export type PlatformConfigSelect = { + id?: boolean; + namespaceId?: boolean; + name?: boolean; + value?: boolean; + labels?: boolean; + annotations?: boolean; + description?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + expiresAt?: boolean; +}; +// ============ Table Filter Types ============ +export interface PlatformConfigDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `defaultValue` field. */ + defaultValue?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigDefinitionFilter[]; + /** Negates the expression. */ + not?: PlatformConfigDefinitionFilter; +} +export interface PlatformConfigFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `value` field. */ + value?: StringFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigFilter[]; + /** Negates the expression. */ + not?: PlatformConfigFilter; +} +// ============ OrderBy Types ============ +export type PlatformConfigDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC'; +export type PlatformConfigOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC'; +// ============ CRUD Input Types ============ +export interface CreatePlatformConfigDefinitionInput { + clientMutationId?: string; + platformConfigDefinition: { + name: string; + description?: string; + defaultValue?: string; + isBuiltIn?: boolean; + labels?: Record; + annotations?: Record; + }; +} +export interface PlatformConfigDefinitionPatch { + name?: string | null; + description?: string | null; + defaultValue?: string | null; + isBuiltIn?: boolean | null; + labels?: Record | null; + annotations?: Record | null; +} +export interface UpdatePlatformConfigDefinitionInput { + clientMutationId?: string; + id: string; + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; +} +export interface DeletePlatformConfigDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformConfigInput { + clientMutationId?: string; + platformConfig: { + namespaceId: string; + name: string; + value?: string; + labels?: Record; + annotations?: Record; + description?: string; + expiresAt?: string; + }; +} +export interface PlatformConfigPatch { + namespaceId?: string | null; + name?: string | null; + value?: string | null; + labels?: Record | null; + annotations?: Record | null; + description?: string | null; + expiresAt?: string | null; +} +export interface UpdatePlatformConfigInput { + clientMutationId?: string; + id: string; + platformConfigPatch: PlatformConfigPatch; +} +export interface DeletePlatformConfigInput { + clientMutationId?: string; + id: string; +} +// ============ Connection Fields Map ============ +export const connectionFieldsMap = {} as Record>; +// ============ Custom Input Types (from schema) ============ +export interface PlatformSecretsDelInput { + clientMutationId?: string; + secretName?: string; + namespaceId?: string; +} +export interface OrgSecretsDelInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + namespaceId?: string; +} +export interface PlatformSecretsRemoveArrayInput { + clientMutationId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface OrgSecretsRemoveArrayInput { + clientMutationId?: string; + ownerId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface PlatformSecretsRotateInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface PlatformSecretsSetInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface OrgSecretsRotateInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface OrgSecretsSetInput { + clientMutationId?: string; + scopeOwnerId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** An input for mutations affecting `PlatformConfigDefinition` */ +export interface PlatformConfigDefinitionInput { + /** Unique identifier for this config definition */ + id?: string; + createdAt?: string; + updatedAt?: string; + /** Config key name (must match config table name for resolution) */ + name: string; + /** Human-readable description of what this config key controls */ + description?: string; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: Record; + /** Freeform metadata annotations for config definitions */ + annotations?: Record; +} +/** An input for mutations affecting `PlatformConfig` */ +export interface PlatformConfigInput { + /** Unique identifier for this config entry */ + id?: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId: string; + /** Key name identifying the config entry */ + name: string; + /** Plaintext config value */ + value?: string; + /** Key/value pairs for selecting/filtering config entries */ + labels?: Record; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record; + /** Human-readable note about this config entry */ + description?: string; + createdAt?: string; + updatedAt?: string; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string; +} +// ============ Payload/Return Types (for custom operations) ============ +export interface PlatformSecretsDelPayload { + clientMutationId?: string | null; +} +export type PlatformSecretsDelPayloadSelect = { + clientMutationId?: boolean; +}; +export interface OrgSecretsDelPayload { + clientMutationId?: string | null; +} +export type OrgSecretsDelPayloadSelect = { + clientMutationId?: boolean; +}; +export interface PlatformSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export type PlatformSecretsRemoveArrayPayloadSelect = { + clientMutationId?: boolean; +}; +export interface OrgSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export type OrgSecretsRemoveArrayPayloadSelect = { + clientMutationId?: boolean; +}; +export interface PlatformSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type PlatformSecretsRotatePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface PlatformSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type PlatformSecretsSetPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface OrgSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type OrgSecretsRotatePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface OrgSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type OrgSecretsSetPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +export type ProvisionBucketPayloadSelect = { + success?: boolean; + bucketName?: boolean; + accessType?: boolean; + provider?: boolean; + endpoint?: boolean; + error?: boolean; +}; +export interface CreatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was created by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type CreatePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface UpdatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was updated by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type UpdatePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface DeletePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was deleted by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type DeletePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface CreatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was created by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type CreatePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +export interface UpdatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was updated by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type UpdatePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +export interface DeletePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was deleted by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type DeletePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +/** A `PlatformConfigDefinition` edge in the connection. */ +export interface PlatformConfigDefinitionEdge { + cursor?: string | null; + /** The `PlatformConfigDefinition` at the end of the edge. */ + node?: PlatformConfigDefinition | null; +} +export type PlatformConfigDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformConfigDefinitionSelect; + }; +}; +/** A `PlatformConfig` edge in the connection. */ +export interface PlatformConfigEdge { + cursor?: string | null; + /** The `PlatformConfig` at the end of the edge. */ + node?: PlatformConfig | null; +} +export type PlatformConfigEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformConfigSelect; + }; +}; diff --git a/sdk/constructive-cli/src/config/orm/models/index.ts b/sdk/constructive-cli/src/config/orm/models/index.ts new file mode 100644 index 0000000000..c641a1f3e5 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/models/index.ts @@ -0,0 +1,7 @@ +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export { PlatformConfigDefinitionModel } from './platformConfigDefinition'; +export { PlatformConfigModel } from './platformConfig'; diff --git a/sdk/constructive-cli/src/config/orm/models/platformConfig.ts b/sdk/constructive-cli/src/config/orm/models/platformConfig.ts new file mode 100644 index 0000000000..43634e7a80 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/models/platformConfig.ts @@ -0,0 +1,245 @@ +/** + * PlatformConfig model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfig, + PlatformConfigWithRelations, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, + CreatePlatformConfigInput, + UpdatePlatformConfigInput, + PlatformConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PlatformConfigModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfigs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfig: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', + document, + variables, + transform: (data: { + platformConfigs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfig: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', + document, + variables, + transform: (data: { + platformConfigs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PlatformConfig', + 'createPlatformConfig', + 'platformConfig', + args.select, + args.data, + 'CreatePlatformConfigInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'createPlatformConfig', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfig', + 'updatePlatformConfig', + 'platformConfig', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigInput', + 'id', + 'platformConfigPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'updatePlatformConfig', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfig', + 'deletePlatformConfig', + 'platformConfig', + { + id: args.where.id, + }, + 'DeletePlatformConfigInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'deletePlatformConfig', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/config/orm/models/platformConfigDefinition.ts b/sdk/constructive-cli/src/config/orm/models/platformConfigDefinition.ts new file mode 100644 index 0000000000..c28ff1566e --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/models/platformConfigDefinition.ts @@ -0,0 +1,247 @@ +/** + * PlatformConfigDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfigDefinition, + PlatformConfigDefinitionWithRelations, + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy, + CreatePlatformConfigDefinitionInput, + UpdatePlatformConfigDefinitionInput, + PlatformConfigDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PlatformConfigDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinitions: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinition', + document, + variables, + transform: (data: { + platformConfigDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfigDefinition: data.platformConfigDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinition', + document, + variables, + transform: (data: { + platformConfigDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfigDefinition: data.platformConfigDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PlatformConfigDefinition', + 'createPlatformConfigDefinition', + 'platformConfigDefinition', + args.select, + args.data, + 'CreatePlatformConfigDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'createPlatformConfigDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfigDefinition', + 'updatePlatformConfigDefinition', + 'platformConfigDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigDefinitionInput', + 'id', + 'platformConfigDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'updatePlatformConfigDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfigDefinition', + 'deletePlatformConfigDefinition', + 'platformConfigDefinition', + { + id: args.where.id, + }, + 'DeletePlatformConfigDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'deletePlatformConfigDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/config/orm/mutation/index.ts b/sdk/constructive-cli/src/config/orm/mutation/index.ts new file mode 100644 index 0000000000..b9ef205a98 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/mutation/index.ts @@ -0,0 +1,337 @@ +/** + * Custom mutation operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + PlatformSecretsDelInput, + OrgSecretsDelInput, + PlatformSecretsRemoveArrayInput, + OrgSecretsRemoveArrayInput, + PlatformSecretsRotateInput, + PlatformSecretsSetInput, + OrgSecretsRotateInput, + OrgSecretsSetInput, + ProvisionBucketInput, + PlatformSecretsDelPayload, + OrgSecretsDelPayload, + PlatformSecretsRemoveArrayPayload, + OrgSecretsRemoveArrayPayload, + PlatformSecretsRotatePayload, + PlatformSecretsSetPayload, + OrgSecretsRotatePayload, + OrgSecretsSetPayload, + ProvisionBucketPayload, + PlatformSecretsDelPayloadSelect, + OrgSecretsDelPayloadSelect, + PlatformSecretsRemoveArrayPayloadSelect, + OrgSecretsRemoveArrayPayloadSelect, + PlatformSecretsRotatePayloadSelect, + PlatformSecretsSetPayloadSelect, + OrgSecretsRotatePayloadSelect, + OrgSecretsSetPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export interface PlatformSecretsDelVariables { + input: PlatformSecretsDelInput; +} +export interface OrgSecretsDelVariables { + input: OrgSecretsDelInput; +} +export interface PlatformSecretsRemoveArrayVariables { + input: PlatformSecretsRemoveArrayInput; +} +export interface OrgSecretsRemoveArrayVariables { + input: OrgSecretsRemoveArrayInput; +} +export interface PlatformSecretsRotateVariables { + input: PlatformSecretsRotateInput; +} +export interface PlatformSecretsSetVariables { + input: PlatformSecretsSetInput; +} +export interface OrgSecretsRotateVariables { + input: OrgSecretsRotateInput; +} +export interface OrgSecretsSetVariables { + input: OrgSecretsSetInput; +} +/** + * Variables for provisionBucket + * Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + */ +export interface ProvisionBucketVariables { + input: ProvisionBucketInput; +} +export function createMutationOperations(client: OrmClient) { + return { + platformSecretsDel: ( + args: PlatformSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsDel', + fieldName: 'platformSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsDel', + 'platformSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsDelPayload' + ), + }), + orgSecretsDel: ( + args: OrgSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsDel', + fieldName: 'orgSecretsDel', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsDel', + 'orgSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsDelPayload' + ), + }), + platformSecretsRemoveArray: ( + args: PlatformSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRemoveArray', + fieldName: 'platformSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRemoveArray', + 'platformSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRemoveArrayPayload' + ), + }), + orgSecretsRemoveArray: ( + args: OrgSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsRemoveArray', + fieldName: 'orgSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsRemoveArray', + 'orgSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsRemoveArrayPayload' + ), + }), + platformSecretsRotate: ( + args: PlatformSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRotate', + fieldName: 'platformSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRotate', + 'platformSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRotatePayload' + ), + }), + platformSecretsSet: ( + args: PlatformSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsSet', + fieldName: 'platformSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsSet', + 'platformSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsSetPayload' + ), + }), + orgSecretsRotate: ( + args: OrgSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsRotate', + fieldName: 'orgSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsRotate', + 'orgSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsRotatePayload' + ), + }), + orgSecretsSet: ( + args: OrgSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsSet', + fieldName: 'orgSecretsSet', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsSet', + 'orgSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsSetPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + }; +} diff --git a/sdk/constructive-cli/src/config/orm/query-builder.ts b/sdk/constructive-cli/src/config/orm/query-builder.ts new file mode 100644 index 0000000000..fd785bbae6 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/query-builder.ts @@ -0,0 +1,1047 @@ +/** + * Query Builder - Builds and executes GraphQL operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { parseType, print } from '@constructive-io/graphql-query/runtime'; +import * as t from 'gql-ast'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; + +import { GraphQLRequestError, OrmClient, QueryResult } from './client'; + +export interface QueryBuilderConfig { + client: OrmClient; + operation: 'query' | 'mutation'; + operationName: string; + fieldName: string; + document: string; + variables?: Record; + transform?: (data: any) => TResult; +} + +export class QueryBuilder { + private config: QueryBuilderConfig; + + constructor(config: QueryBuilderConfig) { + this.config = config; + } + + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + async execute(): Promise> { + const rawResult = await this.config.client.execute( + this.config.document, + this.config.variables + ); + if (!rawResult.ok) { + return rawResult; + } + if (!this.config.transform) { + return rawResult as unknown as QueryResult; + } + return { + ok: true, + data: this.config.transform(rawResult.data), + errors: undefined, + }; + } + + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + async unwrap(): Promise { + const result = await this.execute(); + if (!result.ok) { + throw new GraphQLRequestError(result.errors, result.data); + } + return result.data; + } + + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + async unwrapOr(defaultValue: D): Promise { + const result = await this.execute(); + if (!result.ok) { + return defaultValue; + } + return result.data; + } + + /** + * Execute and unwrap, calling onError callback on failure + */ + async unwrapOrElse( + onError: (errors: import('./client').GraphQLError[]) => D + ): Promise { + const result = await this.execute(); + if (!result.ok) { + return onError(result.errors); + } + return result.data; + } + + toGraphQL(): string { + return this.config.document; + } + + getVariables(): Record | undefined { + return this.config.variables; + } +} + +const OP_QUERY = 'query' as unknown as import('graphql').OperationTypeNode; +const OP_MUTATION = 'mutation' as unknown as import('graphql').OperationTypeNode; +const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; + +// ============================================================================ +// Selection Builders +// ============================================================================ + +export function buildSelections( + select: Record | undefined, + connectionFieldsMap?: Record>, + entityType?: string +): FieldNode[] { + if (!select) { + return []; + } + + const fields: FieldNode[] = []; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; + + for (const [key, value] of Object.entries(select)) { + if (value === false || value === undefined) { + continue; + } + + if (value === true) { + fields.push(t.field({ name: key })); + continue; + } + + if (typeof value === 'object' && value !== null) { + const nested = value as { + select?: Record; + args?: Record; + first?: number; + filter?: Record; + orderBy?: string[]; + connection?: boolean; + }; + + // Field with arguments (e.g. requestUploadUrl on bucket types) + if (nested.args && typeof nested.args === 'object') { + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) + ); + const nestedSelect = nested.select; + if (nestedSelect && typeof nestedSelect === 'object') { + const subSelections = Object.entries(nestedSelect) + .filter(([, v]) => v) + .map(([name]) => t.field({ name })); + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: subSelections.length + ? t.selectionSet({ selections: subSelections }) + : undefined, + }) + ); + } else { + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + }) + ); + } + continue; + } + + if (!nested.select || typeof nested.select !== 'object') { + throw new Error( + `Invalid selection for field "${key}": nested selections must include a "select" object.` + ); + } + + const relatedEntityType = entityConnections?.[key]; + const nestedSelections = buildSelections( + nested.select, + connectionFieldsMap, + relatedEntityType + ); + const isConnection = + nested.connection === true || + nested.first !== undefined || + nested.filter !== undefined || + relatedEntityType !== undefined; + const args = buildArgs([ + buildOptionalArg('first', nested.first), + nested.filter + ? t.argument({ + name: 'filter', + value: buildValueAst(nested.filter), + }) + : null, + buildEnumListArg('orderBy', nested.orderBy), + ]); + + if (isConnection) { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(nestedSelections), + }), + }) + ); + } else { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ selections: nestedSelections }), + }) + ); + } + } + } + + return fields; +} + +// ============================================================================ +// Document Builders +// ============================================================================ + +export function buildFindManyDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { + where?: TWhere; + orderBy?: string[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; + }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'first', typeName: 'Int', value: args.first }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'last', typeName: 'Int', value: args.last }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'after', typeName: 'Cursor', value: args.after }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'before', typeName: 'Cursor', value: args.before }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'offset', typeName: 'Int', value: args.offset }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs.length ? queryArgs : undefined, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(selections), + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildFindFirstDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { where?: TWhere; orderBy?: string[] }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + // Always add first: 1 for findFirst + addVariable( + { varName: 'first', typeName: 'Int', value: 1 }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildCreateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [entityField]: data, + }, + }, + }; +} + +export function buildUpdateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + patchFieldName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + id: where.id, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildUpdateByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + id: string | number, + data: TData, + inputTypeName: string, + idFieldName: string, + patchFieldName: string, + connectionFieldsMap?: Record>, + extraKeys?: Record +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [idFieldName]: id, + ...extraKeys, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildFindOneDocument( + operationName: string, + queryField: string, + id: string | number, + select: TSelect, + idArgName: string, + idTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = [ + t.variableDefinition({ + variable: t.variable({ name: idArgName }), + type: parseType(idTypeName), + }), + ]; + + const queryArgs: ArgumentNode[] = [ + t.argument({ + name: idArgName, + value: t.variable({ name: idArgName }), + }), + ]; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: { [idArgName]: id }, + }; +} + +export function buildDeleteDocument( + operationName: string, + mutationField: string, + entityField: string, + where: TWhere, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ + selections: entitySelections, + }), + }), + ], + }), + variables: { + input: { + id: where.id, + }, + }, + }; +} + +export function buildDeleteByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + keys: Record, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections: entitySelections }), + }), + ], + }), + variables: { + input: keys, + }, + }; +} + +export function buildJunctionRemoveDocument( + operationName: string, + mutationField: string, + keys: Record, + inputTypeName: string +): { document: string; variables: Record } { + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [t.field({ name: 'clientMutationId' })], + }), + variables: { + input: keys, + }, + }; +} + +export function buildCustomDocument( + operationType: 'query' | 'mutation', + operationName: string, + fieldName: string, + select: TSelect, + args: TArgs, + variableDefinitions: Array<{ name: string; type: string }>, + connectionFieldsMap?: Record>, + entityType?: string +): { document: string; variables: Record } { + let actualSelect: TSelect = select; + let isConnection = false; + + if (isCustomSelectionWrapper(select)) { + actualSelect = select.select as TSelect; + isConnection = select.connection === true; + } + + const selections = actualSelect + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) + : []; + + const variableDefs = variableDefinitions.map((definition) => + t.variableDefinition({ + variable: t.variable({ name: definition.name }), + type: parseType(definition.type), + }) + ); + const fieldArgs = variableDefinitions.map((definition) => + t.argument({ + name: definition.name, + value: t.variable({ name: definition.name }), + }) + ); + + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY, + name: operationName, + variableDefinitions: variableDefs.length ? variableDefs : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: fieldName, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: fieldSelections.length + ? t.selectionSet({ selections: fieldSelections }) + : undefined, + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: (args ?? {}) as Record, + }; +} + +function isCustomSelectionWrapper( + value: unknown +): value is { select: Record; connection?: boolean } { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + + const record = value as Record; + const keys = Object.keys(record); + + if (!keys.includes('select') || !keys.includes('connection')) { + return false; + } + + if (keys.some((key) => key !== 'select' && key !== 'connection')) { + return false; + } + + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); +} + +// ============================================================================ +// Helper Functions +// ============================================================================ + +function buildArgs(args: Array): ArgumentNode[] { + return args.filter((arg): arg is ArgumentNode => arg !== null); +} + +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { + if (value === undefined) { + return null; + } + const valueNode = + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); + return t.argument({ name, value: valueNode }); +} + +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { + if (!values || values.length === 0) { + return null; + } + return t.argument({ + name, + value: t.listValue({ + values: values.map((value) => buildEnumValue(value)), + }), + }); +} + +function buildEnumValue(value: string): EnumValueNode { + return { + kind: ENUM_VALUE_KIND, + value, + }; +} + +function buildPageInfoSelections(): FieldNode[] { + return [ + t.field({ name: 'hasNextPage' }), + t.field({ name: 'hasPreviousPage' }), + t.field({ name: 'startCursor' }), + t.field({ name: 'endCursor' }), + ]; +} + +function buildConnectionSelections(nodeSelections: FieldNode[]): FieldNode[] { + return [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections: nodeSelections }), + }), + t.field({ name: 'totalCount' }), + t.field({ + name: 'pageInfo', + selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }), + }), + ]; +} + +interface VariableSpec { + varName: string; + argName?: string; + typeName?: string; + value: unknown; +} + +interface InputMutationConfig { + operationName: string; + mutationField: string; + inputTypeName: string; + resultSelections: FieldNode[]; +} + +function buildInputMutationDocument(config: InputMutationConfig): string { + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_MUTATION, + name: config.operationName + 'Mutation', + variableDefinitions: [ + t.variableDefinition({ + variable: t.variable({ name: 'input' }), + type: parseType(config.inputTypeName + '!'), + }), + ], + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: config.mutationField, + args: [ + t.argument({ + name: 'input', + value: t.variable({ name: 'input' }), + }), + ], + selectionSet: t.selectionSet({ + selections: config.resultSelections, + }), + }), + ], + }), + }), + ], + }); + return print(document); +} + +function addVariable( + spec: VariableSpec, + definitions: VariableDefinitionNode[], + args: ArgumentNode[], + variables: Record +): void { + if (spec.value === undefined || !spec.typeName) return; + + definitions.push( + t.variableDefinition({ + variable: t.variable({ name: spec.varName }), + type: parseType(spec.typeName), + }) + ); + args.push( + t.argument({ + name: spec.argName ?? spec.varName, + value: t.variable({ name: spec.varName }), + }) + ); + variables[spec.varName] = spec.value; +} + +function buildValueAst( + value: unknown +): + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | EnumValueNode { + if (value === null) { + return t.nullValue(); + } + + if (typeof value === 'boolean') { + return t.booleanValue({ value }); + } + + if (typeof value === 'number') { + return Number.isInteger(value) + ? t.intValue({ value: value.toString() }) + : t.floatValue({ value: value.toString() }); + } + + if (typeof value === 'string') { + return t.stringValue({ value }); + } + + if (Array.isArray(value)) { + return t.listValue({ + values: value.map((item) => buildValueAst(item)), + }); + } + + if (typeof value === 'object' && value !== null) { + const obj = value as Record; + return t.objectValue({ + fields: Object.entries(obj).map(([key, val]) => + t.objectField({ + name: key, + value: buildValueAst(val), + }) + ), + }); + } + + throw new Error('Unsupported value type: ' + typeof value); +} + +// ============================================================================ +// Bulk Mutation Document Builders +// ============================================================================ + +export function buildBulkInsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict?: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + ...(onConflict ? { onConflict } : {}), + }, + }, + }; +} + +export function buildBulkUpsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + onConflict, + }, + }, + }; +} + +export function buildBulkUpdateDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + patch: data, + }, + }, + }; +} + +export function buildBulkDeleteDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + }, + }, + }; +} diff --git a/sdk/constructive-cli/src/config/orm/realtime.ts b/sdk/constructive-cli/src/config/orm/realtime.ts new file mode 100644 index 0000000000..214eb56203 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/realtime.ts @@ -0,0 +1,244 @@ +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// Minimal type shims so this module compiles without graphql-ws +// installed. Consumers supply a WsClient via RealtimeConfig; +// the SDK itself never imports or requires graphql-ws. + +interface WsGraphQLError { + readonly message: string; + readonly [key: string]: unknown; +} + +interface WsExecutionResult> { + data?: TData | null; + errors?: readonly WsGraphQLError[]; + extensions?: Record; +} + +interface WsSink { + next(value: T): void; + error(error: unknown): void; + complete(): void; +} + +/** + * Minimal interface matching the graphql-ws Client. + * Consumers pass a concrete instance via RealtimeConfig.client. + */ +export interface WsClient { + subscribe>( + payload: { query: string; variables?: Record }, + sink: WsSink> + ): () => void; + dispose(): void; +} + +// ============================================================================ +// Types +// ============================================================================ + +/** The DML operation that triggered the subscription event */ +export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; + +/** Connection state of the WebSocket */ +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; + +/** Listener for connection state changes */ +export type ConnectionStateListener = (state: ConnectionState) => void; + +/** Function returned by subscribe() to cancel the subscription */ +export type Unsubscribe = () => void; + +/** + * A realtime subscription event delivered to the client. + * + * @typeParam T - The row type of the subscribed table + */ +export interface SubscriptionEvent { + /** The DML operation that triggered this event */ + operation: SubscriptionOperation; + /** The current row data (null for DELETE if row is no longer visible) */ + data: T | null; + /** Previous field values (populated on UPDATE when available) */ + previousValues?: Partial; + /** Server-side timestamp of when the change occurred */ + timestamp: string; +} + +/** + * Options for creating a subscription. + * + * @typeParam T - The row type of the subscribed table + * @typeParam TFilter - The filter type for the table + */ +export interface SubscribeOptions> { + /** Server-side filter to limit which events are delivered */ + filter?: TFilter; + /** Called when a subscription event is received */ + onEvent: (event: SubscriptionEvent) => void; + /** Called when the subscription encounters an error */ + onError?: (error: Error) => void; + /** Called when the subscription completes (server-initiated close) */ + onComplete?: () => void; +} + +/** + * Metadata about a subscription field, used internally to map + * table names to GraphQL subscription field names and types. + */ +export interface SubscriptionFieldMeta { + /** The GraphQL subscription field name (e.g., 'onContactChanged') */ + fieldName: string; + /** The table name in the source schema (e.g., 'contact') */ + tableName: string; + /** The data field name inside the subscription payload (e.g., 'contact') */ + dataFieldName: string; +} + +/** + * Configuration for the realtime (WebSocket) connection. + * Pass this as the `realtime` option in OrmClientConfig. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * + * const client = createOrmClient({ + * endpoint: 'https://api.example.com/graphql', + * realtime: { + * client: createClient({ url: 'wss://api.example.com/graphql' }), + * }, + * }); + * ``` + */ +export interface RealtimeConfig { + /** + * A graphql-ws Client instance (or any object satisfying WsClient). + * The consumer creates this themselves, giving full control over + * connection options, auth, and transport. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * const wsClient = createClient({ url: 'wss://...' }); + * ``` + */ + client: WsClient; +} + +// ============================================================================ +// RealtimeManager +// ============================================================================ + +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +export class RealtimeManager { + private wsClient: WsClient; + private connectionState: ConnectionState = 'disconnected'; + private stateListeners: Set = new Set(); + private activeSubscriptions = 0; + + constructor(config: RealtimeConfig) { + this.wsClient = config.client; + } + + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + this.activeSubscriptions++; + let disposed = false; + + const cleanup = this.wsClient.subscribe>( + { query: document, variables }, + { + next: (result) => { + if (disposed) return; + if (result.errors) { + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); + return; + } + + const payload = result.data?.[meta.fieldName] as + | { event?: string; [key: string]: unknown } + | undefined; + + if (!payload) return; + + const event: SubscriptionEvent = { + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', + data: (payload[meta.dataFieldName] as T) ?? null, + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), + }; + options.onEvent(event); + }, + error: (err) => { + if (disposed) return; + options.onError?.(err instanceof Error ? err : new Error(String(err))); + }, + complete: () => { + if (disposed) return; + options.onComplete?.(); + }, + } + ); + + return () => { + if (disposed) return; + disposed = true; + this.activeSubscriptions--; + cleanup(); + }; + } + + /** Register a listener for connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + this.stateListeners.add(listener); + return () => { + this.stateListeners.delete(listener); + }; + } + + /** Get current connection state */ + getConnectionState(): ConnectionState { + return this.connectionState; + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.activeSubscriptions; + } + + /** Dispose the manager and close the WebSocket connection */ + dispose(): void { + this.wsClient.dispose(); + this.stateListeners.clear(); + this.activeSubscriptions = 0; + this.setConnectionState('disconnected'); + } + + private setConnectionState(state: ConnectionState): void { + if (this.connectionState === state) return; + this.connectionState = state; + for (const listener of this.stateListeners) { + listener(state); + } + } +} diff --git a/sdk/constructive-cli/src/config/orm/select-types.ts b/sdk/constructive-cli/src/config/orm/select-types.ts new file mode 100644 index 0000000000..4b39d7e820 --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/select-types.ts @@ -0,0 +1,169 @@ +/** + * Type utilities for select inference + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} + +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} + +export interface FindManyArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +export interface FindFirstArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; +} + +export interface CreateArgs { + data: TData; + select?: TSelect; +} + +export interface UpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export type FindOneArgs = { + select?: TSelect; +} & Record; + +export interface DeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkInsertArgs { + data: TData[]; + select?: TSelect; + onConflict?: TOnConflict; +} + +export interface BulkUpsertArgs { + data: TData[]; + select?: TSelect; + onConflict: TOnConflict; +} + +export interface BulkUpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export interface BulkDeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkMutationResult { + affectedCount: number; + returning: T[]; +} + +type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +type DecrementDepth = { + 0: 0; + 1: 0; + 2: 1; + 3: 2; + 4: 3; + 5: 4; + 6: 5; + 7: 6; + 8: 7; + 9: 8; + 10: 9; +}; + +/** + * Recursively validates select objects, rejecting unknown keys. + * + * NOTE: Depth is intentionally capped to avoid circular-instantiation issues + * in very large cyclic schemas. + */ +export type DeepExact = Depth extends 0 + ? T extends Shape + ? T + : never + : T extends Shape + ? Exclude extends never + ? { + [K in keyof T]: K extends keyof Shape + ? T[K] extends { select: infer NS } + ? Extract extends { + select?: infer ShapeNS; + } + ? DeepExact< + Omit & { + select: DeepExact, DecrementDepth[Depth]>; + }, + Extract, + DecrementDepth[Depth] + > + : never + : T[K] + : never; + } + : never + : never; + +/** + * Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`. + * Use this as an intersection in overloads: + * `{ select: S } & StrictSelect`. + */ +export type StrictSelect = S extends DeepExact ? {} : never; + +/** + * Hook-optimized strict select variant. + * + * Uses a shallower recursion depth to keep editor autocomplete responsive + * in large schemas while still validating common nested-select mistakes. + */ +export type HookStrictSelect = S extends DeepExact ? {} : never; + +/** + * Infer result type from select configuration + */ +export type InferSelectResult = TSelect extends undefined + ? TEntity + : { + [K in keyof TSelect as TSelect[K] extends false | undefined + ? never + : K]: TSelect[K] extends true + ? K extends keyof TEntity + ? TEntity[K] + : never + : TSelect[K] extends { select: infer NestedSelect } + ? K extends keyof TEntity + ? NonNullable extends ConnectionResult + ? ConnectionResult> + : + | InferSelectResult, NestedSelect> + | (null extends TEntity[K] ? null : never) + : never + : K extends keyof TEntity + ? TEntity[K] + : never; + }; diff --git a/sdk/constructive-cli/src/config/orm/types.ts b/sdk/constructive-cli/src/config/orm/types.ts new file mode 100644 index 0000000000..7c1120bcdf --- /dev/null +++ b/sdk/constructive-cli/src/config/orm/types.ts @@ -0,0 +1,8 @@ +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// Re-export all types from input-types +export * from './input-types'; diff --git a/sdk/constructive-cli/src/index.ts b/sdk/constructive-cli/src/index.ts index dca8c56ed3..eb54985786 100644 --- a/sdk/constructive-cli/src/index.ts +++ b/sdk/constructive-cli/src/index.ts @@ -10,6 +10,8 @@ export * as admin from './admin'; export * as agent from './agent'; export * as api from './api'; export * as auth from './auth'; +export * as compute from './compute'; +export * as config from './config'; export * as modules from './modules'; export * as objects from './objects'; export * as usage from './usage'; diff --git a/sdk/constructive-cli/src/modules/README.md b/sdk/constructive-cli/src/modules/README.md index 6635847931..872d49ea3b 100644 --- a/sdk/constructive-cli/src/modules/README.md +++ b/sdk/constructive-cli/src/modules/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 57 +- **Tables:** 59 - **Custom queries:** 2 - **Custom mutations:** 10 diff --git a/sdk/constructive-cli/src/modules/cli/README.md b/sdk/constructive-cli/src/modules/cli/README.md index 55ce1ede16..b17d8d3df6 100644 --- a/sdk/constructive-cli/src/modules/cli/README.md +++ b/sdk/constructive-cli/src/modules/cli/README.md @@ -62,14 +62,16 @@ csdk auth set-token | `function-invocation-module` | functionInvocationModule CRUD operations | | `function-module` | functionModule CRUD operations | | `invites-module` | invitesModule CRUD operations | -| `namespace-module` | namespaceModule CRUD operations | | `compute-log-module` | computeLogModule CRUD operations | | `inference-log-module` | inferenceLogModule CRUD operations | +| `namespace-module` | namespaceModule CRUD operations | | `storage-log-module` | storageLogModule CRUD operations | | `transfer-log-module` | transferLogModule CRUD operations | +| `function-deployment-module` | functionDeploymentModule CRUD operations | | `plans-module` | plansModule CRUD operations | | `billing-provider-module` | billingProviderModule CRUD operations | | `db-usage-module` | dbUsageModule CRUD operations | +| `graph-execution-module` | graphExecutionModule CRUD operations | | `hierarchy-module` | hierarchyModule CRUD operations | | `permissions-module` | permissionsModule CRUD operations | | `notifications-module` | notificationsModule CRUD operations | @@ -991,8 +993,6 @@ CRUD operations for GraphModule records. | `prefix` | String | | `merkleStoreModuleId` | UUID | | `graphsTableId` | UUID | -| `executionsTableId` | UUID | -| `outputsTableId` | UUID | | `apiName` | String | | `privateApiName` | String | | `entityTableId` | UUID | @@ -1002,7 +1002,7 @@ CRUD operations for GraphModule records. | `createdAt` | Datetime | **Required create fields:** `databaseId`, `merkleStoreModuleId` -**Optional create fields (backend defaults):** `publicSchemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `scope`, `prefix`, `graphsTableId`, `executionsTableId`, `outputsTableId`, `apiName`, `privateApiName`, `entityTableId`, `policies`, `provisions`, `defaultPermissions` +**Optional create fields (backend defaults):** `publicSchemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `scope`, `prefix`, `graphsTableId`, `apiName`, `privateApiName`, `entityTableId`, `policies`, `provisions`, `defaultPermissions` ### `database-provision-module` @@ -1304,45 +1304,6 @@ CRUD operations for InvitesModule records. **Required create fields:** `databaseId` **Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `emailsTableId`, `usersTableId`, `invitesTableId`, `claimedInvitesTableId`, `invitesTableName`, `claimedInvitesTableName`, `submitInviteCodeFunction`, `scope`, `prefix`, `entityTableId`, `apiName`, `privateApiName` -### `namespace-module` - -CRUD operations for NamespaceModule records. - -| Subcommand | Description | -|------------|-------------| -| `list` | List all namespaceModule records | -| `find-first` | Find first matching namespaceModule record | -| `get` | Get a namespaceModule by id | -| `create` | Create a new namespaceModule | -| `update` | Update an existing namespaceModule | -| `delete` | Delete a namespaceModule | - -**Fields:** - -| Field | Type | -|-------|------| -| `id` | UUID | -| `databaseId` | UUID | -| `schemaId` | UUID | -| `privateSchemaId` | UUID | -| `publicSchemaName` | String | -| `privateSchemaName` | String | -| `namespacesTableId` | UUID | -| `namespaceEventsTableId` | UUID | -| `namespacesTableName` | String | -| `namespaceEventsTableName` | String | -| `apiName` | String | -| `privateApiName` | String | -| `scope` | String | -| `prefix` | String | -| `entityTableId` | UUID | -| `policies` | JSON | -| `provisions` | JSON | -| `defaultPermissions` | String | - -**Required create fields:** `databaseId` -**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `namespacesTableId`, `namespaceEventsTableId`, `namespacesTableName`, `namespaceEventsTableName`, `apiName`, `privateApiName`, `scope`, `prefix`, `entityTableId`, `policies`, `provisions`, `defaultPermissions` - ### `compute-log-module` CRUD operations for ComputeLogModule records. @@ -1423,6 +1384,46 @@ CRUD operations for InferenceLogModule records. **Required create fields:** `databaseId` **Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `inferenceLogTableId`, `inferenceLogTableName`, `usageDailyTableId`, `usageDailyTableName`, `interval`, `retention`, `premake`, `scope`, `actorFkTableId`, `entityFkTableId`, `prefix`, `apiName`, `privateApiName` +### `namespace-module` + +CRUD operations for NamespaceModule records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all namespaceModule records | +| `find-first` | Find first matching namespaceModule record | +| `get` | Get a namespaceModule by id | +| `create` | Create a new namespaceModule | +| `update` | Update an existing namespaceModule | +| `delete` | Delete a namespaceModule | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseId` | UUID | +| `schemaId` | UUID | +| `privateSchemaId` | UUID | +| `publicSchemaName` | String | +| `privateSchemaName` | String | +| `namespacesTableId` | UUID | +| `namespaceEventsTableId` | UUID | +| `namespacesTableName` | String | +| `namespaceEventsTableName` | String | +| `apiName` | String | +| `privateApiName` | String | +| `scope` | String | +| `prefix` | String | +| `entityTableId` | UUID | +| `platformNamespacesTableId` | UUID | +| `policies` | JSON | +| `provisions` | JSON | +| `defaultPermissions` | String | + +**Required create fields:** `databaseId` +**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `namespacesTableId`, `namespaceEventsTableId`, `namespacesTableName`, `namespaceEventsTableName`, `apiName`, `privateApiName`, `scope`, `prefix`, `entityTableId`, `platformNamespacesTableId`, `policies`, `provisions`, `defaultPermissions` + ### `storage-log-module` CRUD operations for StorageLogModule records. @@ -1503,6 +1504,47 @@ CRUD operations for TransferLogModule records. **Required create fields:** `databaseId` **Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `transferLogTableId`, `transferLogTableName`, `usageDailyTableId`, `usageDailyTableName`, `interval`, `retention`, `premake`, `scope`, `actorFkTableId`, `entityFkTableId`, `prefix`, `apiName`, `privateApiName` +### `function-deployment-module` + +CRUD operations for FunctionDeploymentModule records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all functionDeploymentModule records | +| `find-first` | Find first matching functionDeploymentModule record | +| `get` | Get a functionDeploymentModule by id | +| `create` | Create a new functionDeploymentModule | +| `update` | Update an existing functionDeploymentModule | +| `delete` | Delete a functionDeploymentModule | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseId` | UUID | +| `schemaId` | UUID | +| `privateSchemaId` | UUID | +| `publicSchemaName` | String | +| `privateSchemaName` | String | +| `deploymentsTableId` | UUID | +| `deploymentEventsTableId` | UUID | +| `deploymentsTableName` | String | +| `deploymentEventsTableName` | String | +| `apiName` | String | +| `privateApiName` | String | +| `scope` | String | +| `prefix` | String | +| `entityTableId` | UUID | +| `functionModuleId` | UUID | +| `namespaceModuleId` | UUID | +| `policies` | JSON | +| `provisions` | JSON | +| `defaultPermissions` | String | + +**Required create fields:** `databaseId` +**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `deploymentsTableId`, `deploymentEventsTableId`, `deploymentsTableName`, `deploymentEventsTableName`, `apiName`, `privateApiName`, `scope`, `prefix`, `entityTableId`, `functionModuleId`, `namespaceModuleId`, `policies`, `provisions`, `defaultPermissions` + ### `plans-module` CRUD operations for PlansModule records. @@ -1631,6 +1673,49 @@ CRUD operations for DbUsageModule records. **Required create fields:** `databaseId` **Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `tableStatsLogTableId`, `tableStatsLogTableName`, `tableStatsDailyTableId`, `tableStatsDailyTableName`, `queryStatsLogTableId`, `queryStatsLogTableName`, `queryStatsDailyTableId`, `queryStatsDailyTableName`, `interval`, `retention`, `premake`, `scope`, `prefix`, `defaultPermissions`, `apiName`, `privateApiName` +### `graph-execution-module` + +CRUD operations for GraphExecutionModule records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all graphExecutionModule records | +| `find-first` | Find first matching graphExecutionModule record | +| `get` | Get a graphExecutionModule by id | +| `create` | Create a new graphExecutionModule | +| `update` | Update an existing graphExecutionModule | +| `delete` | Delete a graphExecutionModule | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseId` | UUID | +| `schemaId` | UUID | +| `privateSchemaId` | UUID | +| `publicSchemaName` | String | +| `privateSchemaName` | String | +| `graphModuleId` | UUID | +| `scope` | String | +| `prefix` | String | +| `executionsTableId` | UUID | +| `outputsTableId` | UUID | +| `nodeStatesTableId` | UUID | +| `executionsTableName` | String | +| `outputsTableName` | String | +| `nodeStatesTableName` | String | +| `apiName` | String | +| `privateApiName` | String | +| `entityTableId` | UUID | +| `policies` | JSON | +| `provisions` | JSON | +| `defaultPermissions` | String | +| `createdAt` | Datetime | + +**Required create fields:** `databaseId`, `graphModuleId` +**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `scope`, `prefix`, `executionsTableId`, `outputsTableId`, `nodeStatesTableId`, `executionsTableName`, `outputsTableName`, `nodeStatesTableName`, `apiName`, `privateApiName`, `entityTableId`, `policies`, `provisions`, `defaultPermissions` + ### `hierarchy-module` CRUD operations for HierarchyModule records. diff --git a/sdk/constructive-cli/src/modules/cli/commands.ts b/sdk/constructive-cli/src/modules/cli/commands.ts index 6060710cfe..944d3a8518 100644 --- a/sdk/constructive-cli/src/modules/cli/commands.ts +++ b/sdk/constructive-cli/src/modules/cli/commands.ts @@ -42,14 +42,16 @@ import webauthnAuthModuleCmd from './commands/webauthn-auth-module'; import functionInvocationModuleCmd from './commands/function-invocation-module'; import functionModuleCmd from './commands/function-module'; import invitesModuleCmd from './commands/invites-module'; -import namespaceModuleCmd from './commands/namespace-module'; import computeLogModuleCmd from './commands/compute-log-module'; import inferenceLogModuleCmd from './commands/inference-log-module'; +import namespaceModuleCmd from './commands/namespace-module'; import storageLogModuleCmd from './commands/storage-log-module'; import transferLogModuleCmd from './commands/transfer-log-module'; +import functionDeploymentModuleCmd from './commands/function-deployment-module'; import plansModuleCmd from './commands/plans-module'; import billingProviderModuleCmd from './commands/billing-provider-module'; import dbUsageModuleCmd from './commands/db-usage-module'; +import graphExecutionModuleCmd from './commands/graph-execution-module'; import hierarchyModuleCmd from './commands/hierarchy-module'; import permissionsModuleCmd from './commands/permissions-module'; import notificationsModuleCmd from './commands/notifications-module'; @@ -121,14 +123,16 @@ const createCommandMap: () => Record< 'function-invocation-module': functionInvocationModuleCmd, 'function-module': functionModuleCmd, 'invites-module': invitesModuleCmd, - 'namespace-module': namespaceModuleCmd, 'compute-log-module': computeLogModuleCmd, 'inference-log-module': inferenceLogModuleCmd, + 'namespace-module': namespaceModuleCmd, 'storage-log-module': storageLogModuleCmd, 'transfer-log-module': transferLogModuleCmd, + 'function-deployment-module': functionDeploymentModuleCmd, 'plans-module': plansModuleCmd, 'billing-provider-module': billingProviderModuleCmd, 'db-usage-module': dbUsageModuleCmd, + 'graph-execution-module': graphExecutionModuleCmd, 'hierarchy-module': hierarchyModuleCmd, 'permissions-module': permissionsModuleCmd, 'notifications-module': notificationsModuleCmd, @@ -156,7 +160,7 @@ const createCommandMap: () => Record< 'provision-bucket': provisionBucketCmd, }); const usage = - "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n default-ids-module defaultIdsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n user-state-module userStateModule CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n config-secrets-org-module configSecretsOrgModule CRUD operations\n devices-module devicesModule CRUD operations\n i-18-n-module i18NModule CRUD operations\n user-credentials-module userCredentialsModule CRUD operations\n user-settings-module userSettingsModule CRUD operations\n config-secrets-user-module configSecretsUserModule CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n emails-module emailsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n users-module usersModule CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n rls-module rlsModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n sessions-module sessionsModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n merkle-store-module merkleStoreModule CRUD operations\n graph-module graphModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n config-secrets-module configSecretsModule CRUD operations\n rate-limit-meters-module rateLimitMetersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n function-invocation-module functionInvocationModule CRUD operations\n function-module functionModule CRUD operations\n invites-module invitesModule CRUD operations\n namespace-module namespaceModule CRUD operations\n compute-log-module computeLogModule CRUD operations\n inference-log-module inferenceLogModule CRUD operations\n storage-log-module storageLogModule CRUD operations\n transfer-log-module transferLogModule CRUD operations\n plans-module plansModule CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n db-usage-module dbUsageModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n permissions-module permissionsModule CRUD operations\n notifications-module notificationsModule CRUD operations\n profiles-module profilesModule CRUD operations\n billing-module billingModule CRUD operations\n relation-provision relationProvision CRUD operations\n user-auth-module userAuthModule CRUD operations\n agent-module agentModule CRUD operations\n limits-module limitsModule CRUD operations\n memberships-module membershipsModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n storage-module storageModule CRUD operations\n events-module eventsModule CRUD operations\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Eight phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security. When a prefix already exists (e.g., 'org'), the entry extends the existing entity type instead of creating a new one; if a storage[] key is present, it provisions entity-scoped storage for that type. (0.5) scope-based storage: each storage[] entry has an optional scope ('app' or 'org' only). App-scoped storage seeds buckets at migration time. Org-scoped storage resolves the org membership type, creates org_buckets/org_files with owner_id, and seeds buckets per-entity via an AFTER INSERT trigger on the users table. When function_module is installed, a private functions bucket is auto-injected into org-scoped or entity-scoped storage entries. (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints/check_constraints are deferred). After provisioning, optional smart_tags (jsonb object) on the table entry are applied via metaschema.append_table_smart_tags(), and optional smart_tags on individual field entries are applied via metaschema.append_field_smart_tags(). (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints, (6) provision_check_constraint() for top-level + deferred check constraints, (7) seed achievements from definition.achievements[] \u2014 resolves events_module by entity_prefix and creates INSERT actions for levels, level_requirements, and achievement_rewards tables. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level entries are deferred to phases 3-6 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n provision-check-constraint Creates a check constraint on a table from a $type + data blueprint definition. Supports: CheckOneOf (enum validation via = ANY(ARRAY[...])), CheckGreaterThan (single-column > value or cross-column), CheckLessThan (single-column < value or cross-column), CheckNotEqual (cross-column inequality). Builds AST expressions via ast_helpers and inserts into metaschema_public.check_constraint. Graceful: skips if a constraint with the same name already exists.\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; + "\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n default-ids-module defaultIdsModule CRUD operations\n membership-types-module membershipTypesModule CRUD operations\n user-state-module userStateModule CRUD operations\n session-secrets-module sessionSecretsModule CRUD operations\n config-secrets-org-module configSecretsOrgModule CRUD operations\n devices-module devicesModule CRUD operations\n i-18-n-module i18NModule CRUD operations\n user-credentials-module userCredentialsModule CRUD operations\n user-settings-module userSettingsModule CRUD operations\n config-secrets-user-module configSecretsUserModule CRUD operations\n connected-accounts-module connectedAccountsModule CRUD operations\n emails-module emailsModule CRUD operations\n phone-numbers-module phoneNumbersModule CRUD operations\n rate-limits-module rateLimitsModule CRUD operations\n users-module usersModule CRUD operations\n webauthn-credentials-module webauthnCredentialsModule CRUD operations\n crypto-addresses-module cryptoAddressesModule CRUD operations\n denormalized-table-field denormalizedTableField CRUD operations\n identity-providers-module identityProvidersModule CRUD operations\n rls-module rlsModule CRUD operations\n blueprint blueprint CRUD operations\n blueprint-template blueprintTemplate CRUD operations\n blueprint-construction blueprintConstruction CRUD operations\n crypto-auth-module cryptoAuthModule CRUD operations\n sessions-module sessionsModule CRUD operations\n secure-table-provision secureTableProvision CRUD operations\n merkle-store-module merkleStoreModule CRUD operations\n graph-module graphModule CRUD operations\n database-provision-module databaseProvisionModule CRUD operations\n config-secrets-module configSecretsModule CRUD operations\n rate-limit-meters-module rateLimitMetersModule CRUD operations\n realtime-module realtimeModule CRUD operations\n webauthn-auth-module webauthnAuthModule CRUD operations\n function-invocation-module functionInvocationModule CRUD operations\n function-module functionModule CRUD operations\n invites-module invitesModule CRUD operations\n compute-log-module computeLogModule CRUD operations\n inference-log-module inferenceLogModule CRUD operations\n namespace-module namespaceModule CRUD operations\n storage-log-module storageLogModule CRUD operations\n transfer-log-module transferLogModule CRUD operations\n function-deployment-module functionDeploymentModule CRUD operations\n plans-module plansModule CRUD operations\n billing-provider-module billingProviderModule CRUD operations\n db-usage-module dbUsageModule CRUD operations\n graph-execution-module graphExecutionModule CRUD operations\n hierarchy-module hierarchyModule CRUD operations\n permissions-module permissionsModule CRUD operations\n notifications-module notificationsModule CRUD operations\n profiles-module profilesModule CRUD operations\n billing-module billingModule CRUD operations\n relation-provision relationProvision CRUD operations\n user-auth-module userAuthModule CRUD operations\n agent-module agentModule CRUD operations\n limits-module limitsModule CRUD operations\n memberships-module membershipsModule CRUD operations\n entity-type-provision entityTypeProvision CRUD operations\n storage-module storageModule CRUD operations\n events-module eventsModule CRUD operations\n resolve-blueprint-field Resolves a field_name within a given table_id to a field_id. Throws if no match is found. Used by construct_blueprint to translate user-authored field names (e.g. \"location\") into field UUIDs for downstream provisioning procedures. table_id must already be resolved (via resolve_blueprint_table) before calling this.\n resolve-blueprint-table Resolves a table_name (with optional schema_name) to a table_id. Resolution order: (1) if schema_name provided, exact lookup via metaschema_public.schema.name + metaschema_public.table; (2) check local table_map (tables created in current blueprint); (3) search metaschema_public.table by name across all schemas; (4) if multiple matches, throw ambiguous error asking for schema_name; (5) if no match, throw not-found error.\n construct-blueprint Executes a blueprint definition by delegating to provision_* procedures. Creates a blueprint_construction record to track the attempt. Eight phases: (0) entity_type_provision for each membership_type entry \u2014 provisions entity tables, membership modules, and security. When a prefix already exists (e.g., 'org'), the entry extends the existing entity type instead of creating a new one; if a storage[] key is present, it provisions entity-scoped storage for that type. (0.5) scope-based storage: each storage[] entry has an optional scope ('app' or 'org' only). App-scoped storage seeds buckets at migration time. Org-scoped storage resolves the org membership type, creates org_buckets/org_files with owner_id, and seeds buckets per-entity via an AFTER INSERT trigger on the users table. When function_module is installed, a private functions bucket is auto-injected into org-scoped or entity-scoped storage entries. (1) provision_table() for each table with nodes[], fields[], policies[], and grants (table-level indexes/fts/unique_constraints/check_constraints are deferred). After provisioning, optional smart_tags (jsonb object) on the table entry are applied via metaschema.append_table_smart_tags(), and optional smart_tags on individual field entries are applied via metaschema.append_field_smart_tags(). (2) provision_relation() for each relation, (3) provision_index() for top-level + deferred indexes, (4) provision_full_text_search() for top-level + deferred FTS, (5) provision_unique_constraint() for top-level + deferred unique constraints, (6) provision_check_constraint() for top-level + deferred check constraints, (7) seed achievements from definition.achievements[] \u2014 resolves events_module by entity_prefix and creates INSERT actions for levels, level_requirements, and achievement_rewards tables. Phase 0 entity tables are added to the table_map so subsequent phases can reference them by name. Table-level entries are deferred to phases 3-6 so they can reference columns created by relations in phase 2. Returns the construction record ID on success, NULL on failure.\n provision-full-text-search Creates a full-text search configuration on a table. Accepts a jsonb definition with field (tsvector column name) and sources (array of {field, weight, lang}). Graceful: skips if FTS config already exists for the same (table_id, field_id). Returns the fts_id.\n provision-index Creates an index on a table. Accepts a jsonb definition with columns (array of names or single column string), access_method (default BTREE), is_unique, op_classes, options, and name (auto-generated if omitted). Graceful: skips if an index with the same (table_id, field_ids, access_method) already exists. Returns the index_id.\n provision-check-constraint Creates a check constraint on a table from a $type + data blueprint definition. Supports: CheckOneOf (enum validation via = ANY(ARRAY[...])), CheckGreaterThan (single-column > value or cross-column), CheckLessThan (single-column < value or cross-column), CheckNotEqual (cross-column inequality). Builds AST expressions via ast_helpers and inserts into metaschema_public.check_constraint. Graceful: skips if a constraint with the same name already exists.\n provision-unique-constraint Creates a unique constraint on a table. Accepts a jsonb definition with columns (array of field names). Graceful: skips if the exact same unique constraint already exists.\n copy-template-to-blueprint Creates a new blueprint by copying a template definition. Checks visibility: owners can always copy their own templates, others require public visibility. Increments the template copy_count. Returns the new blueprint ID.\n provision-spatial-relation Idempotent provisioner for metaschema_public.spatial_relation. Inserts a row declaring a spatial predicate between two geometry/geography columns (owner and target). Called from construct_blueprint when a relation entry has $type=RelationSpatial. Graceful: re-running with the same (source_table_id, name) returns the existing id without modifying the row. Operator whitelist and st_dwithin \u2194 param_name pairing are enforced by the spatial_relation table CHECKs. Both fields must already exist \u2014 this is a metadata-only insert.\n provision-table Composable table provisioning: creates or finds a table, then creates fields (so Data* modules can reference them), applies N nodes (Data* modules), enables RLS, creates grants, creates N policies, and optionally creates table-level indexes/full_text_searches/unique_constraints. All operations are graceful (skip existing). Accepts multiple nodes and multiple policies per call, unlike secure_table_provision which is limited to one of each. Returns (out_table_id, out_fields).\n provision-relation Composable relation provisioning: creates FK fields, indexes, unique constraints, and junction tables depending on the relation_type. Supports RelationBelongsTo, RelationHasOne, RelationHasMany, and RelationManyToMany. ManyToMany uses provision_table() internally for junction table creation with full node/grant/policy support. All operations are graceful (skip existing). Returns (out_field_id, out_junction_table_id, out_source_field_id, out_target_field_id).\n provision-bucket Provision an S3 bucket for a logical bucket in the database.\nReads the bucket config via RLS, then creates and configures\nthe S3 bucket with the appropriate privacy policies, CORS rules,\nand lifecycle settings.\n\n --help, -h Show this help message\n --version, -v Show version\n"; export const commands = async ( argv: Partial>, prompter: Inquirerer, diff --git a/sdk/constructive-cli/src/modules/cli/commands/function-deployment-module.ts b/sdk/constructive-cli/src/modules/cli/commands/function-deployment-module.ts new file mode 100644 index 0000000000..e30486580a --- /dev/null +++ b/sdk/constructive-cli/src/modules/cli/commands/function-deployment-module.ts @@ -0,0 +1,655 @@ +/** + * CLI commands for FunctionDeploymentModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + databaseId: 'uuid', + schemaId: 'uuid', + privateSchemaId: 'uuid', + publicSchemaName: 'string', + privateSchemaName: 'string', + deploymentsTableId: 'uuid', + deploymentEventsTableId: 'uuid', + deploymentsTableName: 'string', + deploymentEventsTableName: 'string', + apiName: 'string', + privateApiName: 'string', + scope: 'string', + prefix: 'string', + entityTableId: 'uuid', + functionModuleId: 'uuid', + namespaceModuleId: 'uuid', + policies: 'json', + provisions: 'json', + defaultPermissions: 'string', +}; +const usage = + '\nfunction-deployment-module \n\nCommands:\n list List functionDeploymentModule records\n find-first Find first matching functionDeploymentModule record\n get Get a functionDeploymentModule by ID\n create Create a new functionDeploymentModule\n update Update an existing functionDeploymentModule\n delete Delete a functionDeploymentModule\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + deploymentsTableId: true, + deploymentEventsTableId: true, + deploymentsTableName: true, + deploymentEventsTableName: true, + apiName: true, + privateApiName: true, + scope: true, + prefix: true, + entityTableId: true, + functionModuleId: true, + namespaceModuleId: true, + policies: true, + provisions: true, + defaultPermissions: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + > & { + select: FunctionDeploymentModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDeploymentModule.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + deploymentsTableId: true, + deploymentEventsTableId: true, + deploymentsTableName: true, + deploymentEventsTableName: true, + apiName: true, + privateApiName: true, + scope: true, + prefix: true, + entityTableId: true, + functionModuleId: true, + namespaceModuleId: true, + policies: true, + provisions: true, + defaultPermissions: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + > & { + select: FunctionDeploymentModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.functionDeploymentModule.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.functionDeploymentModule + .findOne({ + id: answers.id as string, + select: { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + deploymentsTableId: true, + deploymentEventsTableId: true, + deploymentsTableName: true, + deploymentEventsTableName: true, + apiName: true, + privateApiName: true, + scope: true, + prefix: true, + entityTableId: true, + functionModuleId: true, + namespaceModuleId: true, + policies: true, + provisions: true, + defaultPermissions: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableId', + message: 'deploymentsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableId', + message: 'deploymentEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableName', + message: 'deploymentsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableName', + message: 'deploymentEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateFunctionDeploymentModuleInput['functionDeploymentModule']; + const client = getClient(); + const result = await client.functionDeploymentModule + .create({ + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + privateSchemaId: cleanedData.privateSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + privateSchemaName: cleanedData.privateSchemaName, + deploymentsTableId: cleanedData.deploymentsTableId, + deploymentEventsTableId: cleanedData.deploymentEventsTableId, + deploymentsTableName: cleanedData.deploymentsTableName, + deploymentEventsTableName: cleanedData.deploymentEventsTableName, + apiName: cleanedData.apiName, + privateApiName: cleanedData.privateApiName, + scope: cleanedData.scope, + prefix: cleanedData.prefix, + entityTableId: cleanedData.entityTableId, + functionModuleId: cleanedData.functionModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + provisions: cleanedData.provisions, + defaultPermissions: cleanedData.defaultPermissions, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + deploymentsTableId: true, + deploymentEventsTableId: true, + deploymentsTableName: true, + deploymentEventsTableName: true, + apiName: true, + privateApiName: true, + scope: true, + prefix: true, + entityTableId: true, + functionModuleId: true, + namespaceModuleId: true, + policies: true, + provisions: true, + defaultPermissions: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableId', + message: 'deploymentsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableId', + message: 'deploymentEventsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentsTableName', + message: 'deploymentsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deploymentEventsTableName', + message: 'deploymentEventsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'functionModuleId', + message: 'functionModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'namespaceModuleId', + message: 'namespaceModuleId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as FunctionDeploymentModulePatch; + const client = getClient(); + const result = await client.functionDeploymentModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + privateSchemaId: cleanedData.privateSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + privateSchemaName: cleanedData.privateSchemaName, + deploymentsTableId: cleanedData.deploymentsTableId, + deploymentEventsTableId: cleanedData.deploymentEventsTableId, + deploymentsTableName: cleanedData.deploymentsTableName, + deploymentEventsTableName: cleanedData.deploymentEventsTableName, + apiName: cleanedData.apiName, + privateApiName: cleanedData.privateApiName, + scope: cleanedData.scope, + prefix: cleanedData.prefix, + entityTableId: cleanedData.entityTableId, + functionModuleId: cleanedData.functionModuleId, + namespaceModuleId: cleanedData.namespaceModuleId, + policies: cleanedData.policies, + provisions: cleanedData.provisions, + defaultPermissions: cleanedData.defaultPermissions, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + deploymentsTableId: true, + deploymentEventsTableId: true, + deploymentsTableName: true, + deploymentEventsTableName: true, + apiName: true, + privateApiName: true, + scope: true, + prefix: true, + entityTableId: true, + functionModuleId: true, + namespaceModuleId: true, + policies: true, + provisions: true, + defaultPermissions: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.functionDeploymentModule + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/graph-execution-module.ts b/sdk/constructive-cli/src/modules/cli/commands/graph-execution-module.ts new file mode 100644 index 0000000000..9956ad6ae1 --- /dev/null +++ b/sdk/constructive-cli/src/modules/cli/commands/graph-execution-module.ts @@ -0,0 +1,681 @@ +/** + * CLI commands for GraphExecutionModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; +import { getClient } from '../executor'; +import { coerceAnswers, parseFindFirstArgs, parseFindManyArgs, stripUndefined } from '../utils'; +import type { FieldSchema } from '../utils'; +import type { + CreateGraphExecutionModuleInput, + GraphExecutionModulePatch, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + databaseId: 'uuid', + schemaId: 'uuid', + privateSchemaId: 'uuid', + publicSchemaName: 'string', + privateSchemaName: 'string', + graphModuleId: 'uuid', + scope: 'string', + prefix: 'string', + executionsTableId: 'uuid', + outputsTableId: 'uuid', + nodeStatesTableId: 'uuid', + executionsTableName: 'string', + outputsTableName: 'string', + nodeStatesTableName: 'string', + apiName: 'string', + privateApiName: 'string', + entityTableId: 'uuid', + policies: 'json', + provisions: 'json', + defaultPermissions: 'string', + createdAt: 'string', +}; +const usage = + '\ngraph-execution-module \n\nCommands:\n list List graphExecutionModule records\n find-first Find first matching graphExecutionModule record\n get Get a graphExecutionModule by ID\n create Create a new graphExecutionModule\n update Update an existing graphExecutionModule\n delete Delete a graphExecutionModule\n\nList Options:\n --limit Max number of records to return (forward pagination)\n --last Number of records from the end (backward pagination)\n --after Cursor for forward pagination\n --before Cursor for backward pagination\n --offset Number of records to skip\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.name.equalTo foo)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\nFind-First Options:\n --select Comma-separated list of fields to return\n --where.. Filter (dot-notation, e.g. --where.status.equalTo active)\n --condition.. Condition filter (dot-notation)\n --orderBy Comma-separated ordering values (e.g. NAME_ASC,CREATED_AT_DESC)\n\n --help, -h Show this help message\n'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + if (argv.help || argv.h) { + console.log(usage); + process.exit(0); + } + const { first: subcommand, newArgv } = extractFirst(argv); + if (!subcommand) { + const answer = await prompter.prompt(argv, [ + { + type: 'autocomplete', + name: 'subcommand', + message: 'What do you want to do?', + options: ['list', 'find-first', 'get', 'create', 'update', 'delete'], + }, + ]); + return handleTableSubcommand(answer.subcommand as string, newArgv, prompter); + } + return handleTableSubcommand(subcommand, newArgv, prompter); +}; +async function handleTableSubcommand( + subcommand: string, + argv: Partial>, + prompter: Inquirerer +) { + switch (subcommand) { + case 'list': + return handleList(argv, prompter); + case 'find-first': + return handleFindFirst(argv, prompter); + case 'get': + return handleGet(argv, prompter); + case 'create': + return handleCreate(argv, prompter); + case 'update': + return handleUpdate(argv, prompter); + case 'delete': + return handleDelete(argv, prompter); + default: + console.log(usage); + process.exit(1); + } +} +async function handleList(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + graphModuleId: true, + scope: true, + prefix: true, + executionsTableId: true, + outputsTableId: true, + nodeStatesTableId: true, + executionsTableName: true, + outputsTableName: true, + nodeStatesTableName: true, + apiName: true, + privateApiName: true, + entityTableId: true, + policies: true, + provisions: true, + defaultPermissions: true, + createdAt: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + > & { + select: GraphExecutionModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.graphExecutionModule.findMany(findManyArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to list records.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleFindFirst(argv: Partial>, _prompter: Inquirerer) { + try { + const defaultSelect = { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + graphModuleId: true, + scope: true, + prefix: true, + executionsTableId: true, + outputsTableId: true, + nodeStatesTableId: true, + executionsTableName: true, + outputsTableName: true, + nodeStatesTableName: true, + apiName: true, + privateApiName: true, + entityTableId: true, + policies: true, + provisions: true, + defaultPermissions: true, + createdAt: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + > & { + select: GraphExecutionModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.graphExecutionModule.findFirst(findFirstArgs).execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to find record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleGet(argv: Partial>, prompter: Inquirerer) { + try { + const answers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const client = getClient(); + const result = await client.graphExecutionModule + .findOne({ + id: answers.id as string, + select: { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + graphModuleId: true, + scope: true, + prefix: true, + executionsTableId: true, + outputsTableId: true, + nodeStatesTableId: true, + executionsTableName: true, + outputsTableName: true, + nodeStatesTableName: true, + apiName: true, + privateApiName: true, + entityTableId: true, + policies: true, + provisions: true, + defaultPermissions: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Record not found.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleCreate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphModuleId', + message: 'graphModuleId', + required: true, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableId', + message: 'executionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableId', + message: 'outputsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'nodeStatesTableId', + message: 'nodeStatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableName', + message: 'executionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableName', + message: 'outputsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'nodeStatesTableName', + message: 'nodeStatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateGraphExecutionModuleInput['graphExecutionModule']; + const client = getClient(); + const result = await client.graphExecutionModule + .create({ + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + privateSchemaId: cleanedData.privateSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + privateSchemaName: cleanedData.privateSchemaName, + graphModuleId: cleanedData.graphModuleId, + scope: cleanedData.scope, + prefix: cleanedData.prefix, + executionsTableId: cleanedData.executionsTableId, + outputsTableId: cleanedData.outputsTableId, + nodeStatesTableId: cleanedData.nodeStatesTableId, + executionsTableName: cleanedData.executionsTableName, + outputsTableName: cleanedData.outputsTableName, + nodeStatesTableName: cleanedData.nodeStatesTableName, + apiName: cleanedData.apiName, + privateApiName: cleanedData.privateApiName, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + provisions: cleanedData.provisions, + defaultPermissions: cleanedData.defaultPermissions, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + graphModuleId: true, + scope: true, + prefix: true, + executionsTableId: true, + outputsTableId: true, + nodeStatesTableId: true, + executionsTableName: true, + outputsTableName: true, + nodeStatesTableName: true, + apiName: true, + privateApiName: true, + entityTableId: true, + policies: true, + provisions: true, + defaultPermissions: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to create record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleUpdate(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: false, + }, + { + type: 'text', + name: 'schemaId', + message: 'schemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaId', + message: 'privateSchemaId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'publicSchemaName', + message: 'publicSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateSchemaName', + message: 'privateSchemaName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'graphModuleId', + message: 'graphModuleId', + required: false, + }, + { + type: 'text', + name: 'scope', + message: 'scope', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'prefix', + message: 'prefix', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableId', + message: 'executionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableId', + message: 'outputsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'nodeStatesTableId', + message: 'nodeStatesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'executionsTableName', + message: 'executionsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'outputsTableName', + message: 'outputsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'nodeStatesTableName', + message: 'nodeStatesTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'privateApiName', + message: 'privateApiName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'entityTableId', + message: 'entityTableId', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'policies', + message: 'policies', + required: false, + skipPrompt: true, + }, + { + type: 'json', + name: 'provisions', + message: 'provisions', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'defaultPermissions', + message: 'defaultPermissions', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as GraphExecutionModulePatch; + const client = getClient(); + const result = await client.graphExecutionModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + privateSchemaId: cleanedData.privateSchemaId, + publicSchemaName: cleanedData.publicSchemaName, + privateSchemaName: cleanedData.privateSchemaName, + graphModuleId: cleanedData.graphModuleId, + scope: cleanedData.scope, + prefix: cleanedData.prefix, + executionsTableId: cleanedData.executionsTableId, + outputsTableId: cleanedData.outputsTableId, + nodeStatesTableId: cleanedData.nodeStatesTableId, + executionsTableName: cleanedData.executionsTableName, + outputsTableName: cleanedData.outputsTableName, + nodeStatesTableName: cleanedData.nodeStatesTableName, + apiName: cleanedData.apiName, + privateApiName: cleanedData.privateApiName, + entityTableId: cleanedData.entityTableId, + policies: cleanedData.policies, + provisions: cleanedData.provisions, + defaultPermissions: cleanedData.defaultPermissions, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + privateSchemaId: true, + publicSchemaName: true, + privateSchemaName: true, + graphModuleId: true, + scope: true, + prefix: true, + executionsTableId: true, + outputsTableId: true, + nodeStatesTableId: true, + executionsTableName: true, + outputsTableName: true, + nodeStatesTableName: true, + apiName: true, + privateApiName: true, + entityTableId: true, + policies: true, + provisions: true, + defaultPermissions: true, + createdAt: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to update record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} +async function handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'id', + message: 'id', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.graphExecutionModule + .delete({ + where: { + id: answers.id as string, + }, + select: { + id: true, + }, + }) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed to delete record.'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +} diff --git a/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts b/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts index a08293a729..00c4a64de1 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/graph-module.ts @@ -26,8 +26,6 @@ const fieldSchema: FieldSchema = { prefix: 'string', merkleStoreModuleId: 'uuid', graphsTableId: 'uuid', - executionsTableId: 'uuid', - outputsTableId: 'uuid', apiName: 'string', privateApiName: 'string', entityTableId: 'uuid', @@ -97,8 +95,6 @@ async function handleList(argv: Partial>, _prompter: Inq prefix: true, merkleStoreModuleId: true, graphsTableId: true, - executionsTableId: true, - outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, @@ -136,8 +132,6 @@ async function handleFindFirst(argv: Partial>, _prompter prefix: true, merkleStoreModuleId: true, graphsTableId: true, - executionsTableId: true, - outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, @@ -187,8 +181,6 @@ async function handleGet(argv: Partial>, prompter: Inqui prefix: true, merkleStoreModuleId: true, graphsTableId: true, - executionsTableId: true, - outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, @@ -272,20 +264,6 @@ async function handleCreate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, - { - type: 'text', - name: 'executionsTableId', - message: 'executionsTableId', - required: false, - skipPrompt: true, - }, - { - type: 'text', - name: 'outputsTableId', - message: 'outputsTableId', - required: false, - skipPrompt: true, - }, { type: 'text', name: 'apiName', @@ -347,8 +325,6 @@ async function handleCreate(argv: Partial>, prompter: In prefix: cleanedData.prefix, merkleStoreModuleId: cleanedData.merkleStoreModuleId, graphsTableId: cleanedData.graphsTableId, - executionsTableId: cleanedData.executionsTableId, - outputsTableId: cleanedData.outputsTableId, apiName: cleanedData.apiName, privateApiName: cleanedData.privateApiName, entityTableId: cleanedData.entityTableId, @@ -367,8 +343,6 @@ async function handleCreate(argv: Partial>, prompter: In prefix: true, merkleStoreModuleId: true, graphsTableId: true, - executionsTableId: true, - outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, @@ -458,20 +432,6 @@ async function handleUpdate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, - { - type: 'text', - name: 'executionsTableId', - message: 'executionsTableId', - required: false, - skipPrompt: true, - }, - { - type: 'text', - name: 'outputsTableId', - message: 'outputsTableId', - required: false, - skipPrompt: true, - }, { type: 'text', name: 'apiName', @@ -533,8 +493,6 @@ async function handleUpdate(argv: Partial>, prompter: In prefix: cleanedData.prefix, merkleStoreModuleId: cleanedData.merkleStoreModuleId, graphsTableId: cleanedData.graphsTableId, - executionsTableId: cleanedData.executionsTableId, - outputsTableId: cleanedData.outputsTableId, apiName: cleanedData.apiName, privateApiName: cleanedData.privateApiName, entityTableId: cleanedData.entityTableId, @@ -553,8 +511,6 @@ async function handleUpdate(argv: Partial>, prompter: In prefix: true, merkleStoreModuleId: true, graphsTableId: true, - executionsTableId: true, - outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, diff --git a/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts b/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts index bb98a56283..79db4e10f8 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/namespace-module.ts @@ -31,6 +31,7 @@ const fieldSchema: FieldSchema = { scope: 'string', prefix: 'string', entityTableId: 'uuid', + platformNamespacesTableId: 'uuid', policies: 'json', provisions: 'json', defaultPermissions: 'string', @@ -101,6 +102,7 @@ async function handleList(argv: Partial>, _prompter: Inq scope: true, prefix: true, entityTableId: true, + platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true, @@ -139,6 +141,7 @@ async function handleFindFirst(argv: Partial>, _prompter scope: true, prefix: true, entityTableId: true, + platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true, @@ -189,6 +192,7 @@ async function handleGet(argv: Partial>, prompter: Inqui scope: true, prefix: true, entityTableId: true, + platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true, @@ -304,6 +308,13 @@ async function handleCreate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, + { + type: 'text', + name: 'platformNamespacesTableId', + message: 'platformNamespacesTableId', + required: false, + skipPrompt: true, + }, { type: 'json', name: 'policies', @@ -349,6 +360,7 @@ async function handleCreate(argv: Partial>, prompter: In scope: cleanedData.scope, prefix: cleanedData.prefix, entityTableId: cleanedData.entityTableId, + platformNamespacesTableId: cleanedData.platformNamespacesTableId, policies: cleanedData.policies, provisions: cleanedData.provisions, defaultPermissions: cleanedData.defaultPermissions, @@ -369,6 +381,7 @@ async function handleCreate(argv: Partial>, prompter: In scope: true, prefix: true, entityTableId: true, + platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true, @@ -490,6 +503,13 @@ async function handleUpdate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, + { + type: 'text', + name: 'platformNamespacesTableId', + message: 'platformNamespacesTableId', + required: false, + skipPrompt: true, + }, { type: 'json', name: 'policies', @@ -535,6 +555,7 @@ async function handleUpdate(argv: Partial>, prompter: In scope: cleanedData.scope, prefix: cleanedData.prefix, entityTableId: cleanedData.entityTableId, + platformNamespacesTableId: cleanedData.platformNamespacesTableId, policies: cleanedData.policies, provisions: cleanedData.provisions, defaultPermissions: cleanedData.defaultPermissions, @@ -555,6 +576,7 @@ async function handleUpdate(argv: Partial>, prompter: In scope: true, prefix: true, entityTableId: true, + platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true, diff --git a/sdk/constructive-cli/src/modules/orm/README.md b/sdk/constructive-cli/src/modules/orm/README.md index 029e5d6ca7..495d56755f 100644 --- a/sdk/constructive-cli/src/modules/orm/README.md +++ b/sdk/constructive-cli/src/modules/orm/README.md @@ -57,14 +57,16 @@ const db = createClient({ | `functionInvocationModule` | findMany, findOne, create, update, delete | | `functionModule` | findMany, findOne, create, update, delete | | `invitesModule` | findMany, findOne, create, update, delete | -| `namespaceModule` | findMany, findOne, create, update, delete | | `computeLogModule` | findMany, findOne, create, update, delete | | `inferenceLogModule` | findMany, findOne, create, update, delete | +| `namespaceModule` | findMany, findOne, create, update, delete | | `storageLogModule` | findMany, findOne, create, update, delete | | `transferLogModule` | findMany, findOne, create, update, delete | +| `functionDeploymentModule` | findMany, findOne, create, update, delete | | `plansModule` | findMany, findOne, create, update, delete | | `billingProviderModule` | findMany, findOne, create, update, delete | | `dbUsageModule` | findMany, findOne, create, update, delete | +| `graphExecutionModule` | findMany, findOne, create, update, delete | | `hierarchyModule` | findMany, findOne, create, update, delete | | `permissionsModule` | findMany, findOne, create, update, delete | | `notificationsModule` | findMany, findOne, create, update, delete | @@ -1113,8 +1115,6 @@ CRUD operations for GraphModule records. | `prefix` | String | Yes | | `merkleStoreModuleId` | UUID | Yes | | `graphsTableId` | UUID | Yes | -| `executionsTableId` | UUID | Yes | -| `outputsTableId` | UUID | Yes | | `apiName` | String | Yes | | `privateApiName` | String | Yes | | `entityTableId` | UUID | Yes | @@ -1127,13 +1127,13 @@ CRUD operations for GraphModule records. ```typescript // List all graphModule records -const items = await db.graphModule.findMany({ select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const items = await db.graphModule.findMany({ select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Get one by id -const item = await db.graphModule.findOne({ id: '', select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const item = await db.graphModule.findOne({ id: '', select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Create -const created = await db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', executionsTableId: '', outputsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); +const created = await db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); // Update const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); @@ -1498,52 +1498,6 @@ const updated = await db.invitesModule.update({ where: { id: '' }, data: { const deleted = await db.invitesModule.delete({ where: { id: '' } }).execute(); ``` -### `db.namespaceModule` - -CRUD operations for NamespaceModule records. - -**Fields:** - -| Field | Type | Editable | -|-------|------|----------| -| `id` | UUID | No | -| `databaseId` | UUID | Yes | -| `schemaId` | UUID | Yes | -| `privateSchemaId` | UUID | Yes | -| `publicSchemaName` | String | Yes | -| `privateSchemaName` | String | Yes | -| `namespacesTableId` | UUID | Yes | -| `namespaceEventsTableId` | UUID | Yes | -| `namespacesTableName` | String | Yes | -| `namespaceEventsTableName` | String | Yes | -| `apiName` | String | Yes | -| `privateApiName` | String | Yes | -| `scope` | String | Yes | -| `prefix` | String | Yes | -| `entityTableId` | UUID | Yes | -| `policies` | JSON | Yes | -| `provisions` | JSON | Yes | -| `defaultPermissions` | String | Yes | - -**Operations:** - -```typescript -// List all namespaceModule records -const items = await db.namespaceModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); - -// Get one by id -const item = await db.namespaceModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); - -// Create -const created = await db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); - -// Update -const updated = await db.namespaceModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); - -// Delete -const deleted = await db.namespaceModule.delete({ where: { id: '' } }).execute(); -``` - ### `db.computeLogModule` CRUD operations for ComputeLogModule records. @@ -1638,6 +1592,53 @@ const updated = await db.inferenceLogModule.update({ where: { id: '' }, da const deleted = await db.inferenceLogModule.delete({ where: { id: '' } }).execute(); ``` +### `db.namespaceModule` + +CRUD operations for NamespaceModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `namespacesTableId` | UUID | Yes | +| `namespaceEventsTableId` | UUID | Yes | +| `namespacesTableName` | String | Yes | +| `namespaceEventsTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `entityTableId` | UUID | Yes | +| `platformNamespacesTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | + +**Operations:** + +```typescript +// List all namespaceModule records +const items = await db.namespaceModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Get one by id +const item = await db.namespaceModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Create +const created = await db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', platformNamespacesTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.namespaceModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.namespaceModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.storageLogModule` CRUD operations for StorageLogModule records. @@ -1732,6 +1733,54 @@ const updated = await db.transferLogModule.update({ where: { id: '' }, dat const deleted = await db.transferLogModule.delete({ where: { id: '' } }).execute(); ``` +### `db.functionDeploymentModule` + +CRUD operations for FunctionDeploymentModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `deploymentsTableId` | UUID | Yes | +| `deploymentEventsTableId` | UUID | Yes | +| `deploymentsTableName` | String | Yes | +| `deploymentEventsTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `entityTableId` | UUID | Yes | +| `functionModuleId` | UUID | Yes | +| `namespaceModuleId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | + +**Operations:** + +```typescript +// List all functionDeploymentModule records +const items = await db.functionDeploymentModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Get one by id +const item = await db.functionDeploymentModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Create +const created = await db.functionDeploymentModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', deploymentsTableId: '', deploymentEventsTableId: '', deploymentsTableName: '', deploymentEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', functionModuleId: '', namespaceModuleId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeploymentModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeploymentModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.plansModule` CRUD operations for PlansModule records. @@ -1881,6 +1930,56 @@ const updated = await db.dbUsageModule.update({ where: { id: '' }, data: { const deleted = await db.dbUsageModule.delete({ where: { id: '' } }).execute(); ``` +### `db.graphExecutionModule` + +CRUD operations for GraphExecutionModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `graphModuleId` | UUID | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `executionsTableId` | UUID | Yes | +| `outputsTableId` | UUID | Yes | +| `nodeStatesTableId` | UUID | Yes | +| `executionsTableName` | String | Yes | +| `outputsTableName` | String | Yes | +| `nodeStatesTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `entityTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all graphExecutionModule records +const items = await db.graphExecutionModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.graphExecutionModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); + +// Create +const created = await db.graphExecutionModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', graphModuleId: '', scope: '', prefix: '', executionsTableId: '', outputsTableId: '', nodeStatesTableId: '', executionsTableName: '', outputsTableName: '', nodeStatesTableName: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.graphExecutionModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.graphExecutionModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.hierarchyModule` CRUD operations for HierarchyModule records. diff --git a/sdk/constructive-cli/src/modules/orm/index.ts b/sdk/constructive-cli/src/modules/orm/index.ts index e8c151cfdb..7c5a882c52 100644 --- a/sdk/constructive-cli/src/modules/orm/index.ts +++ b/sdk/constructive-cli/src/modules/orm/index.ts @@ -41,14 +41,16 @@ import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; import { FunctionModuleModel } from './models/functionModule'; import { InvitesModuleModel } from './models/invitesModule'; -import { NamespaceModuleModel } from './models/namespaceModule'; import { ComputeLogModuleModel } from './models/computeLogModule'; import { InferenceLogModuleModel } from './models/inferenceLogModule'; +import { NamespaceModuleModel } from './models/namespaceModule'; import { StorageLogModuleModel } from './models/storageLogModule'; import { TransferLogModuleModel } from './models/transferLogModule'; +import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule'; import { PlansModuleModel } from './models/plansModule'; import { BillingProviderModuleModel } from './models/billingProviderModule'; import { DbUsageModuleModel } from './models/dbUsageModule'; +import { GraphExecutionModuleModel } from './models/graphExecutionModule'; import { HierarchyModuleModel } from './models/hierarchyModule'; import { PermissionsModuleModel } from './models/permissionsModule'; import { NotificationsModuleModel } from './models/notificationsModule'; @@ -133,14 +135,16 @@ export function createClient(config: OrmClientConfig) { functionInvocationModule: new FunctionInvocationModuleModel(client), functionModule: new FunctionModuleModel(client), invitesModule: new InvitesModuleModel(client), - namespaceModule: new NamespaceModuleModel(client), computeLogModule: new ComputeLogModuleModel(client), inferenceLogModule: new InferenceLogModuleModel(client), + namespaceModule: new NamespaceModuleModel(client), storageLogModule: new StorageLogModuleModel(client), transferLogModule: new TransferLogModuleModel(client), + functionDeploymentModule: new FunctionDeploymentModuleModel(client), plansModule: new PlansModuleModel(client), billingProviderModule: new BillingProviderModuleModel(client), dbUsageModule: new DbUsageModuleModel(client), + graphExecutionModule: new GraphExecutionModuleModel(client), hierarchyModule: new HierarchyModuleModel(client), permissionsModule: new PermissionsModuleModel(client), notificationsModule: new NotificationsModuleModel(client), diff --git a/sdk/constructive-cli/src/modules/orm/input-types.ts b/sdk/constructive-cli/src/modules/orm/input-types.ts index 62271cf277..ddd8bf6a34 100644 --- a/sdk/constructive-cli/src/modules/orm/input-types.ts +++ b/sdk/constructive-cli/src/modules/orm/input-types.ts @@ -635,8 +635,6 @@ export interface GraphModule { prefix?: string | null; merkleStoreModuleId?: string | null; graphsTableId?: string | null; - executionsTableId?: string | null; - outputsTableId?: string | null; apiName?: string | null; privateApiName?: string | null; entityTableId?: string | null; @@ -808,26 +806,6 @@ export interface InvitesModule { apiName?: string | null; privateApiName?: string | null; } -export interface NamespaceModule { - id: string; - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - namespacesTableId?: string | null; - namespaceEventsTableId?: string | null; - namespacesTableName?: string | null; - namespaceEventsTableName?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; -} export interface ComputeLogModule { id: string; databaseId?: string | null; @@ -870,6 +848,27 @@ export interface InferenceLogModule { apiName?: string | null; privateApiName?: string | null; } +export interface NamespaceModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + namespacesTableId?: string | null; + namespaceEventsTableId?: string | null; + namespacesTableName?: string | null; + namespaceEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + platformNamespacesTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} export interface StorageLogModule { id: string; databaseId?: string | null; @@ -912,6 +911,28 @@ export interface TransferLogModule { apiName?: string | null; privateApiName?: string | null; } +export interface FunctionDeploymentModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + deploymentsTableId?: string | null; + deploymentEventsTableId?: string | null; + deploymentsTableName?: string | null; + deploymentEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + functionModuleId?: string | null; + namespaceModuleId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} export interface PlansModule { id: string; databaseId?: string | null; @@ -983,6 +1004,30 @@ export interface DbUsageModule { apiName?: string | null; privateApiName?: string | null; } +export interface GraphExecutionModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + graphModuleId?: string | null; + scope?: string | null; + prefix?: string | null; + executionsTableId?: string | null; + outputsTableId?: string | null; + nodeStatesTableId?: string | null; + executionsTableName?: string | null; + outputsTableName?: string | null; + nodeStatesTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; + createdAt?: string | null; +} export interface HierarchyModule { id: string; databaseId?: string | null; @@ -1800,14 +1845,21 @@ export interface WebauthnAuthModuleRelations {} export interface FunctionInvocationModuleRelations {} export interface FunctionModuleRelations {} export interface InvitesModuleRelations {} -export interface NamespaceModuleRelations {} export interface ComputeLogModuleRelations {} export interface InferenceLogModuleRelations {} +export interface NamespaceModuleRelations {} export interface StorageLogModuleRelations {} export interface TransferLogModuleRelations {} +export interface FunctionDeploymentModuleRelations { + functionModule?: FunctionModule | null; + namespaceModule?: NamespaceModule | null; +} export interface PlansModuleRelations {} export interface BillingProviderModuleRelations {} export interface DbUsageModuleRelations {} +export interface GraphExecutionModuleRelations { + graphModule?: GraphModule | null; +} export interface HierarchyModuleRelations {} export interface PermissionsModuleRelations {} export interface NotificationsModuleRelations {} @@ -1873,15 +1925,19 @@ export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; -export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; +export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; export type StorageLogModuleWithRelations = StorageLogModule & StorageLogModuleRelations; export type TransferLogModuleWithRelations = TransferLogModule & TransferLogModuleRelations; +export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & + FunctionDeploymentModuleRelations; export type PlansModuleWithRelations = PlansModule & PlansModuleRelations; export type BillingProviderModuleWithRelations = BillingProviderModule & BillingProviderModuleRelations; export type DbUsageModuleWithRelations = DbUsageModule & DbUsageModuleRelations; +export type GraphExecutionModuleWithRelations = GraphExecutionModule & + GraphExecutionModuleRelations; export type HierarchyModuleWithRelations = HierarchyModule & HierarchyModuleRelations; export type PermissionsModuleWithRelations = PermissionsModule & PermissionsModuleRelations; export type NotificationsModuleWithRelations = NotificationsModule & NotificationsModuleRelations; @@ -2252,8 +2308,6 @@ export type GraphModuleSelect = { prefix?: boolean; merkleStoreModuleId?: boolean; graphsTableId?: boolean; - executionsTableId?: boolean; - outputsTableId?: boolean; apiName?: boolean; privateApiName?: boolean; entityTableId?: boolean; @@ -2413,26 +2467,6 @@ export type InvitesModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; -export type NamespaceModuleSelect = { - id?: boolean; - databaseId?: boolean; - schemaId?: boolean; - privateSchemaId?: boolean; - publicSchemaName?: boolean; - privateSchemaName?: boolean; - namespacesTableId?: boolean; - namespaceEventsTableId?: boolean; - namespacesTableName?: boolean; - namespaceEventsTableName?: boolean; - apiName?: boolean; - privateApiName?: boolean; - scope?: boolean; - prefix?: boolean; - entityTableId?: boolean; - policies?: boolean; - provisions?: boolean; - defaultPermissions?: boolean; -}; export type ComputeLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2475,6 +2509,27 @@ export type InferenceLogModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type NamespaceModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + namespacesTableId?: boolean; + namespaceEventsTableId?: boolean; + namespacesTableName?: boolean; + namespaceEventsTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + scope?: boolean; + prefix?: boolean; + entityTableId?: boolean; + platformNamespacesTableId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; +}; export type StorageLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2517,6 +2572,34 @@ export type TransferLogModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type FunctionDeploymentModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + deploymentsTableId?: boolean; + deploymentEventsTableId?: boolean; + deploymentsTableName?: boolean; + deploymentEventsTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + scope?: boolean; + prefix?: boolean; + entityTableId?: boolean; + functionModuleId?: boolean; + namespaceModuleId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; + functionModule?: { + select: FunctionModuleSelect; + }; + namespaceModule?: { + select: NamespaceModuleSelect; + }; +}; export type PlansModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2588,6 +2671,33 @@ export type DbUsageModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type GraphExecutionModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + graphModuleId?: boolean; + scope?: boolean; + prefix?: boolean; + executionsTableId?: boolean; + outputsTableId?: boolean; + nodeStatesTableId?: boolean; + executionsTableName?: boolean; + outputsTableName?: boolean; + nodeStatesTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + entityTableId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; + createdAt?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; +}; export type HierarchyModuleSelect = { id?: boolean; databaseId?: boolean; @@ -3796,10 +3906,6 @@ export interface GraphModuleFilter { merkleStoreModuleId?: UUIDFilter; /** Filter by the object’s `graphsTableId` field. */ graphsTableId?: UUIDFilter; - /** Filter by the object’s `executionsTableId` field. */ - executionsTableId?: UUIDFilter; - /** Filter by the object’s `outputsTableId` field. */ - outputsTableId?: UUIDFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ @@ -4151,50 +4257,6 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } -export interface NamespaceModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `schemaId` field. */ - schemaId?: UUIDFilter; - /** Filter by the object’s `privateSchemaId` field. */ - privateSchemaId?: UUIDFilter; - /** Filter by the object’s `publicSchemaName` field. */ - publicSchemaName?: StringFilter; - /** Filter by the object’s `privateSchemaName` field. */ - privateSchemaName?: StringFilter; - /** Filter by the object’s `namespacesTableId` field. */ - namespacesTableId?: UUIDFilter; - /** Filter by the object’s `namespaceEventsTableId` field. */ - namespaceEventsTableId?: UUIDFilter; - /** Filter by the object’s `namespacesTableName` field. */ - namespacesTableName?: StringFilter; - /** Filter by the object’s `namespaceEventsTableName` field. */ - namespaceEventsTableName?: StringFilter; - /** Filter by the object’s `apiName` field. */ - apiName?: StringFilter; - /** Filter by the object’s `privateApiName` field. */ - privateApiName?: StringFilter; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Filter by the object’s `entityTableId` field. */ - entityTableId?: UUIDFilter; - /** Filter by the object’s `policies` field. */ - policies?: JSONFilter; - /** Filter by the object’s `provisions` field. */ - provisions?: JSONFilter; - /** Filter by the object’s `defaultPermissions` field. */ - defaultPermissions?: StringListFilter; - /** Checks for all expressions in this list. */ - and?: NamespaceModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: NamespaceModuleFilter[]; - /** Negates the expression. */ - not?: NamespaceModuleFilter; -} export interface ComputeLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -4287,7 +4349,7 @@ export interface InferenceLogModuleFilter { /** Negates the expression. */ not?: InferenceLogModuleFilter; } -export interface StorageLogModuleFilter { +export interface NamespaceModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -4300,40 +4362,86 @@ export interface StorageLogModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `storageLogTableId` field. */ - storageLogTableId?: UUIDFilter; - /** Filter by the object’s `storageLogTableName` field. */ - storageLogTableName?: StringFilter; - /** Filter by the object’s `usageDailyTableId` field. */ - usageDailyTableId?: UUIDFilter; - /** Filter by the object’s `usageDailyTableName` field. */ - usageDailyTableName?: StringFilter; - /** Filter by the object’s `interval` field. */ - interval?: StringFilter; - /** Filter by the object’s `retention` field. */ - retention?: StringFilter; - /** Filter by the object’s `premake` field. */ - premake?: IntFilter; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `actorFkTableId` field. */ - actorFkTableId?: UUIDFilter; - /** Filter by the object’s `entityFkTableId` field. */ - entityFkTableId?: UUIDFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; + /** Filter by the object’s `namespacesTableId` field. */ + namespacesTableId?: UUIDFilter; + /** Filter by the object’s `namespaceEventsTableId` field. */ + namespaceEventsTableId?: UUIDFilter; + /** Filter by the object’s `namespacesTableName` field. */ + namespacesTableName?: StringFilter; + /** Filter by the object’s `namespaceEventsTableName` field. */ + namespaceEventsTableName?: StringFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ privateApiName?: StringFilter; - /** Checks for all expressions in this list. */ - and?: StorageLogModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: StorageLogModuleFilter[]; - /** Negates the expression. */ - not?: StorageLogModuleFilter; -} -export interface TransferLogModuleFilter { + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `platformNamespacesTableId` field. */ + platformNamespacesTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: NamespaceModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: NamespaceModuleFilter[]; + /** Negates the expression. */ + not?: NamespaceModuleFilter; +} +export interface StorageLogModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `storageLogTableId` field. */ + storageLogTableId?: UUIDFilter; + /** Filter by the object’s `storageLogTableName` field. */ + storageLogTableName?: StringFilter; + /** Filter by the object’s `usageDailyTableId` field. */ + usageDailyTableId?: UUIDFilter; + /** Filter by the object’s `usageDailyTableName` field. */ + usageDailyTableName?: StringFilter; + /** Filter by the object’s `interval` field. */ + interval?: StringFilter; + /** Filter by the object’s `retention` field. */ + retention?: StringFilter; + /** Filter by the object’s `premake` field. */ + premake?: IntFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `actorFkTableId` field. */ + actorFkTableId?: UUIDFilter; + /** Filter by the object’s `entityFkTableId` field. */ + entityFkTableId?: UUIDFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: StorageLogModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: StorageLogModuleFilter[]; + /** Negates the expression. */ + not?: StorageLogModuleFilter; +} +export interface TransferLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -4379,6 +4487,62 @@ export interface TransferLogModuleFilter { /** Negates the expression. */ not?: TransferLogModuleFilter; } +export interface FunctionDeploymentModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `deploymentsTableId` field. */ + deploymentsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentEventsTableId` field. */ + deploymentEventsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentsTableName` field. */ + deploymentsTableName?: StringFilter; + /** Filter by the object’s `deploymentEventsTableName` field. */ + deploymentEventsTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `functionModuleId` field. */ + functionModuleId?: UUIDFilter; + /** Filter by the object’s `namespaceModuleId` field. */ + namespaceModuleId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentModuleFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentModuleFilter; + /** Filter by the object’s `functionModule` relation. */ + functionModule?: FunctionModuleFilter; + /** A related `functionModule` exists. */ + functionModuleExists?: boolean; + /** Filter by the object’s `namespaceModule` relation. */ + namespaceModule?: NamespaceModuleFilter; + /** A related `namespaceModule` exists. */ + namespaceModuleExists?: boolean; +} export interface PlansModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -4533,6 +4697,60 @@ export interface DbUsageModuleFilter { /** Negates the expression. */ not?: DbUsageModuleFilter; } +export interface GraphExecutionModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `graphModuleId` field. */ + graphModuleId?: UUIDFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `executionsTableId` field. */ + executionsTableId?: UUIDFilter; + /** Filter by the object’s `outputsTableId` field. */ + outputsTableId?: UUIDFilter; + /** Filter by the object’s `nodeStatesTableId` field. */ + nodeStatesTableId?: UUIDFilter; + /** Filter by the object’s `executionsTableName` field. */ + executionsTableName?: StringFilter; + /** Filter by the object’s `outputsTableName` field. */ + outputsTableName?: StringFilter; + /** Filter by the object’s `nodeStatesTableName` field. */ + nodeStatesTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: GraphExecutionModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: GraphExecutionModuleFilter[]; + /** Negates the expression. */ + not?: GraphExecutionModuleFilter; + /** Filter by the object’s `graphModule` relation. */ + graphModule?: GraphModuleFilter; +} export interface HierarchyModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -6090,10 +6308,6 @@ export type GraphModuleOrderBy = | 'MERKLE_STORE_MODULE_ID_DESC' | 'GRAPHS_TABLE_ID_ASC' | 'GRAPHS_TABLE_ID_DESC' - | 'EXECUTIONS_TABLE_ID_ASC' - | 'EXECUTIONS_TABLE_ID_DESC' - | 'OUTPUTS_TABLE_ID_ASC' - | 'OUTPUTS_TABLE_ID_DESC' | 'API_NAME_ASC' | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' @@ -6404,46 +6618,6 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; -export type NamespaceModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'SCHEMA_ID_ASC' - | 'SCHEMA_ID_DESC' - | 'PRIVATE_SCHEMA_ID_ASC' - | 'PRIVATE_SCHEMA_ID_DESC' - | 'PUBLIC_SCHEMA_NAME_ASC' - | 'PUBLIC_SCHEMA_NAME_DESC' - | 'PRIVATE_SCHEMA_NAME_ASC' - | 'PRIVATE_SCHEMA_NAME_DESC' - | 'NAMESPACES_TABLE_ID_ASC' - | 'NAMESPACES_TABLE_ID_DESC' - | 'NAMESPACE_EVENTS_TABLE_ID_ASC' - | 'NAMESPACE_EVENTS_TABLE_ID_DESC' - | 'NAMESPACES_TABLE_NAME_ASC' - | 'NAMESPACES_TABLE_NAME_DESC' - | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' - | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' - | 'API_NAME_ASC' - | 'API_NAME_DESC' - | 'PRIVATE_API_NAME_ASC' - | 'PRIVATE_API_NAME_DESC' - | 'SCOPE_ASC' - | 'SCOPE_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC' - | 'ENTITY_TABLE_ID_ASC' - | 'ENTITY_TABLE_ID_DESC' - | 'POLICIES_ASC' - | 'POLICIES_DESC' - | 'PROVISIONS_ASC' - | 'PROVISIONS_DESC' - | 'DEFAULT_PERMISSIONS_ASC' - | 'DEFAULT_PERMISSIONS_DESC'; export type ComputeLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6528,6 +6702,48 @@ export type InferenceLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type NamespaceModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'PLATFORM_NAMESPACES_TABLE_ID_ASC' + | 'PLATFORM_NAMESPACES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; export type StorageLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6612,6 +6828,50 @@ export type TransferLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type FunctionDeploymentModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; export type PlansModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6754,6 +7014,54 @@ export type DbUsageModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type GraphExecutionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; export type HierarchyModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -8503,8 +8811,6 @@ export interface CreateGraphModuleInput { prefix?: string; merkleStoreModuleId: string; graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; apiName?: string; privateApiName?: string; entityTableId?: string; @@ -8523,8 +8829,6 @@ export interface GraphModulePatch { prefix?: string | null; merkleStoreModuleId?: string | null; graphsTableId?: string | null; - executionsTableId?: string | null; - outputsTableId?: string | null; apiName?: string | null; privateApiName?: string | null; entityTableId?: string | null; @@ -8913,56 +9217,6 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } -export interface CreateNamespaceModuleInput { - clientMutationId?: string; - namespaceModule: { - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - defaultPermissions?: string[]; - }; -} -export interface NamespaceModulePatch { - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - namespacesTableId?: string | null; - namespaceEventsTableId?: string | null; - namespacesTableName?: string | null; - namespaceEventsTableName?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; -} -export interface UpdateNamespaceModuleInput { - clientMutationId?: string; - id: string; - namespaceModulePatch: NamespaceModulePatch; -} -export interface DeleteNamespaceModuleInput { - clientMutationId?: string; - id: string; -} export interface CreateComputeLogModuleInput { clientMutationId?: string; computeLogModule: { @@ -9067,6 +9321,58 @@ export interface DeleteInferenceLogModuleInput { clientMutationId?: string; id: string; } +export interface CreateNamespaceModuleInput { + clientMutationId?: string; + namespaceModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface NamespaceModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + namespacesTableId?: string | null; + namespaceEventsTableId?: string | null; + namespacesTableName?: string | null; + namespaceEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + platformNamespacesTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} +export interface UpdateNamespaceModuleInput { + clientMutationId?: string; + id: string; + namespaceModulePatch: NamespaceModulePatch; +} +export interface DeleteNamespaceModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateStorageLogModuleInput { clientMutationId?: string; storageLogModule: { @@ -9171,6 +9477,60 @@ export interface DeleteTransferLogModuleInput { clientMutationId?: string; id: string; } +export interface CreateFunctionDeploymentModuleInput { + clientMutationId?: string; + functionDeploymentModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface FunctionDeploymentModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + deploymentsTableId?: string | null; + deploymentEventsTableId?: string | null; + deploymentsTableName?: string | null; + deploymentEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + functionModuleId?: string | null; + namespaceModuleId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} +export interface UpdateFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; +} +export interface DeleteFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; +} export interface CreatePlansModuleInput { clientMutationId?: string; plansModule: { @@ -9330,16 +9690,72 @@ export interface DbUsageModulePatch { premake?: number | null; scope?: string | null; prefix?: string | null; - defaultPermissions?: string[] | null; + defaultPermissions?: string[] | null; + apiName?: string | null; + privateApiName?: string | null; +} +export interface UpdateDbUsageModuleInput { + clientMutationId?: string; + id: string; + dbUsageModulePatch: DbUsageModulePatch; +} +export interface DeleteDbUsageModuleInput { + clientMutationId?: string; + id: string; +} +export interface CreateGraphExecutionModuleInput { + clientMutationId?: string; + graphExecutionModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface GraphExecutionModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + graphModuleId?: string | null; + scope?: string | null; + prefix?: string | null; + executionsTableId?: string | null; + outputsTableId?: string | null; + nodeStatesTableId?: string | null; + executionsTableName?: string | null; + outputsTableName?: string | null; + nodeStatesTableName?: string | null; apiName?: string | null; privateApiName?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; } -export interface UpdateDbUsageModuleInput { +export interface UpdateGraphExecutionModuleInput { clientMutationId?: string; id: string; - dbUsageModulePatch: DbUsageModulePatch; + graphExecutionModulePatch: GraphExecutionModulePatch; } -export interface DeleteDbUsageModuleInput { +export interface DeleteGraphExecutionModuleInput { clientMutationId?: string; id: string; } @@ -10963,8 +11379,6 @@ export interface GraphModuleInput { prefix?: string; merkleStoreModuleId: string; graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; apiName?: string; privateApiName?: string; entityTableId?: string; @@ -11138,27 +11552,6 @@ export interface InvitesModuleInput { apiName?: string; privateApiName?: string; } -/** An input for mutations affecting `NamespaceModule` */ -export interface NamespaceModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - defaultPermissions?: string[]; -} /** An input for mutations affecting `ComputeLogModule` */ export interface ComputeLogModuleInput { id?: string; @@ -11203,6 +11596,28 @@ export interface InferenceLogModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `NamespaceModule` */ +export interface NamespaceModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; +} /** An input for mutations affecting `StorageLogModule` */ export interface StorageLogModuleInput { id?: string; @@ -11247,6 +11662,29 @@ export interface TransferLogModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `FunctionDeploymentModule` */ +export interface FunctionDeploymentModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; +} /** An input for mutations affecting `PlansModule` */ export interface PlansModuleInput { id?: string; @@ -11321,6 +11759,31 @@ export interface DbUsageModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `GraphExecutionModule` */ +export interface GraphExecutionModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + createdAt?: string; +} /** An input for mutations affecting `HierarchyModule` */ export interface HierarchyModuleInput { id?: string; @@ -12226,10 +12689,6 @@ export interface GraphModuleFilter { merkleStoreModuleId?: UUIDFilter; /** Filter by the object’s `graphsTableId` field. */ graphsTableId?: UUIDFilter; - /** Filter by the object’s `executionsTableId` field. */ - executionsTableId?: UUIDFilter; - /** Filter by the object’s `outputsTableId` field. */ - outputsTableId?: UUIDFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ @@ -14239,51 +14698,6 @@ export type DeleteInvitesModulePayloadSelect = { select: InvitesModuleEdgeSelect; }; }; -export interface CreateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was created by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type CreateNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; -export interface UpdateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was updated by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type UpdateNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; -export interface DeleteNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was deleted by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type DeleteNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ @@ -14374,6 +14788,51 @@ export type DeleteInferenceLogModulePayloadSelect = { select: InferenceLogModuleEdgeSelect; }; }; +export interface CreateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was created by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type CreateNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; +export interface UpdateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was updated by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type UpdateNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; +export interface DeleteNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was deleted by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type DeleteNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; export interface CreateStorageLogModulePayload { clientMutationId?: string | null; /** The `StorageLogModule` that was created by this mutation. */ @@ -14464,6 +14923,51 @@ export type DeleteTransferLogModulePayloadSelect = { select: TransferLogModuleEdgeSelect; }; }; +export interface CreateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was created by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type CreateFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was updated by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type UpdateFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was deleted by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type DeleteFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; export interface CreatePlansModulePayload { clientMutationId?: string | null; /** The `PlansModule` that was created by this mutation. */ @@ -14599,6 +15103,51 @@ export type DeleteDbUsageModulePayloadSelect = { select: DbUsageModuleEdgeSelect; }; }; +export interface CreateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was created by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type CreateGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; +export interface UpdateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was updated by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type UpdateGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; +export interface DeleteGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was deleted by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type DeleteGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; export interface CreateHierarchyModulePayload { clientMutationId?: string | null; /** The `HierarchyModule` that was created by this mutation. */ @@ -15636,18 +16185,6 @@ export type InvitesModuleEdgeSelect = { select: InvitesModuleSelect; }; }; -/** A `NamespaceModule` edge in the connection. */ -export interface NamespaceModuleEdge { - cursor?: string | null; - /** The `NamespaceModule` at the end of the edge. */ - node?: NamespaceModule | null; -} -export type NamespaceModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: NamespaceModuleSelect; - }; -}; /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; @@ -15672,6 +16209,18 @@ export type InferenceLogModuleEdgeSelect = { select: InferenceLogModuleSelect; }; }; +/** A `NamespaceModule` edge in the connection. */ +export interface NamespaceModuleEdge { + cursor?: string | null; + /** The `NamespaceModule` at the end of the edge. */ + node?: NamespaceModule | null; +} +export type NamespaceModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: NamespaceModuleSelect; + }; +}; /** A `StorageLogModule` edge in the connection. */ export interface StorageLogModuleEdge { cursor?: string | null; @@ -15696,6 +16245,18 @@ export type TransferLogModuleEdgeSelect = { select: TransferLogModuleSelect; }; }; +/** A `FunctionDeploymentModule` edge in the connection. */ +export interface FunctionDeploymentModuleEdge { + cursor?: string | null; + /** The `FunctionDeploymentModule` at the end of the edge. */ + node?: FunctionDeploymentModule | null; +} +export type FunctionDeploymentModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentModuleSelect; + }; +}; /** A `PlansModule` edge in the connection. */ export interface PlansModuleEdge { cursor?: string | null; @@ -15732,6 +16293,18 @@ export type DbUsageModuleEdgeSelect = { select: DbUsageModuleSelect; }; }; +/** A `GraphExecutionModule` edge in the connection. */ +export interface GraphExecutionModuleEdge { + cursor?: string | null; + /** The `GraphExecutionModule` at the end of the edge. */ + node?: GraphExecutionModule | null; +} +export type GraphExecutionModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: GraphExecutionModuleSelect; + }; +}; /** A `HierarchyModule` edge in the connection. */ export interface HierarchyModuleEdge { cursor?: string | null; diff --git a/sdk/constructive-cli/src/modules/orm/models/agentModule.ts b/sdk/constructive-cli/src/modules/orm/models/agentModule.ts index ad2ea4a388..ec52583704 100644 --- a/sdk/constructive-cli/src/modules/orm/models/agentModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/agentModule.ts @@ -196,7 +196,8 @@ export class AgentModuleModel { 'UpdateAgentModuleInput', 'id', 'agentModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/billingModule.ts b/sdk/constructive-cli/src/modules/orm/models/billingModule.ts index 712d75ae7b..432eb970f3 100644 --- a/sdk/constructive-cli/src/modules/orm/models/billingModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/billingModule.ts @@ -196,7 +196,8 @@ export class BillingModuleModel { 'UpdateBillingModuleInput', 'id', 'billingModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts b/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts index a7e3345201..16a8a68460 100644 --- a/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/billingProviderModule.ts @@ -198,7 +198,8 @@ export class BillingProviderModuleModel { 'UpdateBillingProviderModuleInput', 'id', 'billingProviderModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/blueprint.ts b/sdk/constructive-cli/src/modules/orm/models/blueprint.ts index 239c50eb99..48e4dc3d89 100644 --- a/sdk/constructive-cli/src/modules/orm/models/blueprint.ts +++ b/sdk/constructive-cli/src/modules/orm/models/blueprint.ts @@ -196,7 +196,8 @@ export class BlueprintModel { 'UpdateBlueprintInput', 'id', 'blueprintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts b/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts index dad6db0bff..ee6a157760 100644 --- a/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts +++ b/sdk/constructive-cli/src/modules/orm/models/blueprintConstruction.ts @@ -198,7 +198,8 @@ export class BlueprintConstructionModel { 'UpdateBlueprintConstructionInput', 'id', 'blueprintConstructionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts b/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts index 1f957cdeda..486ef1c8e2 100644 --- a/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts +++ b/sdk/constructive-cli/src/modules/orm/models/blueprintTemplate.ts @@ -196,7 +196,8 @@ export class BlueprintTemplateModel { 'UpdateBlueprintTemplateInput', 'id', 'blueprintTemplatePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts index 2e36321ef1..3451b45608 100644 --- a/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/computeLogModule.ts @@ -196,7 +196,8 @@ export class ComputeLogModuleModel { 'UpdateComputeLogModuleInput', 'id', 'computeLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/configSecretsModule.ts b/sdk/constructive-cli/src/modules/orm/models/configSecretsModule.ts index 5d482c9ccf..59a6edd5cd 100644 --- a/sdk/constructive-cli/src/modules/orm/models/configSecretsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/configSecretsModule.ts @@ -196,7 +196,8 @@ export class ConfigSecretsModuleModel { 'UpdateConfigSecretsModuleInput', 'id', 'configSecretsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/configSecretsOrgModule.ts b/sdk/constructive-cli/src/modules/orm/models/configSecretsOrgModule.ts index ef53f2d5cd..08969c552d 100644 --- a/sdk/constructive-cli/src/modules/orm/models/configSecretsOrgModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/configSecretsOrgModule.ts @@ -198,7 +198,8 @@ export class ConfigSecretsOrgModuleModel { 'UpdateConfigSecretsOrgModuleInput', 'id', 'configSecretsOrgModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts b/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts index b1b8f0cacb..bd97e5bf01 100644 --- a/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/configSecretsUserModule.ts @@ -198,7 +198,8 @@ export class ConfigSecretsUserModuleModel { 'UpdateConfigSecretsUserModuleInput', 'id', 'configSecretsUserModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts b/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts index 226307b4b8..64b1dc5c4c 100644 --- a/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/connectedAccountsModule.ts @@ -198,7 +198,8 @@ export class ConnectedAccountsModuleModel { 'UpdateConnectedAccountsModuleInput', 'id', 'connectedAccountsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts b/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts index 6618ae4e90..c7797726bf 100644 --- a/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/cryptoAddressesModule.ts @@ -198,7 +198,8 @@ export class CryptoAddressesModuleModel { 'UpdateCryptoAddressesModuleInput', 'id', 'cryptoAddressesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts index c90349b9d4..d975e75267 100644 --- a/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/cryptoAuthModule.ts @@ -196,7 +196,8 @@ export class CryptoAuthModuleModel { 'UpdateCryptoAuthModuleInput', 'id', 'cryptoAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts b/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts index 4cf322de69..1d9457eed6 100644 --- a/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/databaseProvisionModule.ts @@ -198,7 +198,8 @@ export class DatabaseProvisionModuleModel { 'UpdateDatabaseProvisionModuleInput', 'id', 'databaseProvisionModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts b/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts index 69aa58b980..45fc6b2a64 100644 --- a/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/dbUsageModule.ts @@ -196,7 +196,8 @@ export class DbUsageModuleModel { 'UpdateDbUsageModuleInput', 'id', 'dbUsageModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts b/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts index 9553db8ed7..957d0061e4 100644 --- a/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/defaultIdsModule.ts @@ -196,7 +196,8 @@ export class DefaultIdsModuleModel { 'UpdateDefaultIdsModuleInput', 'id', 'defaultIdsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts b/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts index 881f2ffdb7..bdc83099a2 100644 --- a/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts +++ b/sdk/constructive-cli/src/modules/orm/models/denormalizedTableField.ts @@ -198,7 +198,8 @@ export class DenormalizedTableFieldModel { 'UpdateDenormalizedTableFieldInput', 'id', 'denormalizedTableFieldPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts b/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts index 8c9a7e06ee..8dc6cf5282 100644 --- a/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/devicesModule.ts @@ -196,7 +196,8 @@ export class DevicesModuleModel { 'UpdateDevicesModuleInput', 'id', 'devicesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts b/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts index e95985b852..f3a2297a8a 100644 --- a/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/emailsModule.ts @@ -196,7 +196,8 @@ export class EmailsModuleModel { 'UpdateEmailsModuleInput', 'id', 'emailsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts b/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts index 93373a3dd4..c8e87d8f9c 100644 --- a/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts +++ b/sdk/constructive-cli/src/modules/orm/models/entityTypeProvision.ts @@ -196,7 +196,8 @@ export class EntityTypeProvisionModel { 'UpdateEntityTypeProvisionInput', 'id', 'entityTypeProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts b/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts index fb45e27ce3..0f07d39979 100644 --- a/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/eventsModule.ts @@ -196,7 +196,8 @@ export class EventsModuleModel { 'UpdateEventsModuleInput', 'id', 'eventsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/functionDeploymentModule.ts b/sdk/constructive-cli/src/modules/orm/models/functionDeploymentModule.ts new file mode 100644 index 0000000000..afe50267f8 --- /dev/null +++ b/sdk/constructive-cli/src/modules/orm/models/functionDeploymentModule.ts @@ -0,0 +1,247 @@ +/** + * FunctionDeploymentModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentModule, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, + CreateFunctionDeploymentModuleInput, + UpdateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', + document, + variables, + transform: (data: { + functionDeploymentModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', + document, + variables, + transform: (data: { + functionDeploymentModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentModule', + 'createFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.data, + 'CreateFunctionDeploymentModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'createFunctionDeploymentModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentModule', + 'updateFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentModuleInput', + 'id', + 'functionDeploymentModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'updateFunctionDeploymentModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentModule', + 'deleteFunctionDeploymentModule', + 'functionDeploymentModule', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'deleteFunctionDeploymentModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts b/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts index f8b9e92fc1..ba40e892ea 100644 --- a/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/functionInvocationModule.ts @@ -198,7 +198,8 @@ export class FunctionInvocationModuleModel { 'UpdateFunctionInvocationModuleInput', 'id', 'functionInvocationModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/functionModule.ts b/sdk/constructive-cli/src/modules/orm/models/functionModule.ts index 5c0e724d4c..7e127377dd 100644 --- a/sdk/constructive-cli/src/modules/orm/models/functionModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/functionModule.ts @@ -196,7 +196,8 @@ export class FunctionModuleModel { 'UpdateFunctionModuleInput', 'id', 'functionModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/graphExecutionModule.ts b/sdk/constructive-cli/src/modules/orm/models/graphExecutionModule.ts new file mode 100644 index 0000000000..9f1866c036 --- /dev/null +++ b/sdk/constructive-cli/src/modules/orm/models/graphExecutionModule.ts @@ -0,0 +1,247 @@ +/** + * GraphExecutionModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GraphExecutionModule, + GraphExecutionModuleWithRelations, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, + CreateGraphExecutionModuleInput, + UpdateGraphExecutionModuleInput, + GraphExecutionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class GraphExecutionModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModules: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', + document, + variables, + transform: (data: { + graphExecutionModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', + document, + variables, + transform: (data: { + graphExecutionModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'GraphExecutionModule', + 'createGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.data, + 'CreateGraphExecutionModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'createGraphExecutionModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphExecutionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'GraphExecutionModule', + 'updateGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphExecutionModuleInput', + 'id', + 'graphExecutionModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'updateGraphExecutionModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'GraphExecutionModule', + 'deleteGraphExecutionModule', + 'graphExecutionModule', + { + id: args.where.id, + }, + 'DeleteGraphExecutionModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'deleteGraphExecutionModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/modules/orm/models/graphModule.ts b/sdk/constructive-cli/src/modules/orm/models/graphModule.ts index deaa311f4c..f337b77ed9 100644 --- a/sdk/constructive-cli/src/modules/orm/models/graphModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/graphModule.ts @@ -196,7 +196,8 @@ export class GraphModuleModel { 'UpdateGraphModuleInput', 'id', 'graphModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts b/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts index e1eca248c8..16e9170d2b 100644 --- a/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/hierarchyModule.ts @@ -196,7 +196,8 @@ export class HierarchyModuleModel { 'UpdateHierarchyModuleInput', 'id', 'hierarchyModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts b/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts index a1162a5f5f..014ecefd15 100644 --- a/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/i18NModule.ts @@ -196,7 +196,8 @@ export class I18NModuleModel { 'UpdateI18NModuleInput', 'id', 'i18NModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts b/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts index 86a507559d..bc564b56d1 100644 --- a/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/identityProvidersModule.ts @@ -198,7 +198,8 @@ export class IdentityProvidersModuleModel { 'UpdateIdentityProvidersModuleInput', 'id', 'identityProvidersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/index.ts b/sdk/constructive-cli/src/modules/orm/models/index.ts index f478d2642f..2ff305f2fc 100644 --- a/sdk/constructive-cli/src/modules/orm/models/index.ts +++ b/sdk/constructive-cli/src/modules/orm/models/index.ts @@ -39,14 +39,16 @@ export { WebauthnAuthModuleModel } from './webauthnAuthModule'; export { FunctionInvocationModuleModel } from './functionInvocationModule'; export { FunctionModuleModel } from './functionModule'; export { InvitesModuleModel } from './invitesModule'; -export { NamespaceModuleModel } from './namespaceModule'; export { ComputeLogModuleModel } from './computeLogModule'; export { InferenceLogModuleModel } from './inferenceLogModule'; +export { NamespaceModuleModel } from './namespaceModule'; export { StorageLogModuleModel } from './storageLogModule'; export { TransferLogModuleModel } from './transferLogModule'; +export { FunctionDeploymentModuleModel } from './functionDeploymentModule'; export { PlansModuleModel } from './plansModule'; export { BillingProviderModuleModel } from './billingProviderModule'; export { DbUsageModuleModel } from './dbUsageModule'; +export { GraphExecutionModuleModel } from './graphExecutionModule'; export { HierarchyModuleModel } from './hierarchyModule'; export { PermissionsModuleModel } from './permissionsModule'; export { NotificationsModuleModel } from './notificationsModule'; diff --git a/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts index f6f4ab2452..f4c0f77d3b 100644 --- a/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/inferenceLogModule.ts @@ -196,7 +196,8 @@ export class InferenceLogModuleModel { 'UpdateInferenceLogModuleInput', 'id', 'inferenceLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts b/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts index b31e122a08..b244078720 100644 --- a/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/invitesModule.ts @@ -196,7 +196,8 @@ export class InvitesModuleModel { 'UpdateInvitesModuleInput', 'id', 'invitesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts b/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts index 60dec78148..50d0d76ba5 100644 --- a/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/limitsModule.ts @@ -196,7 +196,8 @@ export class LimitsModuleModel { 'UpdateLimitsModuleInput', 'id', 'limitsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts b/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts index cf72c91fa9..9eeb67961f 100644 --- a/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/membershipTypesModule.ts @@ -198,7 +198,8 @@ export class MembershipTypesModuleModel { 'UpdateMembershipTypesModuleInput', 'id', 'membershipTypesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts b/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts index 5709ac9049..66b41bce21 100644 --- a/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/membershipsModule.ts @@ -196,7 +196,8 @@ export class MembershipsModuleModel { 'UpdateMembershipsModuleInput', 'id', 'membershipsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts b/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts index 9cf13ba7ca..d3bb9d0c67 100644 --- a/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/merkleStoreModule.ts @@ -196,7 +196,8 @@ export class MerkleStoreModuleModel { 'UpdateMerkleStoreModuleInput', 'id', 'merkleStoreModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts b/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts index 9d37ad714a..bd5c681504 100644 --- a/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/namespaceModule.ts @@ -196,7 +196,8 @@ export class NamespaceModuleModel { 'UpdateNamespaceModuleInput', 'id', 'namespaceModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts b/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts index dc44d0d696..a629d81108 100644 --- a/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/notificationsModule.ts @@ -196,7 +196,8 @@ export class NotificationsModuleModel { 'UpdateNotificationsModuleInput', 'id', 'notificationsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts b/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts index 5fb22b44da..2a330457b5 100644 --- a/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/permissionsModule.ts @@ -196,7 +196,8 @@ export class PermissionsModuleModel { 'UpdatePermissionsModuleInput', 'id', 'permissionsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts b/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts index 55f64339ee..42cbdfc98f 100644 --- a/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/phoneNumbersModule.ts @@ -196,7 +196,8 @@ export class PhoneNumbersModuleModel { 'UpdatePhoneNumbersModuleInput', 'id', 'phoneNumbersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/plansModule.ts b/sdk/constructive-cli/src/modules/orm/models/plansModule.ts index f13f1849b8..545fbdd7cb 100644 --- a/sdk/constructive-cli/src/modules/orm/models/plansModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/plansModule.ts @@ -196,7 +196,8 @@ export class PlansModuleModel { 'UpdatePlansModuleInput', 'id', 'plansModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts b/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts index f1c152e779..15d5a94e79 100644 --- a/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/profilesModule.ts @@ -196,7 +196,8 @@ export class ProfilesModuleModel { 'UpdateProfilesModuleInput', 'id', 'profilesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts b/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts index 888855807c..1205e581d8 100644 --- a/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/rateLimitMetersModule.ts @@ -198,7 +198,8 @@ export class RateLimitMetersModuleModel { 'UpdateRateLimitMetersModuleInput', 'id', 'rateLimitMetersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts b/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts index 9567ccaa2d..dbf9501696 100644 --- a/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/rateLimitsModule.ts @@ -196,7 +196,8 @@ export class RateLimitsModuleModel { 'UpdateRateLimitsModuleInput', 'id', 'rateLimitsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts b/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts index d3035f9d59..2cb1075457 100644 --- a/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/realtimeModule.ts @@ -196,7 +196,8 @@ export class RealtimeModuleModel { 'UpdateRealtimeModuleInput', 'id', 'realtimeModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts b/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts index eea0a01010..c8bc481ca9 100644 --- a/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts +++ b/sdk/constructive-cli/src/modules/orm/models/relationProvision.ts @@ -196,7 +196,8 @@ export class RelationProvisionModel { 'UpdateRelationProvisionInput', 'id', 'relationProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts b/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts index 5e1ed1afc3..6a1c7cae75 100644 --- a/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/rlsModule.ts @@ -196,7 +196,8 @@ export class RlsModuleModel { 'UpdateRlsModuleInput', 'id', 'rlsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts b/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts index ca0ef2a686..88e10489d0 100644 --- a/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts +++ b/sdk/constructive-cli/src/modules/orm/models/secureTableProvision.ts @@ -198,7 +198,8 @@ export class SecureTableProvisionModel { 'UpdateSecureTableProvisionInput', 'id', 'secureTableProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts b/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts index 474a953202..9460af6349 100644 --- a/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/sessionSecretsModule.ts @@ -198,7 +198,8 @@ export class SessionSecretsModuleModel { 'UpdateSessionSecretsModuleInput', 'id', 'sessionSecretsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts b/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts index b66cc7be34..324773df9f 100644 --- a/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/sessionsModule.ts @@ -196,7 +196,8 @@ export class SessionsModuleModel { 'UpdateSessionsModuleInput', 'id', 'sessionsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts index 60e0b45cac..a53edf15d1 100644 --- a/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/storageLogModule.ts @@ -196,7 +196,8 @@ export class StorageLogModuleModel { 'UpdateStorageLogModuleInput', 'id', 'storageLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/storageModule.ts b/sdk/constructive-cli/src/modules/orm/models/storageModule.ts index e359f6471c..f69dd6e624 100644 --- a/sdk/constructive-cli/src/modules/orm/models/storageModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/storageModule.ts @@ -196,7 +196,8 @@ export class StorageModuleModel { 'UpdateStorageModuleInput', 'id', 'storageModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts b/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts index dd1b30c286..cab2bec096 100644 --- a/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/transferLogModule.ts @@ -196,7 +196,8 @@ export class TransferLogModuleModel { 'UpdateTransferLogModuleInput', 'id', 'transferLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts index 15fe6a854a..341885e14c 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userAuthModule.ts @@ -196,7 +196,8 @@ export class UserAuthModuleModel { 'UpdateUserAuthModuleInput', 'id', 'userAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts b/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts index 90ada31d7a..9e9bc0b2aa 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userCredentialsModule.ts @@ -198,7 +198,8 @@ export class UserCredentialsModuleModel { 'UpdateUserCredentialsModuleInput', 'id', 'userCredentialsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts b/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts index 5a905d30b4..252d0cc8bf 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userSettingsModule.ts @@ -196,7 +196,8 @@ export class UserSettingsModuleModel { 'UpdateUserSettingsModuleInput', 'id', 'userSettingsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts b/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts index 6070cfbd00..86999c74ae 100644 --- a/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/userStateModule.ts @@ -196,7 +196,8 @@ export class UserStateModuleModel { 'UpdateUserStateModuleInput', 'id', 'userStateModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/usersModule.ts b/sdk/constructive-cli/src/modules/orm/models/usersModule.ts index de86bbbfb8..950038fcf0 100644 --- a/sdk/constructive-cli/src/modules/orm/models/usersModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/usersModule.ts @@ -196,7 +196,8 @@ export class UsersModuleModel { 'UpdateUsersModuleInput', 'id', 'usersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts index 14ebdd6f29..e8cdb4eb61 100644 --- a/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/webauthnAuthModule.ts @@ -196,7 +196,8 @@ export class WebauthnAuthModuleModel { 'UpdateWebauthnAuthModuleInput', 'id', 'webauthnAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts b/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts index ee66831a79..fd73e47620 100644 --- a/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts +++ b/sdk/constructive-cli/src/modules/orm/models/webauthnCredentialsModule.ts @@ -198,7 +198,8 @@ export class WebauthnCredentialsModuleModel { 'UpdateWebauthnCredentialsModuleInput', 'id', 'webauthnCredentialsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/modules/orm/query-builder.ts b/sdk/constructive-cli/src/modules/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-cli/src/modules/orm/query-builder.ts +++ b/sdk/constructive-cli/src/modules/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-cli/src/objects/cli/commands/commit.ts b/sdk/constructive-cli/src/objects/cli/commands/commit.ts index 02b4952ada..06910989f1 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/commit.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/commit.ts @@ -274,16 +274,16 @@ async function handleUpdate(argv: Partial>, prompter: In }, { type: 'text', - name: 'message', - message: 'message', - required: false, - skipPrompt: true, + name: 'databaseId', + message: 'databaseId', + required: true, }, { type: 'text', - name: 'databaseId', - message: 'databaseId', + name: 'message', + message: 'message', required: false, + skipPrompt: true, }, { type: 'text', @@ -334,10 +334,10 @@ async function handleUpdate(argv: Partial>, prompter: In .update({ where: { id: answers.id as string, + databaseId: answers.databaseId as string, }, data: { message: cleanedData.message, - databaseId: cleanedData.databaseId, storeId: cleanedData.storeId, parentIds: cleanedData.parentIds, authorId: cleanedData.authorId, @@ -376,6 +376,12 @@ async function handleDelete(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); @@ -383,6 +389,7 @@ async function handleDelete(argv: Partial>, prompter: In .delete({ where: { id: answers.id as string, + databaseId: answers.databaseId as string, }, select: { id: true, diff --git a/sdk/constructive-cli/src/objects/cli/commands/object.ts b/sdk/constructive-cli/src/objects/cli/commands/object.ts index 36952ce433..3f4543f7cf 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/object.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/object.ts @@ -230,7 +230,7 @@ async function handleUpdate(argv: Partial>, prompter: In type: 'text', name: 'databaseId', message: 'databaseId', - required: false, + required: true, }, { type: 'text', @@ -261,9 +261,9 @@ async function handleUpdate(argv: Partial>, prompter: In .update({ where: { id: answers.id as string, + databaseId: answers.databaseId as string, }, data: { - databaseId: cleanedData.databaseId, kids: cleanedData.kids, ktree: cleanedData.ktree, data: cleanedData.data, @@ -296,6 +296,12 @@ async function handleDelete(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); @@ -303,6 +309,7 @@ async function handleDelete(argv: Partial>, prompter: In .delete({ where: { id: answers.id as string, + databaseId: answers.databaseId as string, }, select: { id: true, diff --git a/sdk/constructive-cli/src/objects/cli/commands/ref.ts b/sdk/constructive-cli/src/objects/cli/commands/ref.ts index cc4ef6922f..c91393a054 100644 --- a/sdk/constructive-cli/src/objects/cli/commands/ref.ts +++ b/sdk/constructive-cli/src/objects/cli/commands/ref.ts @@ -221,14 +221,14 @@ async function handleUpdate(argv: Partial>, prompter: In }, { type: 'text', - name: 'name', - message: 'name', - required: false, + name: 'databaseId', + message: 'databaseId', + required: true, }, { type: 'text', - name: 'databaseId', - message: 'databaseId', + name: 'name', + message: 'name', required: false, }, { @@ -252,10 +252,10 @@ async function handleUpdate(argv: Partial>, prompter: In .update({ where: { id: answers.id as string, + databaseId: answers.databaseId as string, }, data: { name: cleanedData.name, - databaseId: cleanedData.databaseId, storeId: cleanedData.storeId, commitId: cleanedData.commitId, }, @@ -286,6 +286,12 @@ async function handleDelete(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'databaseId', + message: 'databaseId', + required: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); @@ -293,6 +299,7 @@ async function handleDelete(argv: Partial>, prompter: In .delete({ where: { id: answers.id as string, + databaseId: answers.databaseId as string, }, select: { id: true, diff --git a/sdk/constructive-cli/src/objects/orm/models/commit.ts b/sdk/constructive-cli/src/objects/orm/models/commit.ts index 70f5c59605..9f20aeeefc 100644 --- a/sdk/constructive-cli/src/objects/orm/models/commit.ts +++ b/sdk/constructive-cli/src/objects/orm/models/commit.ts @@ -176,6 +176,7 @@ export class CommitModel { S, { id: string; + databaseId: string; }, CommitPatch > & { @@ -196,7 +197,10 @@ export class CommitModel { 'UpdateCommitInput', 'id', 'commitPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class CommitModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -227,6 +232,7 @@ export class CommitModel { 'commit', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteCommitInput', args.select, diff --git a/sdk/constructive-cli/src/objects/orm/models/object.ts b/sdk/constructive-cli/src/objects/orm/models/object.ts index 8a685b1df7..9470d460f6 100644 --- a/sdk/constructive-cli/src/objects/orm/models/object.ts +++ b/sdk/constructive-cli/src/objects/orm/models/object.ts @@ -162,6 +162,7 @@ export class ObjectModel { S, { id: string; + databaseId: string; }, ObjectPatch > & { @@ -182,7 +183,10 @@ export class ObjectModel { 'UpdateObjectInput', 'id', 'objectPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -197,6 +201,7 @@ export class ObjectModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -213,6 +218,7 @@ export class ObjectModel { 'object', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteObjectInput', args.select, diff --git a/sdk/constructive-cli/src/objects/orm/models/ref.ts b/sdk/constructive-cli/src/objects/orm/models/ref.ts index 5c3419d89d..d29b2308a0 100644 --- a/sdk/constructive-cli/src/objects/orm/models/ref.ts +++ b/sdk/constructive-cli/src/objects/orm/models/ref.ts @@ -176,6 +176,7 @@ export class RefModel { S, { id: string; + databaseId: string; }, RefPatch > & { @@ -196,7 +197,10 @@ export class RefModel { 'UpdateRefInput', 'id', 'refPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class RefModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -227,6 +232,7 @@ export class RefModel { 'ref', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteRefInput', args.select, diff --git a/sdk/constructive-cli/src/objects/orm/models/store.ts b/sdk/constructive-cli/src/objects/orm/models/store.ts index f80e638901..3e81e5f9ca 100644 --- a/sdk/constructive-cli/src/objects/orm/models/store.ts +++ b/sdk/constructive-cli/src/objects/orm/models/store.ts @@ -196,7 +196,8 @@ export class StoreModel { 'UpdateStoreInput', 'id', 'storePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/objects/orm/query-builder.ts b/sdk/constructive-cli/src/objects/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-cli/src/objects/orm/query-builder.ts +++ b/sdk/constructive-cli/src/objects/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts b/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts index e3ea205fbe..a572633cdb 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/app-limit-event.ts @@ -321,6 +321,12 @@ async function handleUpdate(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, { type: 'text', name: 'name', @@ -406,6 +412,7 @@ async function handleUpdate(argv: Partial>, prompter: In .update({ where: { id: answers.id as string, + createdAt: answers.createdAt as string, }, data: { name: cleanedData.name, @@ -455,6 +462,12 @@ async function handleDelete(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); @@ -462,6 +475,7 @@ async function handleDelete(argv: Partial>, prompter: In .delete({ where: { id: answers.id as string, + createdAt: answers.createdAt as string, }, select: { id: true, diff --git a/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts b/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts index 134eda43f4..5ea6e8cb88 100644 --- a/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts +++ b/sdk/constructive-cli/src/usage/cli/commands/org-limit-event.ts @@ -321,6 +321,12 @@ async function handleUpdate(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, { type: 'text', name: 'name', @@ -406,6 +412,7 @@ async function handleUpdate(argv: Partial>, prompter: In .update({ where: { id: answers.id as string, + createdAt: answers.createdAt as string, }, data: { name: cleanedData.name, @@ -455,6 +462,12 @@ async function handleDelete(argv: Partial>, prompter: In message: 'id', required: true, }, + { + type: 'text', + name: 'createdAt', + message: 'createdAt', + required: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const client = getClient(); @@ -462,6 +475,7 @@ async function handleDelete(argv: Partial>, prompter: In .delete({ where: { id: answers.id as string, + createdAt: answers.createdAt as string, }, select: { id: true, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimit.ts b/sdk/constructive-cli/src/usage/orm/models/appLimit.ts index 2e109cb07e..e1903aae36 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimit.ts @@ -196,7 +196,8 @@ export class AppLimitModel { 'UpdateAppLimitInput', 'id', 'appLimitPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts index 3359af7c92..9f93b87628 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCap.ts @@ -196,7 +196,8 @@ export class AppLimitCapModel { 'UpdateAppLimitCapInput', 'id', 'appLimitCapPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts index 0eac9c6f8b..3b0ac8a23b 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCapsDefault.ts @@ -196,7 +196,8 @@ export class AppLimitCapsDefaultModel { 'UpdateAppLimitCapsDefaultInput', 'id', 'appLimitCapsDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts index 87ef262696..7f66c4eb09 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCredit.ts @@ -196,7 +196,8 @@ export class AppLimitCreditModel { 'UpdateAppLimitCreditInput', 'id', 'appLimitCreditPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts index 1d21f2d211..a449fef840 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCode.ts @@ -196,7 +196,8 @@ export class AppLimitCreditCodeModel { 'UpdateAppLimitCreditCodeInput', 'id', 'appLimitCreditCodePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts index ade7d6cdc0..5f37d3fbe0 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditCodeItem.ts @@ -198,7 +198,8 @@ export class AppLimitCreditCodeItemModel { 'UpdateAppLimitCreditCodeItemInput', 'id', 'appLimitCreditCodeItemPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts index f60a8e62f9..582960bd9f 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitCreditRedemption.ts @@ -198,7 +198,8 @@ export class AppLimitCreditRedemptionModel { 'UpdateAppLimitCreditRedemptionInput', 'id', 'appLimitCreditRedemptionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts index f9df6376e5..f0eb49d31f 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitDefault.ts @@ -196,7 +196,8 @@ export class AppLimitDefaultModel { 'UpdateAppLimitDefaultInput', 'id', 'appLimitDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts index ef7249f3e9..17fd7e8866 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitEvent.ts @@ -176,6 +176,7 @@ export class AppLimitEventModel { S, { id: string; + createdAt: string; }, AppLimitEventPatch > & { @@ -196,7 +197,10 @@ export class AppLimitEventModel { 'UpdateAppLimitEventInput', 'id', 'appLimitEventPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class AppLimitEventModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class AppLimitEventModel { 'appLimitEvent', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteAppLimitEventInput', args.select, diff --git a/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts b/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts index 8366dd8336..4d31d5490a 100644 --- a/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts +++ b/sdk/constructive-cli/src/usage/orm/models/appLimitWarning.ts @@ -196,7 +196,8 @@ export class AppLimitWarningModel { 'UpdateAppLimitWarningInput', 'id', 'appLimitWarningPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts index 48a3932f23..188531420f 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimit.ts @@ -196,7 +196,8 @@ export class OrgLimitModel { 'UpdateOrgLimitInput', 'id', 'orgLimitPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts index d74b9e7d92..43f24e6d05 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitAggregate.ts @@ -196,7 +196,8 @@ export class OrgLimitAggregateModel { 'UpdateOrgLimitAggregateInput', 'id', 'orgLimitAggregatePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts index 6755eea460..0877ea93fd 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitCap.ts @@ -196,7 +196,8 @@ export class OrgLimitCapModel { 'UpdateOrgLimitCapInput', 'id', 'orgLimitCapPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts index 7884189152..de62c801b7 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitCapsDefault.ts @@ -196,7 +196,8 @@ export class OrgLimitCapsDefaultModel { 'UpdateOrgLimitCapsDefaultInput', 'id', 'orgLimitCapsDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts index 560f611013..497dd5d807 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitCredit.ts @@ -196,7 +196,8 @@ export class OrgLimitCreditModel { 'UpdateOrgLimitCreditInput', 'id', 'orgLimitCreditPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts index 7e55bfd1f7..3c91177b9c 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitDefault.ts @@ -196,7 +196,8 @@ export class OrgLimitDefaultModel { 'UpdateOrgLimitDefaultInput', 'id', 'orgLimitDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts index 2eb9796e2a..419737757d 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitEvent.ts @@ -176,6 +176,7 @@ export class OrgLimitEventModel { S, { id: string; + createdAt: string; }, OrgLimitEventPatch > & { @@ -196,7 +197,10 @@ export class OrgLimitEventModel { 'UpdateOrgLimitEventInput', 'id', 'orgLimitEventPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class OrgLimitEventModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class OrgLimitEventModel { 'orgLimitEvent', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteOrgLimitEventInput', args.select, diff --git a/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts b/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts index e496b69fef..67d887241a 100644 --- a/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts +++ b/sdk/constructive-cli/src/usage/orm/models/orgLimitWarning.ts @@ -196,7 +196,8 @@ export class OrgLimitWarningModel { 'UpdateOrgLimitWarningInput', 'id', 'orgLimitWarningPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-cli/src/usage/orm/query-builder.ts b/sdk/constructive-cli/src/usage/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-cli/src/usage/orm/query-builder.ts +++ b/sdk/constructive-cli/src/usage/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/README.md b/sdk/constructive-react/README.md index 0b587853c3..5d3bb03321 100644 --- a/sdk/constructive-react/README.md +++ b/sdk/constructive-react/README.md @@ -14,6 +14,8 @@ | agent | - | React Query, ORM | [./src/agent/README.md](./src/agent/README.md) | | api | - | React Query, ORM | [./src/api/README.md](./src/api/README.md) | | auth | - | React Query, ORM | [./src/auth/README.md](./src/auth/README.md) | +| compute | - | React Query, ORM | [./src/compute/README.md](./src/compute/README.md) | +| config | - | React Query, ORM | [./src/config/README.md](./src/config/README.md) | | modules | - | React Query, ORM | [./src/modules/README.md](./src/modules/README.md) | | objects | - | React Query, ORM | [./src/objects/README.md](./src/objects/README.md) | | usage | - | React Query, ORM | [./src/usage/README.md](./src/usage/README.md) | diff --git a/sdk/constructive-react/src/.targets b/sdk/constructive-react/src/.targets index bf4de0b16a..42542d6c87 100644 --- a/sdk/constructive-react/src/.targets +++ b/sdk/constructive-react/src/.targets @@ -1 +1 @@ -["admin","agent","api","auth","modules","objects","usage"] +["admin","agent","api","auth","compute","config","modules","objects","usage"] diff --git a/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts b/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts index fd80edc234..cc7a22623e 100644 --- a/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appAdminGrant.ts @@ -196,7 +196,8 @@ export class AppAdminGrantModel { 'UpdateAppAdminGrantInput', 'id', 'appAdminGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts b/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts index c9e66ec9c8..598f1b15af 100644 --- a/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/appClaimedInvite.ts @@ -196,7 +196,8 @@ export class AppClaimedInviteModel { 'UpdateAppClaimedInviteInput', 'id', 'appClaimedInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appGrant.ts b/sdk/constructive-react/src/admin/orm/models/appGrant.ts index 4481fb3d83..d773ff6de1 100644 --- a/sdk/constructive-react/src/admin/orm/models/appGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appGrant.ts @@ -196,7 +196,8 @@ export class AppGrantModel { 'UpdateAppGrantInput', 'id', 'appGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appInvite.ts b/sdk/constructive-react/src/admin/orm/models/appInvite.ts index 5fcbff9369..3350bba65b 100644 --- a/sdk/constructive-react/src/admin/orm/models/appInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/appInvite.ts @@ -196,7 +196,8 @@ export class AppInviteModel { 'UpdateAppInviteInput', 'id', 'appInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appMembership.ts b/sdk/constructive-react/src/admin/orm/models/appMembership.ts index a4011c41ab..1faa691016 100644 --- a/sdk/constructive-react/src/admin/orm/models/appMembership.ts +++ b/sdk/constructive-react/src/admin/orm/models/appMembership.ts @@ -196,7 +196,8 @@ export class AppMembershipModel { 'UpdateAppMembershipInput', 'id', 'appMembershipPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts b/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts index f69f1aca69..efc0ab28ee 100644 --- a/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/appMembershipDefault.ts @@ -198,7 +198,8 @@ export class AppMembershipDefaultModel { 'UpdateAppMembershipDefaultInput', 'id', 'appMembershipDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts b/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts index eeb815d842..28f7d92d12 100644 --- a/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appOwnerGrant.ts @@ -196,7 +196,8 @@ export class AppOwnerGrantModel { 'UpdateAppOwnerGrantInput', 'id', 'appOwnerGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appPermission.ts b/sdk/constructive-react/src/admin/orm/models/appPermission.ts index e71adea658..efa4812398 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermission.ts @@ -196,7 +196,8 @@ export class AppPermissionModel { 'UpdateAppPermissionInput', 'id', 'appPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts b/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts index d5511aed01..c967364f31 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermissionDefault.ts @@ -198,7 +198,8 @@ export class AppPermissionDefaultModel { 'UpdateAppPermissionDefaultInput', 'id', 'appPermissionDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts index 6915611884..b6a3b10748 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultGrant.ts @@ -198,7 +198,8 @@ export class AppPermissionDefaultGrantModel { 'UpdateAppPermissionDefaultGrantInput', 'id', 'appPermissionDefaultGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts index eeee28fadd..6e47d9eeec 100644 --- a/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/appPermissionDefaultPermission.ts @@ -221,7 +221,8 @@ export class AppPermissionDefaultPermissionModel { 'UpdateAppPermissionDefaultPermissionInput', 'id', 'appPermissionDefaultPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/membershipType.ts b/sdk/constructive-react/src/admin/orm/models/membershipType.ts index ee7ed596c0..1ab7c15781 100644 --- a/sdk/constructive-react/src/admin/orm/models/membershipType.ts +++ b/sdk/constructive-react/src/admin/orm/models/membershipType.ts @@ -196,7 +196,8 @@ export class MembershipTypeModel { 'UpdateMembershipTypeInput', 'id', 'membershipTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts index 7b13377316..9ef902aaa8 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgAdminGrant.ts @@ -196,7 +196,8 @@ export class OrgAdminGrantModel { 'UpdateOrgAdminGrantInput', 'id', 'orgAdminGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgChartEdge.ts b/sdk/constructive-react/src/admin/orm/models/orgChartEdge.ts index 8a43b83a98..80c81b0e08 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgChartEdge.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgChartEdge.ts @@ -196,7 +196,8 @@ export class OrgChartEdgeModel { 'UpdateOrgChartEdgeInput', 'id', 'orgChartEdgePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgChartEdgeGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgChartEdgeGrant.ts index 168a6fe3db..c9df058dfd 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgChartEdgeGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgChartEdgeGrant.ts @@ -196,7 +196,8 @@ export class OrgChartEdgeGrantModel { 'UpdateOrgChartEdgeGrantInput', 'id', 'orgChartEdgeGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts b/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts index e1a3aecafb..82b31bb474 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgClaimedInvite.ts @@ -196,7 +196,8 @@ export class OrgClaimedInviteModel { 'UpdateOrgClaimedInviteInput', 'id', 'orgClaimedInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgGrant.ts index c8e74f5cc6..467c6b11b9 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgGrant.ts @@ -196,7 +196,8 @@ export class OrgGrantModel { 'UpdateOrgGrantInput', 'id', 'orgGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgInvite.ts b/sdk/constructive-react/src/admin/orm/models/orgInvite.ts index 8d7931f078..50cc5eb9e6 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgInvite.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgInvite.ts @@ -196,7 +196,8 @@ export class OrgInviteModel { 'UpdateOrgInviteInput', 'id', 'orgInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgMember.ts b/sdk/constructive-react/src/admin/orm/models/orgMember.ts index 44f5608f45..bf7ac25fe9 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMember.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMember.ts @@ -196,7 +196,8 @@ export class OrgMemberModel { 'UpdateOrgMemberInput', 'id', 'orgMemberPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts b/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts index 77357e1745..9cecf8839b 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMemberProfile.ts @@ -196,7 +196,8 @@ export class OrgMemberProfileModel { 'UpdateOrgMemberProfileInput', 'id', 'orgMemberProfilePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgMembership.ts b/sdk/constructive-react/src/admin/orm/models/orgMembership.ts index 623ec08fe2..06ee032ca8 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMembership.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMembership.ts @@ -196,7 +196,8 @@ export class OrgMembershipModel { 'UpdateOrgMembershipInput', 'id', 'orgMembershipPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts b/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts index 3441315057..525619dfca 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMembershipDefault.ts @@ -198,7 +198,8 @@ export class OrgMembershipDefaultModel { 'UpdateOrgMembershipDefaultInput', 'id', 'orgMembershipDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts b/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts index 46801fc913..de551183d2 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgMembershipSetting.ts @@ -198,7 +198,8 @@ export class OrgMembershipSettingModel { 'UpdateOrgMembershipSettingInput', 'id', 'orgMembershipSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts index 9614dce8fc..d99550bd73 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgOwnerGrant.ts @@ -196,7 +196,8 @@ export class OrgOwnerGrantModel { 'UpdateOrgOwnerGrantInput', 'id', 'orgOwnerGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermission.ts b/sdk/constructive-react/src/admin/orm/models/orgPermission.ts index 7bdc906323..e3aded7147 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermission.ts @@ -196,7 +196,8 @@ export class OrgPermissionModel { 'UpdateOrgPermissionInput', 'id', 'orgPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts index 8d00b99325..20ed957d15 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefault.ts @@ -198,7 +198,8 @@ export class OrgPermissionDefaultModel { 'UpdateOrgPermissionDefaultInput', 'id', 'orgPermissionDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts index 2f1a709be3..07d5976acb 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultGrant.ts @@ -198,7 +198,8 @@ export class OrgPermissionDefaultGrantModel { 'UpdateOrgPermissionDefaultGrantInput', 'id', 'orgPermissionDefaultGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts index 7c898408dc..3339ceaeca 100644 --- a/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts +++ b/sdk/constructive-react/src/admin/orm/models/orgPermissionDefaultPermission.ts @@ -221,7 +221,8 @@ export class OrgPermissionDefaultPermissionModel { 'UpdateOrgPermissionDefaultPermissionInput', 'id', 'orgPermissionDefaultPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/admin/orm/query-builder.ts b/sdk/constructive-react/src/admin/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-react/src/admin/orm/query-builder.ts +++ b/sdk/constructive-react/src/admin/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/src/admin/schema-types.ts b/sdk/constructive-react/src/admin/schema-types.ts index 829552fbdc..50584dc3e1 100644 --- a/sdk/constructive-react/src/admin/schema-types.ts +++ b/sdk/constructive-react/src/admin/schema-types.ts @@ -3771,6 +3771,14 @@ export interface MetaTable { relations: MetaRelations; inflection: MetaInflection; query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; } /** Information about a table field/column */ export interface MetaField { @@ -3781,6 +3789,8 @@ export interface MetaField { isPrimaryKey: boolean; isForeignKey: boolean; description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; } /** Information about a database index */ export interface MetaIndex { @@ -3846,6 +3856,36 @@ export interface MetaQuery { update?: string | null; delete?: string | null; } +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} /** Information about a PostgreSQL type */ export interface MetaType { pgType: string; @@ -3855,6 +3895,13 @@ export interface MetaType { hasDefault?: boolean | null; subtype?: string | null; } +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} /** Reference to a related table */ export interface MetaRefTable { name: string; @@ -3888,3 +3935,28 @@ export interface MetaManyToManyRelation { rightKeyAttributes: MetaField[]; rightTable: MetaRefTable; } +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/agent/orm/input-types.ts b/sdk/constructive-react/src/agent/orm/input-types.ts index dbb8e0c07f..8198498912 100644 --- a/sdk/constructive-react/src/agent/orm/input-types.ts +++ b/sdk/constructive-react/src/agent/orm/input-types.ts @@ -1092,7 +1092,8 @@ export interface AgentResourceFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -1569,6 +1570,7 @@ export interface CreateAgentResourceChunkInput { chunkIndex?: number; embedding?: number[]; metadata?: Record; + embeddingText?: string; }; } export interface AgentResourceChunkPatch { @@ -1577,6 +1579,7 @@ export interface AgentResourceChunkPatch { chunkIndex?: number | null; embedding?: number[] | null; metadata?: Record | null; + embeddingText?: string | null; } export interface UpdateAgentResourceChunkInput { clientMutationId?: string; @@ -1638,6 +1641,7 @@ export interface CreateAgentResourceInput { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + embeddingText?: string; }; } export interface AgentResourcePatch { @@ -1655,6 +1659,7 @@ export interface AgentResourcePatch { archivedAt?: string | null; embedding?: number[] | null; embeddingUpdatedAt?: string | null; + embeddingText?: string | null; } export interface UpdateAgentResourceInput { clientMutationId?: string; @@ -1770,6 +1775,8 @@ export interface VectorNearbyInput { distance?: number; /** When true (default for tables with @hasChunks), transparently queries the chunks table and returns the minimum distance across parent + all chunks. Set to false to only search the parent embedding. */ includeChunks?: boolean; + /** Natural language text to embed server-side for similarity search. Mutually exclusive with `vector` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + text?: string; } /** A filter to be used against many `Agent` object types. All fields are combined with a logical ‘and.’ */ export interface AgentPersonaToManyAgentFilter { @@ -2021,6 +2028,8 @@ export interface AgentResourceChunkInput { metadata?: Record; createdAt?: string; updatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } /** An input for mutations affecting `AgentPersona` */ export interface AgentPersonaInput { @@ -2073,6 +2082,8 @@ export interface AgentResourceInput { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } /** A filter to be used against `AgentTask` object types. All fields are combined with a logical ‘and.’ */ export interface AgentTaskFilter { @@ -2721,7 +2732,8 @@ export interface AgentResourceFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; diff --git a/sdk/constructive-react/src/agent/orm/models/agent.ts b/sdk/constructive-react/src/agent/orm/models/agent.ts index 1bf091a6cf..72f4b04da0 100644 --- a/sdk/constructive-react/src/agent/orm/models/agent.ts +++ b/sdk/constructive-react/src/agent/orm/models/agent.ts @@ -196,7 +196,8 @@ export class AgentModel { 'UpdateAgentInput', 'id', 'agentPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentMessage.ts b/sdk/constructive-react/src/agent/orm/models/agentMessage.ts index d128641c85..ffa3a09734 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentMessage.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentMessage.ts @@ -196,7 +196,8 @@ export class AgentMessageModel { 'UpdateAgentMessageInput', 'id', 'agentMessagePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentPersona.ts b/sdk/constructive-react/src/agent/orm/models/agentPersona.ts index 84cebbe0e1..1391dbde2c 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentPersona.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentPersona.ts @@ -196,7 +196,8 @@ export class AgentPersonaModel { 'UpdateAgentPersonaInput', 'id', 'agentPersonaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentPlan.ts b/sdk/constructive-react/src/agent/orm/models/agentPlan.ts index ec029de47d..9829718fee 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentPlan.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentPlan.ts @@ -196,7 +196,8 @@ export class AgentPlanModel { 'UpdateAgentPlanInput', 'id', 'agentPlanPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts b/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts index 5e4aa9b6d1..e301bf6c99 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentPrompt.ts @@ -196,7 +196,8 @@ export class AgentPromptModel { 'UpdateAgentPromptInput', 'id', 'agentPromptPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentResource.ts b/sdk/constructive-react/src/agent/orm/models/agentResource.ts index a02699c383..7628b03b3c 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentResource.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentResource.ts @@ -196,7 +196,8 @@ export class AgentResourceModel { 'UpdateAgentResourceInput', 'id', 'agentResourcePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts b/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts index b69cb15557..fd5edf82ac 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentResourceChunk.ts @@ -196,7 +196,8 @@ export class AgentResourceChunkModel { 'UpdateAgentResourceChunkInput', 'id', 'agentResourceChunkPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentTask.ts b/sdk/constructive-react/src/agent/orm/models/agentTask.ts index 3bbc609f16..a4b3a1e367 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentTask.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentTask.ts @@ -196,7 +196,8 @@ export class AgentTaskModel { 'UpdateAgentTaskInput', 'id', 'agentTaskPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/models/agentThread.ts b/sdk/constructive-react/src/agent/orm/models/agentThread.ts index 7bbd14abec..1ae2eb5a67 100644 --- a/sdk/constructive-react/src/agent/orm/models/agentThread.ts +++ b/sdk/constructive-react/src/agent/orm/models/agentThread.ts @@ -196,7 +196,8 @@ export class AgentThreadModel { 'UpdateAgentThreadInput', 'id', 'agentThreadPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/agent/orm/query-builder.ts b/sdk/constructive-react/src/agent/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-react/src/agent/orm/query-builder.ts +++ b/sdk/constructive-react/src/agent/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/src/agent/schema-types.ts b/sdk/constructive-react/src/agent/schema-types.ts index 8f37da96d0..eaf306c24b 100644 --- a/sdk/constructive-react/src/agent/schema-types.ts +++ b/sdk/constructive-react/src/agent/schema-types.ts @@ -758,7 +758,8 @@ export interface AgentResourceFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -870,6 +871,8 @@ export interface VectorNearbyInput { distance?: number; /** When true (default for tables with @hasChunks), transparently queries the chunks table and returns the minimum distance across parent + all chunks. Set to false to only search the parent embedding. */ includeChunks?: boolean; + /** Natural language text to embed server-side for similarity search. Mutually exclusive with `vector` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + text?: string; } export interface CreateAgentPlanInput { clientMutationId?: string; @@ -1015,6 +1018,8 @@ export interface AgentResourceChunkInput { metadata?: unknown; createdAt?: string; updatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } export interface CreateAgentPersonaInput { clientMutationId?: string; @@ -1112,6 +1117,8 @@ export interface AgentResourceInput { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } export interface UpdateAgentPlanInput { clientMutationId?: string; @@ -1263,6 +1270,8 @@ export interface AgentResourceChunkPatch { metadata?: unknown; createdAt?: string; updatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } export interface UpdateAgentPersonaInput { clientMutationId?: string; @@ -1363,6 +1372,8 @@ export interface AgentResourcePatch { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } export interface DeleteAgentPlanInput { clientMutationId?: string; @@ -1730,6 +1741,14 @@ export interface MetaTable { relations: MetaRelations; inflection: MetaInflection; query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; } /** Information about a table field/column */ export interface MetaField { @@ -1740,6 +1759,8 @@ export interface MetaField { isPrimaryKey: boolean; isForeignKey: boolean; description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; } /** Information about a database index */ export interface MetaIndex { @@ -1805,6 +1826,36 @@ export interface MetaQuery { update?: string | null; delete?: string | null; } +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} /** Information about a PostgreSQL type */ export interface MetaType { pgType: string; @@ -1814,6 +1865,13 @@ export interface MetaType { hasDefault?: boolean | null; subtype?: string | null; } +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} /** Reference to a related table */ export interface MetaRefTable { name: string; @@ -1847,3 +1905,28 @@ export interface MetaManyToManyRelation { rightKeyAttributes: MetaField[]; rightTable: MetaRefTable; } +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/api/hooks/README.md b/sdk/constructive-react/src/api/hooks/README.md index fe847aa2b8..cf1da603cd 100644 --- a/sdk/constructive-react/src/api/hooks/README.md +++ b/sdk/constructive-react/src/api/hooks/README.md @@ -320,20 +320,20 @@ create({ databaseId: '', schemaId: '', name: '' }); ```typescript // List all schemas const { data, isLoading } = useSchemasQuery({ - selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }, + selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }, }); // Get one schema const { data: item } = useSchemaQuery({ id: '', - selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }, + selection: { fields: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }, }); // Create a schema const { mutate: create } = useCreateSchemaMutation({ selection: { fields: { id: true } }, }); -create({ databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '' }); +create({ databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '', apiExposure: '' }); ``` ### Table diff --git a/sdk/constructive-react/src/api/orm/README.md b/sdk/constructive-react/src/api/orm/README.md index e4f38f7327..caf70c1803 100644 --- a/sdk/constructive-react/src/api/orm/README.md +++ b/sdk/constructive-react/src/api/orm/README.md @@ -121,6 +121,7 @@ CRUD operations for Schema records. | `scope` | Int | Yes | | `tags` | String | Yes | | `isPublic` | Boolean | Yes | +| `apiExposure` | ApiExposureLevel | Yes | | `createdAt` | Datetime | No | | `updatedAt` | Datetime | No | @@ -128,13 +129,13 @@ CRUD operations for Schema records. ```typescript // List all schema records -const items = await db.schema.findMany({ select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }).execute(); +const items = await db.schema.findMany({ select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }).execute(); // Get one by id -const item = await db.schema.findOne({ id: '', select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }).execute(); +const item = await db.schema.findOne({ id: '', select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }).execute(); // Create -const created = await db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '' }, select: { id: true } }).execute(); +const created = await db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '', apiExposure: '' }, select: { id: true } }).execute(); // Update const updated = await db.schema.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); diff --git a/sdk/constructive-react/src/api/orm/input-types.ts b/sdk/constructive-react/src/api/orm/input-types.ts index 75eb0921a8..b1e5d0f51c 100644 --- a/sdk/constructive-react/src/api/orm/input-types.ts +++ b/sdk/constructive-react/src/api/orm/input-types.ts @@ -231,6 +231,7 @@ export interface UUIDListFilter { anyGreaterThanOrEqualTo?: string; } // ============ Enum Types ============ +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; export type ObjectCategory = 'CORE' | 'MODULE' | 'PERMISSIONS' | 'AUTH' | 'MEMBERSHIPS' | 'APP'; // ============ Custom Scalar Types ============ export type ConstructiveInternalTypeAttachment = unknown; @@ -257,6 +258,7 @@ export interface Schema { scope?: number | null; tags?: string[] | null; isPublic?: boolean | null; + apiExposure?: ApiExposureLevel | null; createdAt?: string | null; updatedAt?: string | null; } @@ -1329,6 +1331,7 @@ export type SchemaSelect = { scope?: boolean; tags?: boolean; isPublic?: boolean; + apiExposure?: boolean; createdAt?: boolean; updatedAt?: boolean; database?: { @@ -2718,6 +2721,8 @@ export interface SchemaFilter { tags?: StringListFilter; /** Filter by the object’s `isPublic` field. */ isPublic?: BooleanFilter; + /** Filter by the object’s `apiExposure` field. */ + apiExposure?: ApiExposureLevelFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ @@ -4652,6 +4657,8 @@ export type SchemaOrderBy = | 'TAGS_DESC' | 'IS_PUBLIC_ASC' | 'IS_PUBLIC_DESC' + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' @@ -5804,6 +5811,7 @@ export interface CreateSchemaInput { scope?: number; tags?: string[]; isPublic?: boolean; + apiExposure?: ApiExposureLevel; }; } export interface SchemaPatch { @@ -5817,6 +5825,7 @@ export interface SchemaPatch { scope?: number | null; tags?: string[] | null; isPublic?: boolean | null; + apiExposure?: ApiExposureLevel | null; } export interface UpdateSchemaInput { clientMutationId?: string; @@ -7497,6 +7506,31 @@ export interface ObjectCategoryFilter { /** Greater than or equal to the specified value. */ greaterThanOrEqualTo?: ObjectCategory; } +/** A filter to be used against ApiExposureLevel fields. All fields are combined with a logical ‘and.’ */ +export interface ApiExposureLevelFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: ApiExposureLevel; + /** Not equal to the specified value. */ + notEqualTo?: ApiExposureLevel; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: ApiExposureLevel; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: ApiExposureLevel; + /** Included in the specified list. */ + in?: ApiExposureLevel[]; + /** Not included in the specified list. */ + notIn?: ApiExposureLevel[]; + /** Less than the specified value. */ + lessThan?: ApiExposureLevel; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: ApiExposureLevel; + /** Greater than the specified value. */ + greaterThan?: ApiExposureLevel; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: ApiExposureLevel; +} /** A filter to be used against many `Table` object types. All fields are combined with a logical ‘and.’ */ export interface SchemaToManyTableFilter { /** Filters to entities where at least one related entity matches. */ @@ -8457,6 +8491,7 @@ export interface SchemaInput { scope?: number; tags?: string[]; isPublic?: boolean; + apiExposure?: ApiExposureLevel; createdAt?: string; updatedAt?: string; } @@ -10346,6 +10381,8 @@ export interface SchemaFilter { tags?: StringListFilter; /** Filter by the object’s `isPublic` field. */ isPublic?: BooleanFilter; + /** Filter by the object’s `apiExposure` field. */ + apiExposure?: ApiExposureLevelFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ diff --git a/sdk/constructive-react/src/api/orm/models/api.ts b/sdk/constructive-react/src/api/orm/models/api.ts index 5e2e04bd39..4d60695731 100644 --- a/sdk/constructive-react/src/api/orm/models/api.ts +++ b/sdk/constructive-react/src/api/orm/models/api.ts @@ -196,7 +196,8 @@ export class ApiModel { 'UpdateApiInput', 'id', 'apiPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/apiModule.ts b/sdk/constructive-react/src/api/orm/models/apiModule.ts index d98c67c6e7..dd9bb29f76 100644 --- a/sdk/constructive-react/src/api/orm/models/apiModule.ts +++ b/sdk/constructive-react/src/api/orm/models/apiModule.ts @@ -196,7 +196,8 @@ export class ApiModuleModel { 'UpdateApiModuleInput', 'id', 'apiModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/apiSchema.ts b/sdk/constructive-react/src/api/orm/models/apiSchema.ts index 9ef99da8cd..2179728a2b 100644 --- a/sdk/constructive-react/src/api/orm/models/apiSchema.ts +++ b/sdk/constructive-react/src/api/orm/models/apiSchema.ts @@ -196,7 +196,8 @@ export class ApiSchemaModel { 'UpdateApiSchemaInput', 'id', 'apiSchemaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/apiSetting.ts b/sdk/constructive-react/src/api/orm/models/apiSetting.ts index 9c3140fdc9..01f1b5b74e 100644 --- a/sdk/constructive-react/src/api/orm/models/apiSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/apiSetting.ts @@ -196,7 +196,8 @@ export class ApiSettingModel { 'UpdateApiSettingInput', 'id', 'apiSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/app.ts b/sdk/constructive-react/src/api/orm/models/app.ts index 73ac9831b1..049d73f6c0 100644 --- a/sdk/constructive-react/src/api/orm/models/app.ts +++ b/sdk/constructive-react/src/api/orm/models/app.ts @@ -196,7 +196,8 @@ export class AppModel { 'UpdateAppInput', 'id', 'appPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/checkConstraint.ts b/sdk/constructive-react/src/api/orm/models/checkConstraint.ts index 5c052886fa..7f6054e6a4 100644 --- a/sdk/constructive-react/src/api/orm/models/checkConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/checkConstraint.ts @@ -196,7 +196,8 @@ export class CheckConstraintModel { 'UpdateCheckConstraintInput', 'id', 'checkConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/compositeType.ts b/sdk/constructive-react/src/api/orm/models/compositeType.ts index 0f46f810e9..72f4ab3adf 100644 --- a/sdk/constructive-react/src/api/orm/models/compositeType.ts +++ b/sdk/constructive-react/src/api/orm/models/compositeType.ts @@ -196,7 +196,8 @@ export class CompositeTypeModel { 'UpdateCompositeTypeInput', 'id', 'compositeTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/corsSetting.ts b/sdk/constructive-react/src/api/orm/models/corsSetting.ts index 91b61c1eb4..2e37465f00 100644 --- a/sdk/constructive-react/src/api/orm/models/corsSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/corsSetting.ts @@ -196,7 +196,8 @@ export class CorsSettingModel { 'UpdateCorsSettingInput', 'id', 'corsSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/database.ts b/sdk/constructive-react/src/api/orm/models/database.ts index 57b3505489..41c99ba120 100644 --- a/sdk/constructive-react/src/api/orm/models/database.ts +++ b/sdk/constructive-react/src/api/orm/models/database.ts @@ -196,7 +196,8 @@ export class DatabaseModel { 'UpdateDatabaseInput', 'id', 'databasePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/databaseSetting.ts b/sdk/constructive-react/src/api/orm/models/databaseSetting.ts index 08d9ab8cb6..6743fdbdc2 100644 --- a/sdk/constructive-react/src/api/orm/models/databaseSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/databaseSetting.ts @@ -196,7 +196,8 @@ export class DatabaseSettingModel { 'UpdateDatabaseSettingInput', 'id', 'databaseSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts b/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts index dd22777cdf..9260ed2fb7 100644 --- a/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts +++ b/sdk/constructive-react/src/api/orm/models/databaseTransfer.ts @@ -196,7 +196,8 @@ export class DatabaseTransferModel { 'UpdateDatabaseTransferInput', 'id', 'databaseTransferPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts b/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts index 36414357b3..8d964bf6a4 100644 --- a/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts +++ b/sdk/constructive-react/src/api/orm/models/defaultPrivilege.ts @@ -196,7 +196,8 @@ export class DefaultPrivilegeModel { 'UpdateDefaultPrivilegeInput', 'id', 'defaultPrivilegePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/domain.ts b/sdk/constructive-react/src/api/orm/models/domain.ts index ab0016ec4b..d5d807ae4c 100644 --- a/sdk/constructive-react/src/api/orm/models/domain.ts +++ b/sdk/constructive-react/src/api/orm/models/domain.ts @@ -196,7 +196,8 @@ export class DomainModel { 'UpdateDomainInput', 'id', 'domainPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts b/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts index a5c7feb754..90af6f51a9 100644 --- a/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts +++ b/sdk/constructive-react/src/api/orm/models/embeddingChunk.ts @@ -196,7 +196,8 @@ export class EmbeddingChunkModel { 'UpdateEmbeddingChunkInput', 'id', 'embeddingChunkPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/enum.ts b/sdk/constructive-react/src/api/orm/models/enum.ts index 58495e1551..b5f965ea6f 100644 --- a/sdk/constructive-react/src/api/orm/models/enum.ts +++ b/sdk/constructive-react/src/api/orm/models/enum.ts @@ -196,7 +196,8 @@ export class EnumModel { 'UpdateEnumInput', 'id', 'enumPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/field.ts b/sdk/constructive-react/src/api/orm/models/field.ts index 7664e791c7..baa1994dbd 100644 --- a/sdk/constructive-react/src/api/orm/models/field.ts +++ b/sdk/constructive-react/src/api/orm/models/field.ts @@ -196,7 +196,8 @@ export class FieldModel { 'UpdateFieldInput', 'id', 'fieldPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts b/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts index 36e80496f3..498b987bd0 100644 --- a/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/foreignKeyConstraint.ts @@ -198,7 +198,8 @@ export class ForeignKeyConstraintModel { 'UpdateForeignKeyConstraintInput', 'id', 'foreignKeyConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts b/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts index 2135f84475..1fc50cde73 100644 --- a/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts +++ b/sdk/constructive-react/src/api/orm/models/fullTextSearch.ts @@ -196,7 +196,8 @@ export class FullTextSearchModel { 'UpdateFullTextSearchInput', 'id', 'fullTextSearchPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/function.ts b/sdk/constructive-react/src/api/orm/models/function.ts index 1ca6207ace..fc8fba9b21 100644 --- a/sdk/constructive-react/src/api/orm/models/function.ts +++ b/sdk/constructive-react/src/api/orm/models/function.ts @@ -196,7 +196,8 @@ export class FunctionModel { 'UpdateFunctionInput', 'id', 'functionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/indexModel.ts b/sdk/constructive-react/src/api/orm/models/indexModel.ts index 1c7eb1e964..919849c835 100644 --- a/sdk/constructive-react/src/api/orm/models/indexModel.ts +++ b/sdk/constructive-react/src/api/orm/models/indexModel.ts @@ -196,7 +196,8 @@ export class IndexModel { 'UpdateIndexInput', 'id', 'indexPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts b/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts index 83cb41250f..ab4670e925 100644 --- a/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts +++ b/sdk/constructive-react/src/api/orm/models/nodeTypeRegistry.ts @@ -196,7 +196,8 @@ export class NodeTypeRegistryModel { 'UpdateNodeTypeRegistryInput', 'name', 'nodeTypeRegistryPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/partition.ts b/sdk/constructive-react/src/api/orm/models/partition.ts index 86baeedbe9..1f848f6419 100644 --- a/sdk/constructive-react/src/api/orm/models/partition.ts +++ b/sdk/constructive-react/src/api/orm/models/partition.ts @@ -196,7 +196,8 @@ export class PartitionModel { 'UpdatePartitionInput', 'id', 'partitionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/policy.ts b/sdk/constructive-react/src/api/orm/models/policy.ts index c60088703b..0b50aa86d3 100644 --- a/sdk/constructive-react/src/api/orm/models/policy.ts +++ b/sdk/constructive-react/src/api/orm/models/policy.ts @@ -196,7 +196,8 @@ export class PolicyModel { 'UpdatePolicyInput', 'id', 'policyPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts b/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts index e73aca57d2..65f2946d86 100644 --- a/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/primaryKeyConstraint.ts @@ -198,7 +198,8 @@ export class PrimaryKeyConstraintModel { 'UpdatePrimaryKeyConstraintInput', 'id', 'primaryKeyConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts b/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts index d950bb4fd5..e44627cac6 100644 --- a/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts +++ b/sdk/constructive-react/src/api/orm/models/pubkeySetting.ts @@ -196,7 +196,8 @@ export class PubkeySettingModel { 'UpdatePubkeySettingInput', 'id', 'pubkeySettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/rlsSetting.ts b/sdk/constructive-react/src/api/orm/models/rlsSetting.ts index 50c715e02b..f371074a3a 100644 --- a/sdk/constructive-react/src/api/orm/models/rlsSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/rlsSetting.ts @@ -196,7 +196,8 @@ export class RlsSettingModel { 'UpdateRlsSettingInput', 'id', 'rlsSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/schema.ts b/sdk/constructive-react/src/api/orm/models/schema.ts index 3d0af98206..d9d34cae1a 100644 --- a/sdk/constructive-react/src/api/orm/models/schema.ts +++ b/sdk/constructive-react/src/api/orm/models/schema.ts @@ -196,7 +196,8 @@ export class SchemaModel { 'UpdateSchemaInput', 'id', 'schemaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/schemaGrant.ts b/sdk/constructive-react/src/api/orm/models/schemaGrant.ts index dfe7569752..553345a2b3 100644 --- a/sdk/constructive-react/src/api/orm/models/schemaGrant.ts +++ b/sdk/constructive-react/src/api/orm/models/schemaGrant.ts @@ -196,7 +196,8 @@ export class SchemaGrantModel { 'UpdateSchemaGrantInput', 'id', 'schemaGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/site.ts b/sdk/constructive-react/src/api/orm/models/site.ts index 070a32b240..30c5c8f81a 100644 --- a/sdk/constructive-react/src/api/orm/models/site.ts +++ b/sdk/constructive-react/src/api/orm/models/site.ts @@ -196,7 +196,8 @@ export class SiteModel { 'UpdateSiteInput', 'id', 'sitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts b/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts index de85238e4f..1e8bc08f33 100644 --- a/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts +++ b/sdk/constructive-react/src/api/orm/models/siteMetadatum.ts @@ -196,7 +196,8 @@ export class SiteMetadatumModel { 'UpdateSiteMetadatumInput', 'id', 'siteMetadatumPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/siteModule.ts b/sdk/constructive-react/src/api/orm/models/siteModule.ts index b890423fee..fe7f43bf62 100644 --- a/sdk/constructive-react/src/api/orm/models/siteModule.ts +++ b/sdk/constructive-react/src/api/orm/models/siteModule.ts @@ -196,7 +196,8 @@ export class SiteModuleModel { 'UpdateSiteModuleInput', 'id', 'siteModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/siteTheme.ts b/sdk/constructive-react/src/api/orm/models/siteTheme.ts index 57b9cadc54..51551f60db 100644 --- a/sdk/constructive-react/src/api/orm/models/siteTheme.ts +++ b/sdk/constructive-react/src/api/orm/models/siteTheme.ts @@ -196,7 +196,8 @@ export class SiteThemeModel { 'UpdateSiteThemeInput', 'id', 'siteThemePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/spatialRelation.ts b/sdk/constructive-react/src/api/orm/models/spatialRelation.ts index fe266c9d35..31de43c115 100644 --- a/sdk/constructive-react/src/api/orm/models/spatialRelation.ts +++ b/sdk/constructive-react/src/api/orm/models/spatialRelation.ts @@ -196,7 +196,8 @@ export class SpatialRelationModel { 'UpdateSpatialRelationInput', 'id', 'spatialRelationPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/table.ts b/sdk/constructive-react/src/api/orm/models/table.ts index db1c5d3a97..1f8df77e80 100644 --- a/sdk/constructive-react/src/api/orm/models/table.ts +++ b/sdk/constructive-react/src/api/orm/models/table.ts @@ -196,7 +196,8 @@ export class TableModel { 'UpdateTableInput', 'id', 'tablePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/tableGrant.ts b/sdk/constructive-react/src/api/orm/models/tableGrant.ts index e05b44f2b3..b49372245a 100644 --- a/sdk/constructive-react/src/api/orm/models/tableGrant.ts +++ b/sdk/constructive-react/src/api/orm/models/tableGrant.ts @@ -196,7 +196,8 @@ export class TableGrantModel { 'UpdateTableGrantInput', 'id', 'tableGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/trigger.ts b/sdk/constructive-react/src/api/orm/models/trigger.ts index f4812bc6ea..47169bc484 100644 --- a/sdk/constructive-react/src/api/orm/models/trigger.ts +++ b/sdk/constructive-react/src/api/orm/models/trigger.ts @@ -196,7 +196,8 @@ export class TriggerModel { 'UpdateTriggerInput', 'id', 'triggerPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/triggerFunction.ts b/sdk/constructive-react/src/api/orm/models/triggerFunction.ts index d2bd543aa4..40d2ee283e 100644 --- a/sdk/constructive-react/src/api/orm/models/triggerFunction.ts +++ b/sdk/constructive-react/src/api/orm/models/triggerFunction.ts @@ -196,7 +196,8 @@ export class TriggerFunctionModel { 'UpdateTriggerFunctionInput', 'id', 'triggerFunctionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts b/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts index 3c1dad93d6..0880a23e50 100644 --- a/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts +++ b/sdk/constructive-react/src/api/orm/models/uniqueConstraint.ts @@ -196,7 +196,8 @@ export class UniqueConstraintModel { 'UpdateUniqueConstraintInput', 'id', 'uniqueConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/view.ts b/sdk/constructive-react/src/api/orm/models/view.ts index 75acdcbcf5..04afa60a84 100644 --- a/sdk/constructive-react/src/api/orm/models/view.ts +++ b/sdk/constructive-react/src/api/orm/models/view.ts @@ -196,7 +196,8 @@ export class ViewModel { 'UpdateViewInput', 'id', 'viewPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/viewGrant.ts b/sdk/constructive-react/src/api/orm/models/viewGrant.ts index bd4eddaefe..7f9b69a42c 100644 --- a/sdk/constructive-react/src/api/orm/models/viewGrant.ts +++ b/sdk/constructive-react/src/api/orm/models/viewGrant.ts @@ -196,7 +196,8 @@ export class ViewGrantModel { 'UpdateViewGrantInput', 'id', 'viewGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/viewRule.ts b/sdk/constructive-react/src/api/orm/models/viewRule.ts index cdec5ad128..df3eadd57c 100644 --- a/sdk/constructive-react/src/api/orm/models/viewRule.ts +++ b/sdk/constructive-react/src/api/orm/models/viewRule.ts @@ -196,7 +196,8 @@ export class ViewRuleModel { 'UpdateViewRuleInput', 'id', 'viewRulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/viewTable.ts b/sdk/constructive-react/src/api/orm/models/viewTable.ts index 83362317e6..44308019a0 100644 --- a/sdk/constructive-react/src/api/orm/models/viewTable.ts +++ b/sdk/constructive-react/src/api/orm/models/viewTable.ts @@ -196,7 +196,8 @@ export class ViewTableModel { 'UpdateViewTableInput', 'id', 'viewTablePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts b/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts index e83c7e59f7..515c0dbcaa 100644 --- a/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts +++ b/sdk/constructive-react/src/api/orm/models/webauthnSetting.ts @@ -196,7 +196,8 @@ export class WebauthnSettingModel { 'UpdateWebauthnSettingInput', 'id', 'webauthnSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/api/orm/query-builder.ts b/sdk/constructive-react/src/api/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-react/src/api/orm/query-builder.ts +++ b/sdk/constructive-react/src/api/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/src/api/schema-types.ts b/sdk/constructive-react/src/api/schema-types.ts index e33b0a2a53..822204e7b1 100644 --- a/sdk/constructive-react/src/api/schema-types.ts +++ b/sdk/constructive-react/src/api/schema-types.ts @@ -75,6 +75,7 @@ export type ConstructiveInternalTypeImage = unknown; export type ConstructiveInternalTypeUpload = unknown; export type ConstructiveInternalTypeUrl = unknown; export type ObjectCategory = 'CORE' | 'MODULE' | 'PERMISSIONS' | 'AUTH' | 'MEMBERSHIPS' | 'APP'; +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; /** Methods to use when ordering `CheckConstraint`. */ export type CheckConstraintOrderBy = | 'NATURAL' @@ -857,6 +858,8 @@ export type SchemaOrderBy = | 'TAGS_DESC' | 'IS_PUBLIC_ASC' | 'IS_PUBLIC_DESC' + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' @@ -1561,6 +1564,8 @@ export interface SchemaFilter { tags?: StringListFilter; /** Filter by the object’s `isPublic` field. */ isPublic?: BooleanFilter; + /** Filter by the object’s `apiExposure` field. */ + apiExposure?: ApiExposureLevelFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ @@ -1606,6 +1611,31 @@ export interface SchemaFilter { /** `apiSchemas` exist. */ apiSchemasExist?: boolean; } +/** A filter to be used against ApiExposureLevel fields. All fields are combined with a logical ‘and.’ */ +export interface ApiExposureLevelFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: ApiExposureLevel; + /** Not equal to the specified value. */ + notEqualTo?: ApiExposureLevel; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: ApiExposureLevel; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: ApiExposureLevel; + /** Included in the specified list. */ + in?: ApiExposureLevel[]; + /** Not included in the specified list. */ + notIn?: ApiExposureLevel[]; + /** Less than the specified value. */ + lessThan?: ApiExposureLevel; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: ApiExposureLevel; + /** Greater than the specified value. */ + greaterThan?: ApiExposureLevel; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: ApiExposureLevel; +} /** A filter to be used against many `Table` object types. All fields are combined with a logical ‘and.’ */ export interface SchemaToManyTableFilter { /** Filters to entities where at least one related entity matches. */ @@ -5056,27 +5086,6 @@ export interface SiteInput { /** PostgreSQL database name this site connects to */ dbname?: string; } -export interface CreateSchemaInput { - clientMutationId?: string; - /** The `Schema` to be created by this mutation. */ - schema: SchemaInput; -} -/** An input for mutations affecting `Schema` */ -export interface SchemaInput { - id?: string; - databaseId: string; - name: string; - schemaName: string; - label?: string; - description?: string; - smartTags?: unknown; - category?: ObjectCategory; - scope?: number; - tags?: string[]; - isPublic?: boolean; - createdAt?: string; - updatedAt?: string; -} export interface CreateIndexInput { clientMutationId?: string; /** The `Index` to be created by this mutation. */ @@ -5222,6 +5231,28 @@ export interface AstMigrationInput { actionId?: string; actorId?: string; } +export interface CreateSchemaInput { + clientMutationId?: string; + /** The `Schema` to be created by this mutation. */ + schema: SchemaInput; +} +/** An input for mutations affecting `Schema` */ +export interface SchemaInput { + id?: string; + databaseId: string; + name: string; + schemaName: string; + label?: string; + description?: string; + smartTags?: unknown; + category?: ObjectCategory; + scope?: number; + tags?: string[]; + isPublic?: boolean; + apiExposure?: ApiExposureLevel; + createdAt?: string; + updatedAt?: string; +} export interface CreateFieldInput { clientMutationId?: string; /** The `Field` to be created by this mutation. */ @@ -6071,28 +6102,6 @@ export interface SitePatch { /** Upload for Primary logo image for the site */ logoUpload?: File; } -export interface UpdateSchemaInput { - clientMutationId?: string; - id: string; - /** An object where the defined keys will be set on the `Schema` being updated. */ - schemaPatch: SchemaPatch; -} -/** Represents an update to a `Schema`. Fields that are set will be updated. */ -export interface SchemaPatch { - id?: string; - databaseId?: string; - name?: string; - schemaName?: string; - label?: string; - description?: string; - smartTags?: unknown; - category?: ObjectCategory; - scope?: number; - tags?: string[]; - isPublic?: boolean; - createdAt?: string; - updatedAt?: string; -} export interface UpdateIndexInput { clientMutationId?: string; id: string; @@ -6222,6 +6231,29 @@ export interface WebauthnSettingPatch { /** Challenge TTL in seconds (default 300 = 5 minutes) */ challengeExpirySeconds?: string; } +export interface UpdateSchemaInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `Schema` being updated. */ + schemaPatch: SchemaPatch; +} +/** Represents an update to a `Schema`. Fields that are set will be updated. */ +export interface SchemaPatch { + id?: string; + databaseId?: string; + name?: string; + schemaName?: string; + label?: string; + description?: string; + smartTags?: unknown; + category?: ObjectCategory; + scope?: number; + tags?: string[]; + isPublic?: boolean; + apiExposure?: ApiExposureLevel; + createdAt?: string; + updatedAt?: string; +} export interface UpdateFieldInput { clientMutationId?: string; id: string; @@ -6442,10 +6474,6 @@ export interface DeleteSiteInput { /** Unique identifier for this site */ id: string; } -export interface DeleteSchemaInput { - clientMutationId?: string; - id: string; -} export interface DeleteIndexInput { clientMutationId?: string; id: string; @@ -6463,6 +6491,10 @@ export interface DeleteWebauthnSettingInput { /** Unique identifier for this WebAuthn settings record */ id: string; } +export interface DeleteSchemaInput { + clientMutationId?: string; + id: string; +} export interface DeleteFieldInput { clientMutationId?: string; id: string; @@ -6746,13 +6778,6 @@ export interface SiteConnection { pageInfo: PageInfo; totalCount: number; } -/** A connection to a list of `Schema` values. */ -export interface SchemaConnection { - nodes: Schema[]; - edges: SchemaEdge[]; - pageInfo: PageInfo; - totalCount: number; -} /** A connection to a list of `Index` values. */ export interface IndexConnection { nodes: Index[]; @@ -6788,6 +6813,13 @@ export interface AstMigrationConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `Schema` values. */ +export interface SchemaConnection { + nodes: Schema[]; + edges: SchemaEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `Field` values. */ export interface FieldConnection { nodes: Field[]; @@ -7062,12 +7094,6 @@ export interface CreateSitePayload { site?: Site | null; siteEdge?: SiteEdge | null; } -export interface CreateSchemaPayload { - clientMutationId?: string | null; - /** The `Schema` that was created by this mutation. */ - schema?: Schema | null; - schemaEdge?: SchemaEdge | null; -} export interface CreateIndexPayload { clientMutationId?: string | null; /** The `Index` that was created by this mutation. */ @@ -7097,6 +7123,12 @@ export interface CreateAstMigrationPayload { /** The `AstMigration` that was created by this mutation. */ astMigration?: AstMigration | null; } +export interface CreateSchemaPayload { + clientMutationId?: string | null; + /** The `Schema` that was created by this mutation. */ + schema?: Schema | null; + schemaEdge?: SchemaEdge | null; +} export interface CreateFieldPayload { clientMutationId?: string | null; /** The `Field` that was created by this mutation. */ @@ -7325,12 +7357,6 @@ export interface UpdateSitePayload { site?: Site | null; siteEdge?: SiteEdge | null; } -export interface UpdateSchemaPayload { - clientMutationId?: string | null; - /** The `Schema` that was updated by this mutation. */ - schema?: Schema | null; - schemaEdge?: SchemaEdge | null; -} export interface UpdateIndexPayload { clientMutationId?: string | null; /** The `Index` that was updated by this mutation. */ @@ -7355,6 +7381,12 @@ export interface UpdateWebauthnSettingPayload { webauthnSetting?: WebauthnSetting | null; webauthnSettingEdge?: WebauthnSettingEdge | null; } +export interface UpdateSchemaPayload { + clientMutationId?: string | null; + /** The `Schema` that was updated by this mutation. */ + schema?: Schema | null; + schemaEdge?: SchemaEdge | null; +} export interface UpdateFieldPayload { clientMutationId?: string | null; /** The `Field` that was updated by this mutation. */ @@ -7583,12 +7615,6 @@ export interface DeleteSitePayload { site?: Site | null; siteEdge?: SiteEdge | null; } -export interface DeleteSchemaPayload { - clientMutationId?: string | null; - /** The `Schema` that was deleted by this mutation. */ - schema?: Schema | null; - schemaEdge?: SchemaEdge | null; -} export interface DeleteIndexPayload { clientMutationId?: string | null; /** The `Index` that was deleted by this mutation. */ @@ -7613,6 +7639,12 @@ export interface DeleteWebauthnSettingPayload { webauthnSetting?: WebauthnSetting | null; webauthnSettingEdge?: WebauthnSettingEdge | null; } +export interface DeleteSchemaPayload { + clientMutationId?: string | null; + /** The `Schema` that was deleted by this mutation. */ + schema?: Schema | null; + schemaEdge?: SchemaEdge | null; +} export interface DeleteFieldPayload { clientMutationId?: string | null; /** The `Field` that was deleted by this mutation. */ @@ -7878,12 +7910,6 @@ export interface SiteEdge { /** The `Site` at the end of the edge. */ node?: Site | null; } -/** A `Schema` edge in the connection. */ -export interface SchemaEdge { - cursor?: string | null; - /** The `Schema` at the end of the edge. */ - node?: Schema | null; -} /** A `Index` edge in the connection. */ export interface IndexEdge { cursor?: string | null; @@ -7914,6 +7940,12 @@ export interface AstMigrationEdge { /** The `AstMigration` at the end of the edge. */ node?: AstMigration | null; } +/** A `Schema` edge in the connection. */ +export interface SchemaEdge { + cursor?: string | null; + /** The `Schema` at the end of the edge. */ + node?: Schema | null; +} /** A `Field` edge in the connection. */ export interface FieldEdge { cursor?: string | null; @@ -7939,6 +7971,14 @@ export interface MetaTable { relations: MetaRelations; inflection: MetaInflection; query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; } export interface ProvisionDatabaseWithUserRecord { outDatabaseId?: string | null; @@ -7963,6 +8003,8 @@ export interface MetaField { isPrimaryKey: boolean; isForeignKey: boolean; description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; } /** Information about a database index */ export interface MetaIndex { @@ -8028,6 +8070,36 @@ export interface MetaQuery { update?: string | null; delete?: string | null; } +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} /** Information about a PostgreSQL type */ export interface MetaType { pgType: string; @@ -8037,6 +8109,13 @@ export interface MetaType { hasDefault?: boolean | null; subtype?: string | null; } +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} /** Reference to a related table */ export interface MetaRefTable { name: string; @@ -8070,3 +8149,28 @@ export interface MetaManyToManyRelation { rightKeyAttributes: MetaField[]; rightTable: MetaRefTable; } +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/api/types.ts b/sdk/constructive-react/src/api/types.ts index 717187b51c..a4155812c2 100644 --- a/sdk/constructive-react/src/api/types.ts +++ b/sdk/constructive-react/src/api/types.ts @@ -3,7 +3,7 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ -import type { ObjectCategory } from './schema-types'; +import type { ApiExposureLevel, ObjectCategory } from './schema-types'; export type ConstructiveInternalTypeAttachment = unknown; export type ConstructiveInternalTypeHostname = unknown; export type ConstructiveInternalTypeImage = unknown; @@ -27,6 +27,7 @@ export interface Schema { scope: number | null; tags: string[] | null; isPublic: boolean | null; + apiExposure: ApiExposureLevel | null; createdAt: string | null; updatedAt: string | null; } diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts index 6ccb6a99bf..9fbfb12f51 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteAuditLogAuthMutation.ts @@ -41,6 +41,7 @@ export function useDeleteAuditLogAuthMutation( Error, { id: string; + createdAt: string; } >, 'mutationFn' @@ -54,6 +55,7 @@ export function useDeleteAuditLogAuthMutation( Error, { id: string; + createdAt: string; } >; export function useDeleteAuditLogAuthMutation( @@ -65,6 +67,7 @@ export function useDeleteAuditLogAuthMutation( Error, { id: string; + createdAt: string; } >, 'mutationFn' @@ -76,11 +79,12 @@ export function useDeleteAuditLogAuthMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: auditLogAuthMutationKeys.all, - mutationFn: ({ id }: { id: string }) => + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => getClient() .auditLogAuth.delete({ where: { id, + createdAt, }, select: args.select, }) diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts index 5d807d05ad..5ca6d4324c 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdateAuditLogAuthMutation.ts @@ -49,6 +49,7 @@ export function useUpdateAuditLogAuthMutation( Error, { id: string; + createdAt: string; auditLogAuthPatch: AuditLogAuthPatch; } >, @@ -63,6 +64,7 @@ export function useUpdateAuditLogAuthMutation( Error, { id: string; + createdAt: string; auditLogAuthPatch: AuditLogAuthPatch; } >; @@ -75,6 +77,7 @@ export function useUpdateAuditLogAuthMutation( Error, { id: string; + createdAt: string; auditLogAuthPatch: AuditLogAuthPatch; } >, @@ -87,11 +90,20 @@ export function useUpdateAuditLogAuthMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: auditLogAuthMutationKeys.all, - mutationFn: ({ id, auditLogAuthPatch }: { id: string; auditLogAuthPatch: AuditLogAuthPatch }) => + mutationFn: ({ + id, + createdAt, + auditLogAuthPatch, + }: { + id: string; + createdAt: string; + auditLogAuthPatch: AuditLogAuthPatch; + }) => getClient() .auditLogAuth.update({ where: { id, + createdAt, }, data: auditLogAuthPatch, select: args.select, diff --git a/sdk/constructive-react/src/auth/orm/input-types.ts b/sdk/constructive-react/src/auth/orm/input-types.ts index 8e73cfffb4..734fe10c3a 100644 --- a/sdk/constructive-react/src/auth/orm/input-types.ts +++ b/sdk/constructive-react/src/auth/orm/input-types.ts @@ -808,7 +808,8 @@ export interface UserFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -2221,7 +2222,8 @@ export interface UserFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; diff --git a/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts b/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts index 8a6665612c..d0eee8faf1 100644 --- a/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts +++ b/sdk/constructive-react/src/auth/orm/models/auditLogAuth.ts @@ -176,6 +176,7 @@ export class AuditLogAuthModel { S, { id: string; + createdAt: string; }, AuditLogAuthPatch > & { @@ -196,7 +197,10 @@ export class AuditLogAuthModel { 'UpdateAuditLogAuthInput', 'id', 'auditLogAuthPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class AuditLogAuthModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class AuditLogAuthModel { 'auditLogAuth', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteAuditLogAuthInput', args.select, diff --git a/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts b/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts index 11914bd9d1..5dc26c76df 100644 --- a/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts +++ b/sdk/constructive-react/src/auth/orm/models/cryptoAddress.ts @@ -196,7 +196,8 @@ export class CryptoAddressModel { 'UpdateCryptoAddressInput', 'id', 'cryptoAddressPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/auth/orm/models/email.ts b/sdk/constructive-react/src/auth/orm/models/email.ts index 325475b9ce..eb60ea671f 100644 --- a/sdk/constructive-react/src/auth/orm/models/email.ts +++ b/sdk/constructive-react/src/auth/orm/models/email.ts @@ -196,7 +196,8 @@ export class EmailModel { 'UpdateEmailInput', 'id', 'emailPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts b/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts index 0803908e25..f005f23c34 100644 --- a/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts +++ b/sdk/constructive-react/src/auth/orm/models/phoneNumber.ts @@ -196,7 +196,8 @@ export class PhoneNumberModel { 'UpdatePhoneNumberInput', 'id', 'phoneNumberPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/auth/orm/models/roleType.ts b/sdk/constructive-react/src/auth/orm/models/roleType.ts index 8b256a0dc7..e8df4924bd 100644 --- a/sdk/constructive-react/src/auth/orm/models/roleType.ts +++ b/sdk/constructive-react/src/auth/orm/models/roleType.ts @@ -196,7 +196,8 @@ export class RoleTypeModel { 'UpdateRoleTypeInput', 'id', 'roleTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/auth/orm/models/user.ts b/sdk/constructive-react/src/auth/orm/models/user.ts index 8935818350..a35147a5ac 100644 --- a/sdk/constructive-react/src/auth/orm/models/user.ts +++ b/sdk/constructive-react/src/auth/orm/models/user.ts @@ -196,7 +196,8 @@ export class UserModel { 'UpdateUserInput', 'id', 'userPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts b/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts index cca4c75cf4..bc31ef6a16 100644 --- a/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts +++ b/sdk/constructive-react/src/auth/orm/models/webauthnCredential.ts @@ -196,7 +196,8 @@ export class WebauthnCredentialModel { 'UpdateWebauthnCredentialInput', 'id', 'webauthnCredentialPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/auth/orm/query-builder.ts b/sdk/constructive-react/src/auth/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-react/src/auth/orm/query-builder.ts +++ b/sdk/constructive-react/src/auth/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/src/auth/schema-types.ts b/sdk/constructive-react/src/auth/schema-types.ts index 7f276f948a..681113df49 100644 --- a/sdk/constructive-react/src/auth/schema-types.ts +++ b/sdk/constructive-react/src/auth/schema-types.ts @@ -380,7 +380,8 @@ export interface UserFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -1725,6 +1726,14 @@ export interface MetaTable { relations: MetaRelations; inflection: MetaInflection; query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; } export interface SignInCrossOriginRecord { id?: string | null; @@ -1781,6 +1790,8 @@ export interface MetaField { isPrimaryKey: boolean; isForeignKey: boolean; description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; } /** Information about a database index */ export interface MetaIndex { @@ -1846,6 +1857,36 @@ export interface MetaQuery { update?: string | null; delete?: string | null; } +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} /** Information about a PostgreSQL type */ export interface MetaType { pgType: string; @@ -1855,6 +1896,13 @@ export interface MetaType { hasDefault?: boolean | null; subtype?: string | null; } +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} /** Reference to a related table */ export interface MetaRefTable { name: string; @@ -1888,3 +1936,28 @@ export interface MetaManyToManyRelation { rightKeyAttributes: MetaField[]; rightTable: MetaRefTable; } +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/compute/README.md b/sdk/constructive-react/src/compute/README.md new file mode 100644 index 0000000000..06d1f87550 --- /dev/null +++ b/sdk/constructive-react/src/compute/README.md @@ -0,0 +1,54 @@ +# Generated GraphQL SDK + +

+ +

+ + + +## Overview + +- **Tables:** 18 +- **Custom queries:** 1 +- **Custom mutations:** 14 + +**Generators:** ORM, React Query + +## Modules + +### ORM Client (`./orm`) + +Prisma-like ORM client for programmatic GraphQL access. + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', +}); +``` + +See [orm/README.md](./orm/README.md) for full API reference. + +### React Query Hooks (`./hooks`) + +Type-safe React Query hooks for data fetching and mutations. + +```typescript +import { configure } from './hooks'; +import { useCarsQuery } from './hooks'; + +configure({ endpoint: 'https://api.example.com/graphql' }); +``` + +See [hooks/README.md](./hooks/README.md) for full hook reference. + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-react/src/compute/hooks/README.md b/sdk/constructive-react/src/compute/hooks/README.md new file mode 100644 index 0000000000..1b13045117 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/README.md @@ -0,0 +1,693 @@ +# React Query Hooks + +

+ +

+ + + +## Setup + +```typescript +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { configure } from './hooks'; + +configure({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); + +const queryClient = new QueryClient(); + +function App() { + return ( + + + + ); +} +``` + +## Hooks + +| Hook | Type | Description | +|------|------|-------------| +| `useGetAllQuery` | Query | List all getAll | +| `useCreateGetAllRecordMutation` | Mutation | Create a getAllRecord | +| `useFunctionApiBindingsQuery` | Query | Join table binding function definitions to API endpoints with per-binding alias and config | +| `useFunctionApiBindingQuery` | Query | Join table binding function definitions to API endpoints with per-binding alias and config | +| `useCreateFunctionApiBindingMutation` | Mutation | Join table binding function definitions to API endpoints with per-binding alias and config | +| `useUpdateFunctionApiBindingMutation` | Mutation | Join table binding function definitions to API endpoints with per-binding alias and config | +| `useDeleteFunctionApiBindingMutation` | Mutation | Join table binding function definitions to API endpoints with per-binding alias and config | +| `useFunctionDeploymentsQuery` | Query | Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing | +| `useFunctionDeploymentQuery` | Query | Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing | +| `useCreateFunctionDeploymentMutation` | Mutation | Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing | +| `useUpdateFunctionDeploymentMutation` | Mutation | Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing | +| `useDeleteFunctionDeploymentMutation` | Mutation | Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing | +| `useFunctionGraphRefsQuery` | Query | Branch heads — mutable pointers into the commit chain | +| `useFunctionGraphRefQuery` | Query | Branch heads — mutable pointers into the commit chain | +| `useCreateFunctionGraphRefMutation` | Mutation | Branch heads — mutable pointers into the commit chain | +| `useUpdateFunctionGraphRefMutation` | Mutation | Branch heads — mutable pointers into the commit chain | +| `useDeleteFunctionGraphRefMutation` | Mutation | Branch heads — mutable pointers into the commit chain | +| `useFunctionGraphStoresQuery` | Query | Named stores — one per version-controlled tree (e.g. one graph, one definition set) | +| `useFunctionGraphStoreQuery` | Query | Named stores — one per version-controlled tree (e.g. one graph, one definition set) | +| `useCreateFunctionGraphStoreMutation` | Mutation | Named stores — one per version-controlled tree (e.g. one graph, one definition set) | +| `useUpdateFunctionGraphStoreMutation` | Mutation | Named stores — one per version-controlled tree (e.g. one graph, one definition set) | +| `useDeleteFunctionGraphStoreMutation` | Mutation | Named stores — one per version-controlled tree (e.g. one graph, one definition set) | +| `useFunctionGraphObjectsQuery` | Query | Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children | +| `useFunctionGraphObjectQuery` | Query | Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children | +| `useCreateFunctionGraphObjectMutation` | Mutation | Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children | +| `useUpdateFunctionGraphObjectMutation` | Mutation | Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children | +| `useDeleteFunctionGraphObjectMutation` | Mutation | Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children | +| `useFunctionDeploymentEventsQuery` | Query | Deployment lifecycle events — audit log of provisioning, scaling, and failure events | +| `useFunctionDeploymentEventQuery` | Query | Deployment lifecycle events — audit log of provisioning, scaling, and failure events | +| `useCreateFunctionDeploymentEventMutation` | Mutation | Deployment lifecycle events — audit log of provisioning, scaling, and failure events | +| `useUpdateFunctionDeploymentEventMutation` | Mutation | Deployment lifecycle events — audit log of provisioning, scaling, and failure events | +| `useDeleteFunctionDeploymentEventMutation` | Mutation | Deployment lifecycle events — audit log of provisioning, scaling, and failure events | +| `useOrgFunctionExecutionLogsQuery` | Query | Function execution logs — structured console output per invocation | +| `useOrgFunctionExecutionLogQuery` | Query | Function execution logs — structured console output per invocation | +| `useCreateOrgFunctionExecutionLogMutation` | Mutation | Function execution logs — structured console output per invocation | +| `useUpdateOrgFunctionExecutionLogMutation` | Mutation | Function execution logs — structured console output per invocation | +| `useDeleteOrgFunctionExecutionLogMutation` | Mutation | Function execution logs — structured console output per invocation | +| `useFunctionGraphExecutionOutputsQuery` | Query | Content-addressed store for execution outputs — hash-referenced from node_outputs | +| `useFunctionGraphExecutionOutputQuery` | Query | Content-addressed store for execution outputs — hash-referenced from node_outputs | +| `useCreateFunctionGraphExecutionOutputMutation` | Mutation | Content-addressed store for execution outputs — hash-referenced from node_outputs | +| `useUpdateFunctionGraphExecutionOutputMutation` | Mutation | Content-addressed store for execution outputs — hash-referenced from node_outputs | +| `useDeleteFunctionGraphExecutionOutputMutation` | Mutation | Content-addressed store for execution outputs — hash-referenced from node_outputs | +| `useFunctionGraphCommitsQuery` | Query | Commit history — each commit snapshots a tree root for a store | +| `useFunctionGraphCommitQuery` | Query | Commit history — each commit snapshots a tree root for a store | +| `useCreateFunctionGraphCommitMutation` | Mutation | Commit history — each commit snapshots a tree root for a store | +| `useUpdateFunctionGraphCommitMutation` | Mutation | Commit history — each commit snapshots a tree root for a store | +| `useDeleteFunctionGraphCommitMutation` | Mutation | Commit history — each commit snapshots a tree root for a store | +| `useSecretDefinitionsQuery` | Query | Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. | +| `useSecretDefinitionQuery` | Query | Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. | +| `useCreateSecretDefinitionMutation` | Mutation | Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. | +| `useUpdateSecretDefinitionMutation` | Mutation | Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. | +| `useDeleteSecretDefinitionMutation` | Mutation | Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. | +| `useFunctionExecutionLogsQuery` | Query | Function execution logs — structured console output per invocation | +| `useFunctionExecutionLogQuery` | Query | Function execution logs — structured console output per invocation | +| `useCreateFunctionExecutionLogMutation` | Mutation | Function execution logs — structured console output per invocation | +| `useUpdateFunctionExecutionLogMutation` | Mutation | Function execution logs — structured console output per invocation | +| `useDeleteFunctionExecutionLogMutation` | Mutation | Function execution logs — structured console output per invocation | +| `useFunctionGraphExecutionNodeStatesQuery` | Query | Per-node execution state — tracks individual node lifecycle for debugging | +| `useFunctionGraphExecutionNodeStateQuery` | Query | Per-node execution state — tracks individual node lifecycle for debugging | +| `useCreateFunctionGraphExecutionNodeStateMutation` | Mutation | Per-node execution state — tracks individual node lifecycle for debugging | +| `useUpdateFunctionGraphExecutionNodeStateMutation` | Mutation | Per-node execution state — tracks individual node lifecycle for debugging | +| `useDeleteFunctionGraphExecutionNodeStateMutation` | Mutation | Per-node execution state — tracks individual node lifecycle for debugging | +| `useFunctionGraphsQuery` | Query | Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store | +| `useFunctionGraphQuery` | Query | Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store | +| `useCreateFunctionGraphMutation` | Mutation | Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store | +| `useUpdateFunctionGraphMutation` | Mutation | Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store | +| `useDeleteFunctionGraphMutation` | Mutation | Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store | +| `useOrgFunctionInvocationsQuery` | Query | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useOrgFunctionInvocationQuery` | Query | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useCreateOrgFunctionInvocationMutation` | Mutation | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useUpdateOrgFunctionInvocationMutation` | Mutation | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useDeleteOrgFunctionInvocationMutation` | Mutation | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useFunctionInvocationsQuery` | Query | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useFunctionInvocationQuery` | Query | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useCreateFunctionInvocationMutation` | Mutation | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useUpdateFunctionInvocationMutation` | Mutation | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useDeleteFunctionInvocationMutation` | Mutation | Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. | +| `useFunctionGraphExecutionsQuery` | Query | Ephemeral execution state for flow graph evaluation | +| `useFunctionGraphExecutionQuery` | Query | Ephemeral execution state for flow graph evaluation | +| `useCreateFunctionGraphExecutionMutation` | Mutation | Ephemeral execution state for flow graph evaluation | +| `useUpdateFunctionGraphExecutionMutation` | Mutation | Ephemeral execution state for flow graph evaluation | +| `useDeleteFunctionGraphExecutionMutation` | Mutation | Ephemeral execution state for flow graph evaluation | +| `useFunctionDefinitionsQuery` | Query | Function definitions — registered cloud functions with routing, queue, and retry configuration | +| `useFunctionDefinitionQuery` | Query | Function definitions — registered cloud functions with routing, queue, and retry configuration | +| `useCreateFunctionDefinitionMutation` | Mutation | Function definitions — registered cloud functions with routing, queue, and retry configuration | +| `useUpdateFunctionDefinitionMutation` | Mutation | Function definitions — registered cloud functions with routing, queue, and retry configuration | +| `useDeleteFunctionDefinitionMutation` | Mutation | Function definitions — registered cloud functions with routing, queue, and retry configuration | +| `useReadFunctionGraphQuery` | Query | readFunctionGraph | +| `useValidateFunctionGraphMutation` | Mutation | validateFunctionGraph | +| `useInitEmptyRepoMutation` | Mutation | initEmptyRepo | +| `useSetDataAtPathMutation` | Mutation | setDataAtPath | +| `useImportDefinitionsMutation` | Mutation | importDefinitions | +| `useCopyGraphMutation` | Mutation | copyGraph | +| `useSaveGraphMutation` | Mutation | saveGraph | +| `useAddEdgeAndSaveMutation` | Mutation | addEdgeAndSave | +| `useAddNodeAndSaveMutation` | Mutation | addNodeAndSave | +| `useAddEdgeMutation` | Mutation | addEdge | +| `useAddNodeMutation` | Mutation | addNode | +| `useImportGraphJsonMutation` | Mutation | importGraphJson | +| `useInsertNodeAtPathMutation` | Mutation | insertNodeAtPath | +| `useStartExecutionMutation` | Mutation | startExecution | +| `useProvisionBucketMutation` | Mutation | Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. | + +## Table Hooks + +### GetAllRecord + +```typescript +// List all getAll +const { data, isLoading } = useGetAllQuery({ + selection: { fields: { path: true, data: true } }, +}); + +// Create a getAllRecord +const { mutate: create } = useCreateGetAllRecordMutation({ + selection: { fields: { id: true } }, +}); +create({ path: '', data: '' }); +``` + +### FunctionApiBinding + +```typescript +// List all functionApiBindings +const { data, isLoading } = useFunctionApiBindingsQuery({ + selection: { fields: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }, +}); + +// Get one functionApiBinding +const { data: item } = useFunctionApiBindingQuery({ + id: '', + selection: { fields: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }, +}); + +// Create a functionApiBinding +const { mutate: create } = useCreateFunctionApiBindingMutation({ + selection: { fields: { id: true } }, +}); +create({ functionDefinitionId: '', apiId: '', alias: '', config: '' }); +``` + +### FunctionDeployment + +```typescript +// List all functionDeployments +const { data, isLoading } = useFunctionDeploymentsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }, +}); + +// Get one functionDeployment +const { data: item } = useFunctionDeploymentQuery({ + id: '', + selection: { fields: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }, +}); + +// Create a functionDeployment +const { mutate: create } = useCreateFunctionDeploymentMutation({ + selection: { fields: { id: true } }, +}); +create({ functionDefinitionId: '', namespaceId: '', status: '', serviceUrl: '', serviceName: '', revision: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', lastError: '', lastErrorAt: '', errorCount: '', labels: '', annotations: '', databaseId: '' }); +``` + +### FunctionGraphRef + +```typescript +// List all functionGraphRefs +const { data, isLoading } = useFunctionGraphRefsQuery({ + selection: { fields: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }, +}); + +// Get one functionGraphRef +const { data: item } = useFunctionGraphRefQuery({ + id: '', + selection: { fields: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }, +}); + +// Create a functionGraphRef +const { mutate: create } = useCreateFunctionGraphRefMutation({ + selection: { fields: { id: true } }, +}); +create({ name: '', databaseId: '', storeId: '', commitId: '' }); +``` + +### FunctionGraphStore + +```typescript +// List all functionGraphStores +const { data, isLoading } = useFunctionGraphStoresQuery({ + selection: { fields: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }, +}); + +// Get one functionGraphStore +const { data: item } = useFunctionGraphStoreQuery({ + id: '', + selection: { fields: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }, +}); + +// Create a functionGraphStore +const { mutate: create } = useCreateFunctionGraphStoreMutation({ + selection: { fields: { id: true } }, +}); +create({ name: '', databaseId: '', hash: '' }); +``` + +### FunctionGraphObject + +```typescript +// List all functionGraphObjects +const { data, isLoading } = useFunctionGraphObjectsQuery({ + selection: { fields: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }, +}); + +// Get one functionGraphObject +const { data: item } = useFunctionGraphObjectQuery({ + id: '', + selection: { fields: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }, +}); + +// Create a functionGraphObject +const { mutate: create } = useCreateFunctionGraphObjectMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', kids: '', ktree: '', data: '' }); +``` + +### FunctionDeploymentEvent + +```typescript +// List all functionDeploymentEvents +const { data, isLoading } = useFunctionDeploymentEventsQuery({ + selection: { fields: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }, +}); + +// Get one functionDeploymentEvent +const { data: item } = useFunctionDeploymentEventQuery({ + id: '', + selection: { fields: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }, +}); + +// Create a functionDeploymentEvent +const { mutate: create } = useCreateFunctionDeploymentEventMutation({ + selection: { fields: { id: true } }, +}); +create({ deploymentId: '', eventType: '', actorId: '', message: '', metadata: '', databaseId: '' }); +``` + +### OrgFunctionExecutionLog + +```typescript +// List all orgFunctionExecutionLogs +const { data, isLoading } = useOrgFunctionExecutionLogsQuery({ + selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }, +}); + +// Get one orgFunctionExecutionLog +const { data: item } = useOrgFunctionExecutionLogQuery({ + id: '', + selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }, +}); + +// Create a orgFunctionExecutionLog +const { mutate: create } = useCreateOrgFunctionExecutionLogMutation({ + selection: { fields: { id: true } }, +}); +create({ invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '' }); +``` + +### FunctionGraphExecutionOutput + +```typescript +// List all functionGraphExecutionOutputs +const { data, isLoading } = useFunctionGraphExecutionOutputsQuery({ + selection: { fields: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }, +}); + +// Get one functionGraphExecutionOutput +const { data: item } = useFunctionGraphExecutionOutputQuery({ + id: '', + selection: { fields: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }, +}); + +// Create a functionGraphExecutionOutput +const { mutate: create } = useCreateFunctionGraphExecutionOutputMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', hash: '', data: '' }); +``` + +### FunctionGraphCommit + +```typescript +// List all functionGraphCommits +const { data, isLoading } = useFunctionGraphCommitsQuery({ + selection: { fields: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }, +}); + +// Get one functionGraphCommit +const { data: item } = useFunctionGraphCommitQuery({ + id: '', + selection: { fields: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }, +}); + +// Create a functionGraphCommit +const { mutate: create } = useCreateFunctionGraphCommitMutation({ + selection: { fields: { id: true } }, +}); +create({ message: '', databaseId: '', storeId: '', parentIds: '', authorId: '', committerId: '', treeId: '', date: '' }); +``` + +### SecretDefinition + +```typescript +// List all secretDefinitions +const { data, isLoading } = useSecretDefinitionsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }, +}); + +// Get one secretDefinition +const { data: item } = useSecretDefinitionQuery({ + id: '', + selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }, +}); + +// Create a secretDefinition +const { mutate: create } = useCreateSecretDefinitionMutation({ + selection: { fields: { id: true } }, +}); +create({ name: '', description: '', isBuiltIn: '', labels: '', annotations: '', databaseId: '' }); +``` + +### FunctionExecutionLog + +```typescript +// List all functionExecutionLogs +const { data, isLoading } = useFunctionExecutionLogsQuery({ + selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }, +}); + +// Get one functionExecutionLog +const { data: item } = useFunctionExecutionLogQuery({ + id: '', + selection: { fields: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }, +}); + +// Create a functionExecutionLog +const { mutate: create } = useCreateFunctionExecutionLogMutation({ + selection: { fields: { id: true } }, +}); +create({ invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }); +``` + +### FunctionGraphExecutionNodeState + +```typescript +// List all functionGraphExecutionNodeStates +const { data, isLoading } = useFunctionGraphExecutionNodeStatesQuery({ + selection: { fields: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }, +}); + +// Get one functionGraphExecutionNodeState +const { data: item } = useFunctionGraphExecutionNodeStateQuery({ + id: '', + selection: { fields: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }, +}); + +// Create a functionGraphExecutionNodeState +const { mutate: create } = useCreateFunctionGraphExecutionNodeStateMutation({ + selection: { fields: { id: true } }, +}); +create({ executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }); +``` + +### FunctionGraph + +```typescript +// List all functionGraphs +const { data, isLoading } = useFunctionGraphsQuery({ + selection: { fields: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }, +}); + +// Get one functionGraph +const { data: item } = useFunctionGraphQuery({ + id: '', + selection: { fields: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }, +}); + +// Create a functionGraph +const { mutate: create } = useCreateFunctionGraphMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }); +``` + +### OrgFunctionInvocation + +```typescript +// List all orgFunctionInvocations +const { data, isLoading } = useOrgFunctionInvocationsQuery({ + selection: { fields: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }, +}); + +// Get one orgFunctionInvocation +const { data: item } = useOrgFunctionInvocationQuery({ + id: '', + selection: { fields: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }, +}); + +// Create a orgFunctionInvocation +const { mutate: create } = useCreateOrgFunctionInvocationMutation({ + selection: { fields: { id: true } }, +}); +create({ actorId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }); +``` + +### FunctionInvocation + +```typescript +// List all functionInvocations +const { data, isLoading } = useFunctionInvocationsQuery({ + selection: { fields: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }, +}); + +// Get one functionInvocation +const { data: item } = useFunctionInvocationQuery({ + id: '', + selection: { fields: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }, +}); + +// Create a functionInvocation +const { mutate: create } = useCreateFunctionInvocationMutation({ + selection: { fields: { id: true } }, +}); +create({ actorId: '', databaseId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }); +``` + +### FunctionGraphExecution + +```typescript +// List all functionGraphExecutions +const { data, isLoading } = useFunctionGraphExecutionsQuery({ + selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }, +}); + +// Get one functionGraphExecution +const { data: item } = useFunctionGraphExecutionQuery({ + id: '', + selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }, +}); + +// Create a functionGraphExecution +const { mutate: create } = useCreateFunctionGraphExecutionMutation({ + selection: { fields: { id: true } }, +}); +create({ startedAt: '', graphId: '', invocationId: '', databaseId: '', entityId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }); +``` + +### FunctionDefinition + +```typescript +// List all functionDefinitions +const { data, isLoading } = useFunctionDefinitionsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }, +}); + +// Get one functionDefinition +const { data: item } = useFunctionDefinitionQuery({ + id: '', + selection: { fields: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }, +}); + +// Create a functionDefinition +const { mutate: create } = useCreateFunctionDefinitionMutation({ + selection: { fields: { id: true } }, +}); +create({ scope: '', name: '', taskIdentifier: '', description: '', isInvocable: '', maxAttempts: '', priority: '', queueName: '', runtime: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', isBuiltIn: '', requiredSecrets: '', requiredConfigs: '', requiredBuckets: '', requiredModels: '', inputs: '', outputs: '', props: '', volatile: '', icon: '', category: '' }); +``` + +## Custom Operation Hooks + +### `useReadFunctionGraphQuery` + +readFunctionGraph + +- **Type:** query +- **Arguments:** + + | Argument | Type | + |----------|------| + | `graphId` | UUID | + +### `useValidateFunctionGraphMutation` + +validateFunctionGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ValidateFunctionGraphInput (required) | + +### `useInitEmptyRepoMutation` + +initEmptyRepo + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InitEmptyRepoInput (required) | + +### `useSetDataAtPathMutation` + +setDataAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SetDataAtPathInput (required) | + +### `useImportDefinitionsMutation` + +importDefinitions + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportDefinitionsInput (required) | + +### `useCopyGraphMutation` + +copyGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CopyGraphInput (required) | + +### `useSaveGraphMutation` + +saveGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SaveGraphInput (required) | + +### `useAddEdgeAndSaveMutation` + +addEdgeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeAndSaveInput (required) | + +### `useAddNodeAndSaveMutation` + +addNodeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeAndSaveInput (required) | + +### `useAddEdgeMutation` + +addEdge + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeInput (required) | + +### `useAddNodeMutation` + +addNode + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeInput (required) | + +### `useImportGraphJsonMutation` + +importGraphJson + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportGraphJsonInput (required) | + +### `useInsertNodeAtPathMutation` + +insertNodeAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InsertNodeAtPathInput (required) | + +### `useStartExecutionMutation` + +startExecution + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | StartExecutionInput (required) | + +### `useProvisionBucketMutation` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-react/src/compute/hooks/client.ts b/sdk/constructive-react/src/compute/hooks/client.ts new file mode 100644 index 0000000000..47b9aa63f4 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/client.ts @@ -0,0 +1,42 @@ +/** + * ORM client wrapper for React Query hooks + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { createClient } from '../orm'; +import type { OrmClientConfig } from '../orm/client'; + +export type { OrmClientConfig } from '../orm/client'; +export type { GraphQLAdapter, GraphQLError, QueryResult } from '../orm/client'; +export { GraphQLRequestError } from '../orm/client'; + +type OrmClientInstance = ReturnType; +let client: OrmClientInstance | null = null; + +/** + * Configure the ORM client for React Query hooks + * + * @example + * ```ts + * import { configure } from './generated/hooks'; + * + * configure({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer ' }, + * }); + * ``` + */ +export function configure(config: OrmClientConfig): void { + client = createClient(config); +} + +/** + * Get the configured ORM client instance + * @throws Error if configure() has not been called + */ +export function getClient(): OrmClientInstance { + if (!client) { + throw new Error('ORM client not configured. Call configure() before using hooks.'); + } + return client; +} diff --git a/sdk/constructive-react/src/compute/hooks/index.ts b/sdk/constructive-react/src/compute/hooks/index.ts new file mode 100644 index 0000000000..599bf53945 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/index.ts @@ -0,0 +1,39 @@ +/** + * GraphQL SDK + * @generated by @constructive-io/graphql-codegen + * + * Tables: GetAllRecord, FunctionApiBinding, FunctionDeployment, FunctionGraphRef, FunctionGraphStore, FunctionGraphObject, FunctionDeploymentEvent, OrgFunctionExecutionLog, FunctionGraphExecutionOutput, FunctionGraphCommit, SecretDefinition, FunctionExecutionLog, FunctionGraphExecutionNodeState, FunctionGraph, OrgFunctionInvocation, FunctionInvocation, FunctionGraphExecution, FunctionDefinition + * + * Usage: + * + * 1. Configure the client: + * ```ts + * import { configure } from './generated'; + * + * configure({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer ' }, + * }); + * ``` + * + * 2. Use the hooks: + * ```tsx + * import { useCarsQuery, useCreateCarMutation } from './generated'; + * + * function MyComponent() { + * const { data, isLoading } = useCarsQuery({ + * selection: { fields: { id: true }, first: 10 }, + * }); + * const { mutate } = useCreateCarMutation({ + * selection: { fields: { id: true } }, + * }); + * // ... + * } + * ``` + */ +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/compute/hooks/invalidation.ts b/sdk/constructive-react/src/compute/hooks/invalidation.ts new file mode 100644 index 0000000000..4ec68a28ac --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/invalidation.ts @@ -0,0 +1,522 @@ +/** + * Cache invalidation helpers + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// ============================================================================ +// Type-safe cache invalidation utilities +// +// Features: +// - Simple invalidation helpers per entity +// - Cascade invalidation for parent-child relationships +// - Remove helpers for delete operations +// ============================================================================ + +import type { QueryClient } from '@tanstack/react-query'; +import { + getAllRecordKeys, + functionApiBindingKeys, + functionDeploymentKeys, + functionGraphRefKeys, + functionGraphStoreKeys, + functionGraphObjectKeys, + functionDeploymentEventKeys, + orgFunctionExecutionLogKeys, + functionGraphExecutionOutputKeys, + functionGraphCommitKeys, + secretDefinitionKeys, + functionExecutionLogKeys, + functionGraphExecutionNodeStateKeys, + functionGraphKeys, + orgFunctionInvocationKeys, + functionInvocationKeys, + functionGraphExecutionKeys, + functionDefinitionKeys, +} from './query-keys'; +/** +// ============================================================================ +// Invalidation Helpers +// ============================================================================ + + * Type-safe query invalidation helpers + * + * @example + * ```ts + * // Invalidate all user queries + * invalidate.user.all(queryClient); + * + * // Invalidate user lists + * invalidate.user.lists(queryClient); + * + * // Invalidate specific user + * invalidate.user.detail(queryClient, userId); + * ``` + */ +export const invalidate = { + /** Invalidate getAllRecord queries */ getAllRecord: { + /** Invalidate all getAllRecord queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: getAllRecordKeys.all, + }), + /** Invalidate getAllRecord list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: getAllRecordKeys.lists(), + }), + /** Invalidate a specific getAllRecord */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: getAllRecordKeys.detail(id), + }), + }, + /** Invalidate functionApiBinding queries */ functionApiBinding: { + /** Invalidate all functionApiBinding queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.all, + }), + /** Invalidate functionApiBinding list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.lists(), + }), + /** Invalidate a specific functionApiBinding */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.detail(id), + }), + }, + /** Invalidate functionDeployment queries */ functionDeployment: { + /** Invalidate all functionDeployment queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.all, + }), + /** Invalidate functionDeployment list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.lists(), + }), + /** Invalidate a specific functionDeployment */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.detail(id), + }), + }, + /** Invalidate functionGraphRef queries */ functionGraphRef: { + /** Invalidate all functionGraphRef queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.all, + }), + /** Invalidate functionGraphRef list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.lists(), + }), + /** Invalidate a specific functionGraphRef */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.detail(id), + }), + }, + /** Invalidate functionGraphStore queries */ functionGraphStore: { + /** Invalidate all functionGraphStore queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.all, + }), + /** Invalidate functionGraphStore list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.lists(), + }), + /** Invalidate a specific functionGraphStore */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.detail(id), + }), + }, + /** Invalidate functionGraphObject queries */ functionGraphObject: { + /** Invalidate all functionGraphObject queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.all, + }), + /** Invalidate functionGraphObject list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.lists(), + }), + /** Invalidate a specific functionGraphObject */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.detail(id), + }), + }, + /** Invalidate functionDeploymentEvent queries */ functionDeploymentEvent: { + /** Invalidate all functionDeploymentEvent queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.all, + }), + /** Invalidate functionDeploymentEvent list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.lists(), + }), + /** Invalidate a specific functionDeploymentEvent */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.detail(id), + }), + }, + /** Invalidate orgFunctionExecutionLog queries */ orgFunctionExecutionLog: { + /** Invalidate all orgFunctionExecutionLog queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgFunctionExecutionLogKeys.all, + }), + /** Invalidate orgFunctionExecutionLog list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgFunctionExecutionLogKeys.lists(), + }), + /** Invalidate a specific orgFunctionExecutionLog */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgFunctionExecutionLogKeys.detail(id), + }), + }, + /** Invalidate functionGraphExecutionOutput queries */ functionGraphExecutionOutput: { + /** Invalidate all functionGraphExecutionOutput queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.all, + }), + /** Invalidate functionGraphExecutionOutput list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.lists(), + }), + /** Invalidate a specific functionGraphExecutionOutput */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.detail(id), + }), + }, + /** Invalidate functionGraphCommit queries */ functionGraphCommit: { + /** Invalidate all functionGraphCommit queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.all, + }), + /** Invalidate functionGraphCommit list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.lists(), + }), + /** Invalidate a specific functionGraphCommit */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.detail(id), + }), + }, + /** Invalidate secretDefinition queries */ secretDefinition: { + /** Invalidate all secretDefinition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: secretDefinitionKeys.all, + }), + /** Invalidate secretDefinition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: secretDefinitionKeys.lists(), + }), + /** Invalidate a specific secretDefinition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: secretDefinitionKeys.detail(id), + }), + }, + /** Invalidate functionExecutionLog queries */ functionExecutionLog: { + /** Invalidate all functionExecutionLog queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.all, + }), + /** Invalidate functionExecutionLog list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.lists(), + }), + /** Invalidate a specific functionExecutionLog */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.detail(id), + }), + }, + /** Invalidate functionGraphExecutionNodeState queries */ functionGraphExecutionNodeState: { + /** Invalidate all functionGraphExecutionNodeState queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.all, + }), + /** Invalidate functionGraphExecutionNodeState list queries */ lists: ( + queryClient: QueryClient + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.lists(), + }), + /** Invalidate a specific functionGraphExecutionNodeState */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.detail(id), + }), + }, + /** Invalidate functionGraph queries */ functionGraph: { + /** Invalidate all functionGraph queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.all, + }), + /** Invalidate functionGraph list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.lists(), + }), + /** Invalidate a specific functionGraph */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.detail(id), + }), + }, + /** Invalidate orgFunctionInvocation queries */ orgFunctionInvocation: { + /** Invalidate all orgFunctionInvocation queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgFunctionInvocationKeys.all, + }), + /** Invalidate orgFunctionInvocation list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgFunctionInvocationKeys.lists(), + }), + /** Invalidate a specific orgFunctionInvocation */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgFunctionInvocationKeys.detail(id), + }), + }, + /** Invalidate functionInvocation queries */ functionInvocation: { + /** Invalidate all functionInvocation queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.all, + }), + /** Invalidate functionInvocation list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.lists(), + }), + /** Invalidate a specific functionInvocation */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.detail(id), + }), + }, + /** Invalidate functionGraphExecution queries */ functionGraphExecution: { + /** Invalidate all functionGraphExecution queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.all, + }), + /** Invalidate functionGraphExecution list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.lists(), + }), + /** Invalidate a specific functionGraphExecution */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.detail(id), + }), + }, + /** Invalidate functionDefinition queries */ functionDefinition: { + /** Invalidate all functionDefinition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.all, + }), + /** Invalidate functionDefinition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.lists(), + }), + /** Invalidate a specific functionDefinition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.detail(id), + }), + }, +} as const; +/** + +// ============================================================================ +// Remove Helpers (for delete operations) +// ============================================================================ + + * Remove queries from cache (for delete operations) + * + * Use these when an entity is deleted to remove it from cache + * instead of just invalidating (which would trigger a refetch). + */ +export const remove = { + /** Remove getAllRecord from cache */ getAllRecord: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: getAllRecordKeys.detail(id), + }); + }, + /** Remove functionApiBinding from cache */ functionApiBinding: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionApiBindingKeys.detail(id), + }); + }, + /** Remove functionDeployment from cache */ functionDeployment: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionDeploymentKeys.detail(id), + }); + }, + /** Remove functionGraphRef from cache */ functionGraphRef: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphRefKeys.detail(id), + }); + }, + /** Remove functionGraphStore from cache */ functionGraphStore: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphStoreKeys.detail(id), + }); + }, + /** Remove functionGraphObject from cache */ functionGraphObject: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphObjectKeys.detail(id), + }); + }, + /** Remove functionDeploymentEvent from cache */ functionDeploymentEvent: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionDeploymentEventKeys.detail(id), + }); + }, + /** Remove orgFunctionExecutionLog from cache */ orgFunctionExecutionLog: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: orgFunctionExecutionLogKeys.detail(id), + }); + }, + /** Remove functionGraphExecutionOutput from cache */ functionGraphExecutionOutput: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphExecutionOutputKeys.detail(id), + }); + }, + /** Remove functionGraphCommit from cache */ functionGraphCommit: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphCommitKeys.detail(id), + }); + }, + /** Remove secretDefinition from cache */ secretDefinition: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: secretDefinitionKeys.detail(id), + }); + }, + /** Remove functionExecutionLog from cache */ functionExecutionLog: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionExecutionLogKeys.detail(id), + }); + }, + /** Remove functionGraphExecutionNodeState from cache */ functionGraphExecutionNodeState: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphExecutionNodeStateKeys.detail(id), + }); + }, + /** Remove functionGraph from cache */ functionGraph: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphKeys.detail(id), + }); + }, + /** Remove orgFunctionInvocation from cache */ orgFunctionInvocation: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: orgFunctionInvocationKeys.detail(id), + }); + }, + /** Remove functionInvocation from cache */ functionInvocation: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionInvocationKeys.detail(id), + }); + }, + /** Remove functionGraphExecution from cache */ functionGraphExecution: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionGraphExecutionKeys.detail(id), + }); + }, + /** Remove functionDefinition from cache */ functionDefinition: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionDefinitionKeys.detail(id), + }); + }, +} as const; diff --git a/sdk/constructive-react/src/compute/hooks/mutation-keys.ts b/sdk/constructive-react/src/compute/hooks/mutation-keys.ts new file mode 100644 index 0000000000..f0f7bed160 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutation-keys.ts @@ -0,0 +1,306 @@ +/** + * Centralized mutation key factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// ============================================================================ +// Mutation keys for tracking in-flight mutations +// +// Benefits: +// - Track mutation state with useIsMutating +// - Implement optimistic updates with proper rollback +// - Deduplicate identical mutations +// - Coordinate related mutations +// ============================================================================ + +// ============================================================================ +// Entity Mutation Keys +// ============================================================================ + +export const getAllRecordMutationKeys = { + /** All getAllRecord mutation keys */ all: ['mutation', 'getallrecord'] as const, + /** Create getAllRecord mutation key */ create: () => + ['mutation', 'getallrecord', 'create'] as const, + /** Update getAllRecord mutation key */ update: (id: string | number) => + ['mutation', 'getallrecord', 'update', id] as const, + /** Delete getAllRecord mutation key */ delete: (id: string | number) => + ['mutation', 'getallrecord', 'delete', id] as const, +} as const; +export const functionApiBindingMutationKeys = { + /** All functionApiBinding mutation keys */ all: ['mutation', 'functionapibinding'] as const, + /** Create functionApiBinding mutation key */ create: () => + ['mutation', 'functionapibinding', 'create'] as const, + /** Update functionApiBinding mutation key */ update: (id: string | number) => + ['mutation', 'functionapibinding', 'update', id] as const, + /** Delete functionApiBinding mutation key */ delete: (id: string | number) => + ['mutation', 'functionapibinding', 'delete', id] as const, +} as const; +export const functionDeploymentMutationKeys = { + /** All functionDeployment mutation keys */ all: ['mutation', 'functiondeployment'] as const, + /** Create functionDeployment mutation key */ create: () => + ['mutation', 'functiondeployment', 'create'] as const, + /** Update functionDeployment mutation key */ update: (id: string | number) => + ['mutation', 'functiondeployment', 'update', id] as const, + /** Delete functionDeployment mutation key */ delete: (id: string | number) => + ['mutation', 'functiondeployment', 'delete', id] as const, +} as const; +export const functionGraphRefMutationKeys = { + /** All functionGraphRef mutation keys */ all: ['mutation', 'functiongraphref'] as const, + /** Create functionGraphRef mutation key */ create: () => + ['mutation', 'functiongraphref', 'create'] as const, + /** Update functionGraphRef mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphref', 'update', id] as const, + /** Delete functionGraphRef mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphref', 'delete', id] as const, +} as const; +export const functionGraphStoreMutationKeys = { + /** All functionGraphStore mutation keys */ all: ['mutation', 'functiongraphstore'] as const, + /** Create functionGraphStore mutation key */ create: () => + ['mutation', 'functiongraphstore', 'create'] as const, + /** Update functionGraphStore mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphstore', 'update', id] as const, + /** Delete functionGraphStore mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphstore', 'delete', id] as const, +} as const; +export const functionGraphObjectMutationKeys = { + /** All functionGraphObject mutation keys */ all: ['mutation', 'functiongraphobject'] as const, + /** Create functionGraphObject mutation key */ create: () => + ['mutation', 'functiongraphobject', 'create'] as const, + /** Update functionGraphObject mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphobject', 'update', id] as const, + /** Delete functionGraphObject mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphobject', 'delete', id] as const, +} as const; +export const functionDeploymentEventMutationKeys = { + /** All functionDeploymentEvent mutation keys */ all: [ + 'mutation', + 'functiondeploymentevent', + ] as const, + /** Create functionDeploymentEvent mutation key */ create: () => + ['mutation', 'functiondeploymentevent', 'create'] as const, + /** Update functionDeploymentEvent mutation key */ update: (id: string | number) => + ['mutation', 'functiondeploymentevent', 'update', id] as const, + /** Delete functionDeploymentEvent mutation key */ delete: (id: string | number) => + ['mutation', 'functiondeploymentevent', 'delete', id] as const, +} as const; +export const orgFunctionExecutionLogMutationKeys = { + /** All orgFunctionExecutionLog mutation keys */ all: [ + 'mutation', + 'orgfunctionexecutionlog', + ] as const, + /** Create orgFunctionExecutionLog mutation key */ create: () => + ['mutation', 'orgfunctionexecutionlog', 'create'] as const, + /** Update orgFunctionExecutionLog mutation key */ update: (id: string | number) => + ['mutation', 'orgfunctionexecutionlog', 'update', id] as const, + /** Delete orgFunctionExecutionLog mutation key */ delete: (id: string | number) => + ['mutation', 'orgfunctionexecutionlog', 'delete', id] as const, +} as const; +export const functionGraphExecutionOutputMutationKeys = { + /** All functionGraphExecutionOutput mutation keys */ all: [ + 'mutation', + 'functiongraphexecutionoutput', + ] as const, + /** Create functionGraphExecutionOutput mutation key */ create: () => + ['mutation', 'functiongraphexecutionoutput', 'create'] as const, + /** Update functionGraphExecutionOutput mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphexecutionoutput', 'update', id] as const, + /** Delete functionGraphExecutionOutput mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphexecutionoutput', 'delete', id] as const, +} as const; +export const functionGraphCommitMutationKeys = { + /** All functionGraphCommit mutation keys */ all: ['mutation', 'functiongraphcommit'] as const, + /** Create functionGraphCommit mutation key */ create: () => + ['mutation', 'functiongraphcommit', 'create'] as const, + /** Update functionGraphCommit mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphcommit', 'update', id] as const, + /** Delete functionGraphCommit mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphcommit', 'delete', id] as const, +} as const; +export const secretDefinitionMutationKeys = { + /** All secretDefinition mutation keys */ all: ['mutation', 'secretdefinition'] as const, + /** Create secretDefinition mutation key */ create: () => + ['mutation', 'secretdefinition', 'create'] as const, + /** Update secretDefinition mutation key */ update: (id: string | number) => + ['mutation', 'secretdefinition', 'update', id] as const, + /** Delete secretDefinition mutation key */ delete: (id: string | number) => + ['mutation', 'secretdefinition', 'delete', id] as const, +} as const; +export const functionExecutionLogMutationKeys = { + /** All functionExecutionLog mutation keys */ all: ['mutation', 'functionexecutionlog'] as const, + /** Create functionExecutionLog mutation key */ create: () => + ['mutation', 'functionexecutionlog', 'create'] as const, + /** Update functionExecutionLog mutation key */ update: (id: string | number) => + ['mutation', 'functionexecutionlog', 'update', id] as const, + /** Delete functionExecutionLog mutation key */ delete: (id: string | number) => + ['mutation', 'functionexecutionlog', 'delete', id] as const, +} as const; +export const functionGraphExecutionNodeStateMutationKeys = { + /** All functionGraphExecutionNodeState mutation keys */ all: [ + 'mutation', + 'functiongraphexecutionnodestate', + ] as const, + /** Create functionGraphExecutionNodeState mutation key */ create: () => + ['mutation', 'functiongraphexecutionnodestate', 'create'] as const, + /** Update functionGraphExecutionNodeState mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphexecutionnodestate', 'update', id] as const, + /** Delete functionGraphExecutionNodeState mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphexecutionnodestate', 'delete', id] as const, +} as const; +export const functionGraphMutationKeys = { + /** All functionGraph mutation keys */ all: ['mutation', 'functiongraph'] as const, + /** Create functionGraph mutation key */ create: () => + ['mutation', 'functiongraph', 'create'] as const, + /** Update functionGraph mutation key */ update: (id: string | number) => + ['mutation', 'functiongraph', 'update', id] as const, + /** Delete functionGraph mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraph', 'delete', id] as const, +} as const; +export const orgFunctionInvocationMutationKeys = { + /** All orgFunctionInvocation mutation keys */ all: [ + 'mutation', + 'orgfunctioninvocation', + ] as const, + /** Create orgFunctionInvocation mutation key */ create: () => + ['mutation', 'orgfunctioninvocation', 'create'] as const, + /** Update orgFunctionInvocation mutation key */ update: (id: string | number) => + ['mutation', 'orgfunctioninvocation', 'update', id] as const, + /** Delete orgFunctionInvocation mutation key */ delete: (id: string | number) => + ['mutation', 'orgfunctioninvocation', 'delete', id] as const, +} as const; +export const functionInvocationMutationKeys = { + /** All functionInvocation mutation keys */ all: ['mutation', 'functioninvocation'] as const, + /** Create functionInvocation mutation key */ create: () => + ['mutation', 'functioninvocation', 'create'] as const, + /** Update functionInvocation mutation key */ update: (id: string | number) => + ['mutation', 'functioninvocation', 'update', id] as const, + /** Delete functionInvocation mutation key */ delete: (id: string | number) => + ['mutation', 'functioninvocation', 'delete', id] as const, +} as const; +export const functionGraphExecutionMutationKeys = { + /** All functionGraphExecution mutation keys */ all: [ + 'mutation', + 'functiongraphexecution', + ] as const, + /** Create functionGraphExecution mutation key */ create: () => + ['mutation', 'functiongraphexecution', 'create'] as const, + /** Update functionGraphExecution mutation key */ update: (id: string | number) => + ['mutation', 'functiongraphexecution', 'update', id] as const, + /** Delete functionGraphExecution mutation key */ delete: (id: string | number) => + ['mutation', 'functiongraphexecution', 'delete', id] as const, +} as const; +export const functionDefinitionMutationKeys = { + /** All functionDefinition mutation keys */ all: ['mutation', 'functiondefinition'] as const, + /** Create functionDefinition mutation key */ create: () => + ['mutation', 'functiondefinition', 'create'] as const, + /** Update functionDefinition mutation key */ update: (id: string | number) => + ['mutation', 'functiondefinition', 'update', id] as const, + /** Delete functionDefinition mutation key */ delete: (id: string | number) => + ['mutation', 'functiondefinition', 'delete', id] as const, +} as const; + +// ============================================================================ +// Custom Mutation Keys +// ============================================================================ + +export const customMutationKeys = { + /** Mutation key for validateFunctionGraph */ validateFunctionGraph: (identifier?: string) => + identifier + ? (['mutation', 'validateFunctionGraph', identifier] as const) + : (['mutation', 'validateFunctionGraph'] as const), + /** Mutation key for initEmptyRepo */ initEmptyRepo: (identifier?: string) => + identifier + ? (['mutation', 'initEmptyRepo', identifier] as const) + : (['mutation', 'initEmptyRepo'] as const), + /** Mutation key for setDataAtPath */ setDataAtPath: (identifier?: string) => + identifier + ? (['mutation', 'setDataAtPath', identifier] as const) + : (['mutation', 'setDataAtPath'] as const), + /** Mutation key for importDefinitions */ importDefinitions: (identifier?: string) => + identifier + ? (['mutation', 'importDefinitions', identifier] as const) + : (['mutation', 'importDefinitions'] as const), + /** Mutation key for copyGraph */ copyGraph: (identifier?: string) => + identifier + ? (['mutation', 'copyGraph', identifier] as const) + : (['mutation', 'copyGraph'] as const), + /** Mutation key for saveGraph */ saveGraph: (identifier?: string) => + identifier + ? (['mutation', 'saveGraph', identifier] as const) + : (['mutation', 'saveGraph'] as const), + /** Mutation key for addEdgeAndSave */ addEdgeAndSave: (identifier?: string) => + identifier + ? (['mutation', 'addEdgeAndSave', identifier] as const) + : (['mutation', 'addEdgeAndSave'] as const), + /** Mutation key for addNodeAndSave */ addNodeAndSave: (identifier?: string) => + identifier + ? (['mutation', 'addNodeAndSave', identifier] as const) + : (['mutation', 'addNodeAndSave'] as const), + /** Mutation key for addEdge */ addEdge: (identifier?: string) => + identifier + ? (['mutation', 'addEdge', identifier] as const) + : (['mutation', 'addEdge'] as const), + /** Mutation key for addNode */ addNode: (identifier?: string) => + identifier + ? (['mutation', 'addNode', identifier] as const) + : (['mutation', 'addNode'] as const), + /** Mutation key for importGraphJson */ importGraphJson: (identifier?: string) => + identifier + ? (['mutation', 'importGraphJson', identifier] as const) + : (['mutation', 'importGraphJson'] as const), + /** Mutation key for insertNodeAtPath */ insertNodeAtPath: (identifier?: string) => + identifier + ? (['mutation', 'insertNodeAtPath', identifier] as const) + : (['mutation', 'insertNodeAtPath'] as const), + /** Mutation key for startExecution */ startExecution: (identifier?: string) => + identifier + ? (['mutation', 'startExecution', identifier] as const) + : (['mutation', 'startExecution'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), +} as const; +/** + +// ============================================================================ +// Unified Mutation Key Store +// ============================================================================ + + * Unified mutation key store + * + * Use this for tracking in-flight mutations with useIsMutating. + * + * @example + * ```ts + * import { useIsMutating } from '@tanstack/react-query'; + * import { mutationKeys } from './generated'; + * + * // Check if any user mutations are in progress + * const isMutatingUser = useIsMutating({ mutationKey: mutationKeys.user.all }); + * + * // Check if a specific user is being updated + * const isUpdating = useIsMutating({ mutationKey: mutationKeys.user.update(userId) }); + * ``` + */ +export const mutationKeys = { + getAllRecord: getAllRecordMutationKeys, + functionApiBinding: functionApiBindingMutationKeys, + functionDeployment: functionDeploymentMutationKeys, + functionGraphRef: functionGraphRefMutationKeys, + functionGraphStore: functionGraphStoreMutationKeys, + functionGraphObject: functionGraphObjectMutationKeys, + functionDeploymentEvent: functionDeploymentEventMutationKeys, + orgFunctionExecutionLog: orgFunctionExecutionLogMutationKeys, + functionGraphExecutionOutput: functionGraphExecutionOutputMutationKeys, + functionGraphCommit: functionGraphCommitMutationKeys, + secretDefinition: secretDefinitionMutationKeys, + functionExecutionLog: functionExecutionLogMutationKeys, + functionGraphExecutionNodeState: functionGraphExecutionNodeStateMutationKeys, + functionGraph: functionGraphMutationKeys, + orgFunctionInvocation: orgFunctionInvocationMutationKeys, + functionInvocation: functionInvocationMutationKeys, + functionGraphExecution: functionGraphExecutionMutationKeys, + functionDefinition: functionDefinitionMutationKeys, + custom: customMutationKeys, +} as const; diff --git a/sdk/constructive-react/src/compute/hooks/mutations/index.ts b/sdk/constructive-react/src/compute/hooks/mutations/index.ts new file mode 100644 index 0000000000..579248665b --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/index.ts @@ -0,0 +1,71 @@ +/** + * Mutation hooks barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export * from './useCreateGetAllRecordMutation'; +export * from './useCreateFunctionApiBindingMutation'; +export * from './useUpdateFunctionApiBindingMutation'; +export * from './useDeleteFunctionApiBindingMutation'; +export * from './useCreateFunctionDeploymentMutation'; +export * from './useUpdateFunctionDeploymentMutation'; +export * from './useDeleteFunctionDeploymentMutation'; +export * from './useCreateFunctionGraphRefMutation'; +export * from './useUpdateFunctionGraphRefMutation'; +export * from './useDeleteFunctionGraphRefMutation'; +export * from './useCreateFunctionGraphStoreMutation'; +export * from './useUpdateFunctionGraphStoreMutation'; +export * from './useDeleteFunctionGraphStoreMutation'; +export * from './useCreateFunctionGraphObjectMutation'; +export * from './useUpdateFunctionGraphObjectMutation'; +export * from './useDeleteFunctionGraphObjectMutation'; +export * from './useCreateFunctionDeploymentEventMutation'; +export * from './useUpdateFunctionDeploymentEventMutation'; +export * from './useDeleteFunctionDeploymentEventMutation'; +export * from './useCreateOrgFunctionExecutionLogMutation'; +export * from './useUpdateOrgFunctionExecutionLogMutation'; +export * from './useDeleteOrgFunctionExecutionLogMutation'; +export * from './useCreateFunctionGraphExecutionOutputMutation'; +export * from './useUpdateFunctionGraphExecutionOutputMutation'; +export * from './useDeleteFunctionGraphExecutionOutputMutation'; +export * from './useCreateFunctionGraphCommitMutation'; +export * from './useUpdateFunctionGraphCommitMutation'; +export * from './useDeleteFunctionGraphCommitMutation'; +export * from './useCreateSecretDefinitionMutation'; +export * from './useUpdateSecretDefinitionMutation'; +export * from './useDeleteSecretDefinitionMutation'; +export * from './useCreateFunctionExecutionLogMutation'; +export * from './useUpdateFunctionExecutionLogMutation'; +export * from './useDeleteFunctionExecutionLogMutation'; +export * from './useCreateFunctionGraphExecutionNodeStateMutation'; +export * from './useUpdateFunctionGraphExecutionNodeStateMutation'; +export * from './useDeleteFunctionGraphExecutionNodeStateMutation'; +export * from './useCreateFunctionGraphMutation'; +export * from './useUpdateFunctionGraphMutation'; +export * from './useDeleteFunctionGraphMutation'; +export * from './useCreateOrgFunctionInvocationMutation'; +export * from './useUpdateOrgFunctionInvocationMutation'; +export * from './useDeleteOrgFunctionInvocationMutation'; +export * from './useCreateFunctionInvocationMutation'; +export * from './useUpdateFunctionInvocationMutation'; +export * from './useDeleteFunctionInvocationMutation'; +export * from './useCreateFunctionGraphExecutionMutation'; +export * from './useUpdateFunctionGraphExecutionMutation'; +export * from './useDeleteFunctionGraphExecutionMutation'; +export * from './useCreateFunctionDefinitionMutation'; +export * from './useUpdateFunctionDefinitionMutation'; +export * from './useDeleteFunctionDefinitionMutation'; +export * from './useValidateFunctionGraphMutation'; +export * from './useInitEmptyRepoMutation'; +export * from './useSetDataAtPathMutation'; +export * from './useImportDefinitionsMutation'; +export * from './useCopyGraphMutation'; +export * from './useSaveGraphMutation'; +export * from './useAddEdgeAndSaveMutation'; +export * from './useAddNodeAndSaveMutation'; +export * from './useAddEdgeMutation'; +export * from './useAddNodeMutation'; +export * from './useImportGraphJsonMutation'; +export * from './useInsertNodeAtPathMutation'; +export * from './useStartExecutionMutation'; +export * from './useProvisionBucketMutation'; diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeAndSaveMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeAndSaveMutation.ts new file mode 100644 index 0000000000..214c3a81b7 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeAndSaveMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for addEdgeAndSave + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddEdgeAndSaveVariables } from '../../orm/mutation'; +import type { AddEdgeAndSavePayloadSelect, AddEdgeAndSavePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddEdgeAndSaveVariables } from '../../orm/mutation'; +export type { AddEdgeAndSavePayloadSelect } from '../../orm/input-types'; +export function useAddEdgeAndSaveMutation( + params: { + selection: { + fields: S & AddEdgeAndSavePayloadSelect; + } & HookStrictSelect, AddEdgeAndSavePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addEdgeAndSave: InferSelectResult | null; + }, + Error, + AddEdgeAndSaveVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addEdgeAndSave: InferSelectResult | null; + }, + Error, + AddEdgeAndSaveVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.addEdgeAndSave(), + mutationFn: (variables: AddEdgeAndSaveVariables) => + getClient() + .mutation.addEdgeAndSave(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeMutation.ts new file mode 100644 index 0000000000..e79559bdd4 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddEdgeMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for addEdge + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddEdgeVariables } from '../../orm/mutation'; +import type { AddEdgePayloadSelect, AddEdgePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddEdgeVariables } from '../../orm/mutation'; +export type { AddEdgePayloadSelect } from '../../orm/input-types'; +export function useAddEdgeMutation( + params: { + selection: { + fields: S & AddEdgePayloadSelect; + } & HookStrictSelect, AddEdgePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addEdge: InferSelectResult | null; + }, + Error, + AddEdgeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addEdge: InferSelectResult | null; + }, + Error, + AddEdgeVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.addEdge(), + mutationFn: (variables: AddEdgeVariables) => + getClient() + .mutation.addEdge(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeAndSaveMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeAndSaveMutation.ts new file mode 100644 index 0000000000..7d87df31e2 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeAndSaveMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for addNodeAndSave + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddNodeAndSaveVariables } from '../../orm/mutation'; +import type { AddNodeAndSavePayloadSelect, AddNodeAndSavePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddNodeAndSaveVariables } from '../../orm/mutation'; +export type { AddNodeAndSavePayloadSelect } from '../../orm/input-types'; +export function useAddNodeAndSaveMutation( + params: { + selection: { + fields: S & AddNodeAndSavePayloadSelect; + } & HookStrictSelect, AddNodeAndSavePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addNodeAndSave: InferSelectResult | null; + }, + Error, + AddNodeAndSaveVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addNodeAndSave: InferSelectResult | null; + }, + Error, + AddNodeAndSaveVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.addNodeAndSave(), + mutationFn: (variables: AddNodeAndSaveVariables) => + getClient() + .mutation.addNodeAndSave(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeMutation.ts new file mode 100644 index 0000000000..baddff020f --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useAddNodeMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for addNode + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { AddNodeVariables } from '../../orm/mutation'; +import type { AddNodePayloadSelect, AddNodePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { AddNodeVariables } from '../../orm/mutation'; +export type { AddNodePayloadSelect } from '../../orm/input-types'; +export function useAddNodeMutation( + params: { + selection: { + fields: S & AddNodePayloadSelect; + } & HookStrictSelect, AddNodePayloadSelect>; + } & Omit< + UseMutationOptions< + { + addNode: InferSelectResult | null; + }, + Error, + AddNodeVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + addNode: InferSelectResult | null; + }, + Error, + AddNodeVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.addNode(), + mutationFn: (variables: AddNodeVariables) => + getClient() + .mutation.addNode(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCopyGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCopyGraphMutation.ts new file mode 100644 index 0000000000..5ecc7fe417 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCopyGraphMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for copyGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { CopyGraphVariables } from '../../orm/mutation'; +import type { CopyGraphPayloadSelect, CopyGraphPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CopyGraphVariables } from '../../orm/mutation'; +export type { CopyGraphPayloadSelect } from '../../orm/input-types'; +export function useCopyGraphMutation( + params: { + selection: { + fields: S & CopyGraphPayloadSelect; + } & HookStrictSelect, CopyGraphPayloadSelect>; + } & Omit< + UseMutationOptions< + { + copyGraph: InferSelectResult | null; + }, + Error, + CopyGraphVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + copyGraph: InferSelectResult | null; + }, + Error, + CopyGraphVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.copyGraph(), + mutationFn: (variables: CopyGraphVariables) => + getClient() + .mutation.copyGraph(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionApiBindingMutation.ts new file mode 100644 index 0000000000..d6daa06138 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionApiBindingMutation.ts @@ -0,0 +1,91 @@ +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import { functionApiBindingMutationKeys } from '../mutation-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + CreateFunctionApiBindingInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + CreateFunctionApiBindingInput, +} from '../../orm/input-types'; +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionApiBindingMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionApiBindingMutation( + params: { + selection: { + fields: S & FunctionApiBindingSelect; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + CreateFunctionApiBindingInput['functionApiBinding'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + CreateFunctionApiBindingInput['functionApiBinding'] +>; +export function useCreateFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionApiBindingMutationKeys.create(), + mutationFn: (data: CreateFunctionApiBindingInput['functionApiBinding']) => + getClient() + .functionApiBinding.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDefinitionMutation.ts new file mode 100644 index 0000000000..5c6f608dfa --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDefinitionMutation.ts @@ -0,0 +1,91 @@ +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import { functionDefinitionMutationKeys } from '../mutation-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + CreateFunctionDefinitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + CreateFunctionDefinitionInput, +} from '../../orm/input-types'; +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionDefinitionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionDefinitionMutation( + params: { + selection: { + fields: S & FunctionDefinitionSelect; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + CreateFunctionDefinitionInput['functionDefinition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + CreateFunctionDefinitionInput['functionDefinition'] +>; +export function useCreateFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDefinitionMutationKeys.create(), + mutationFn: (data: CreateFunctionDefinitionInput['functionDefinition']) => + getClient() + .functionDefinition.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentEventMutation.ts new file mode 100644 index 0000000000..2748474f25 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentEventMutation.ts @@ -0,0 +1,91 @@ +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import { functionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + CreateFunctionDeploymentEventInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + CreateFunctionDeploymentEventInput, +} from '../../orm/input-types'; +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionDeploymentEventMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionDeploymentEventMutation( + params: { + selection: { + fields: S & FunctionDeploymentEventSelect; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentEventInput['functionDeploymentEvent'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentEventInput['functionDeploymentEvent'] +>; +export function useCreateFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentEventMutationKeys.create(), + mutationFn: (data: CreateFunctionDeploymentEventInput['functionDeploymentEvent']) => + getClient() + .functionDeploymentEvent.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentMutation.ts new file mode 100644 index 0000000000..d9b3d48e6c --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionDeploymentMutation.ts @@ -0,0 +1,91 @@ +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import { functionDeploymentMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + CreateFunctionDeploymentInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + CreateFunctionDeploymentInput, +} from '../../orm/input-types'; +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionDeploymentMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionDeploymentMutation( + params: { + selection: { + fields: S & FunctionDeploymentSelect; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentInput['functionDeployment'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentInput['functionDeployment'] +>; +export function useCreateFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentMutationKeys.create(), + mutationFn: (data: CreateFunctionDeploymentInput['functionDeployment']) => + getClient() + .functionDeployment.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionExecutionLogMutation.ts new file mode 100644 index 0000000000..1eebcc0105 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionExecutionLogMutation.ts @@ -0,0 +1,91 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import { functionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + CreateFunctionExecutionLogInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + CreateFunctionExecutionLogInput, +} from '../../orm/input-types'; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionExecutionLogMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionExecutionLogMutation( + params: { + selection: { + fields: S & FunctionExecutionLogSelect; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + CreateFunctionExecutionLogInput['functionExecutionLog'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + CreateFunctionExecutionLogInput['functionExecutionLog'] +>; +export function useCreateFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionExecutionLogMutationKeys.create(), + mutationFn: (data: CreateFunctionExecutionLogInput['functionExecutionLog']) => + getClient() + .functionExecutionLog.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphCommitMutation.ts new file mode 100644 index 0000000000..2c95e04e11 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphCommitMutation.ts @@ -0,0 +1,91 @@ +/** + * Commit history — each commit snapshots a tree root for a store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import { functionGraphCommitMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + CreateFunctionGraphCommitInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + CreateFunctionGraphCommitInput, +} from '../../orm/input-types'; +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphCommitMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphCommitMutation( + params: { + selection: { + fields: S & FunctionGraphCommitSelect; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphCommitInput['functionGraphCommit'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphCommitInput['functionGraphCommit'] +>; +export function useCreateFunctionGraphCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphCommitMutationKeys.create(), + mutationFn: (data: CreateFunctionGraphCommitInput['functionGraphCommit']) => + getClient() + .functionGraphCommit.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionMutation.ts new file mode 100644 index 0000000000..ff10d231cb --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionMutation.ts @@ -0,0 +1,91 @@ +/** + * Ephemeral execution state for flow graph evaluation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import { functionGraphExecutionMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + CreateFunctionGraphExecutionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + CreateFunctionGraphExecutionInput, +} from '../../orm/input-types'; +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphExecutionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphExecutionMutation( + params: { + selection: { + fields: S & FunctionGraphExecutionSelect; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphExecutionInput['functionGraphExecution'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphExecutionInput['functionGraphExecution'] +>; +export function useCreateFunctionGraphExecutionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionMutationKeys.create(), + mutationFn: (data: CreateFunctionGraphExecutionInput['functionGraphExecution']) => + getClient() + .functionGraphExecution.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionNodeStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionNodeStateMutation.ts new file mode 100644 index 0000000000..f722811efd --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionNodeStateMutation.ts @@ -0,0 +1,105 @@ +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import { functionGraphExecutionNodeStateMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + CreateFunctionGraphExecutionNodeStateInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + CreateFunctionGraphExecutionNodeStateInput, +} from '../../orm/input-types'; +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphExecutionNodeStateMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphExecutionNodeStateMutation< + S extends FunctionGraphExecutionNodeStateSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionNodeStateSelect; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] +>; +export function useCreateFunctionGraphExecutionNodeStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionNodeStateMutationKeys.create(), + mutationFn: ( + data: CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + ) => + getClient() + .functionGraphExecutionNodeState.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionOutputMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionOutputMutation.ts new file mode 100644 index 0000000000..baf6b7f9ac --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphExecutionOutputMutation.ts @@ -0,0 +1,100 @@ +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import { functionGraphExecutionOutputMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + CreateFunctionGraphExecutionOutputInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + CreateFunctionGraphExecutionOutputInput, +} from '../../orm/input-types'; +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphExecutionOutputMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphExecutionOutputMutation< + S extends FunctionGraphExecutionOutputSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionOutputSelect; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + >; + }; + }, + Error, + CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput'] +>; +export function useCreateFunctionGraphExecutionOutputMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput'] + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionOutputMutationKeys.create(), + mutationFn: (data: CreateFunctionGraphExecutionOutputInput['functionGraphExecutionOutput']) => + getClient() + .functionGraphExecutionOutput.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts new file mode 100644 index 0000000000..63532d7f17 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts @@ -0,0 +1,88 @@ +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import { functionGraphMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphSelect, + FunctionGraphWithRelations, + CreateFunctionGraphInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphSelect, + FunctionGraphWithRelations, + CreateFunctionGraphInput, +} from '../../orm/input-types'; +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphMutation( + params: { + selection: { + fields: S & FunctionGraphSelect; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphInput['functionGraph'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphInput['functionGraph'] +>; +export function useCreateFunctionGraphMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphMutationKeys.create(), + mutationFn: (data: CreateFunctionGraphInput['functionGraph']) => + getClient() + .functionGraph.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphObjectMutation.ts new file mode 100644 index 0000000000..161d0809c0 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphObjectMutation.ts @@ -0,0 +1,91 @@ +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import { functionGraphObjectMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + CreateFunctionGraphObjectInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + CreateFunctionGraphObjectInput, +} from '../../orm/input-types'; +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphObjectMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphObjectMutation( + params: { + selection: { + fields: S & FunctionGraphObjectSelect; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphObjectInput['functionGraphObject'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphObjectInput['functionGraphObject'] +>; +export function useCreateFunctionGraphObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphObjectMutationKeys.create(), + mutationFn: (data: CreateFunctionGraphObjectInput['functionGraphObject']) => + getClient() + .functionGraphObject.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphRefMutation.ts new file mode 100644 index 0000000000..bd7d8c0193 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphRefMutation.ts @@ -0,0 +1,91 @@ +/** + * Branch heads — mutable pointers into the commit chain + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import { functionGraphRefMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + CreateFunctionGraphRefInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + CreateFunctionGraphRefInput, +} from '../../orm/input-types'; +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphRefMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphRefMutation( + params: { + selection: { + fields: S & FunctionGraphRefSelect; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphRefInput['functionGraphRef'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphRefInput['functionGraphRef'] +>; +export function useCreateFunctionGraphRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphRefMutationKeys.create(), + mutationFn: (data: CreateFunctionGraphRefInput['functionGraphRef']) => + getClient() + .functionGraphRef.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphStoreMutation.ts new file mode 100644 index 0000000000..c0e3e497a9 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphStoreMutation.ts @@ -0,0 +1,91 @@ +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import { functionGraphStoreMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + CreateFunctionGraphStoreInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + CreateFunctionGraphStoreInput, +} from '../../orm/input-types'; +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionGraphStoreMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionGraphStoreMutation( + params: { + selection: { + fields: S & FunctionGraphStoreSelect; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphStoreInput['functionGraphStore'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + CreateFunctionGraphStoreInput['functionGraphStore'] +>; +export function useCreateFunctionGraphStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphStoreMutationKeys.create(), + mutationFn: (data: CreateFunctionGraphStoreInput['functionGraphStore']) => + getClient() + .functionGraphStore.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationMutation.ts new file mode 100644 index 0000000000..e0d01cf76e --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionInvocationMutation.ts @@ -0,0 +1,91 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import { functionInvocationMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + CreateFunctionInvocationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + CreateFunctionInvocationInput, +} from '../../orm/input-types'; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionInvocationMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionInvocationMutation( + params: { + selection: { + fields: S & FunctionInvocationSelect; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationInput['functionInvocation'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + CreateFunctionInvocationInput['functionInvocation'] +>; +export function useCreateFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionInvocationMutationKeys.create(), + mutationFn: (data: CreateFunctionInvocationInput['functionInvocation']) => + getClient() + .functionInvocation.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateGetAllRecordMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateGetAllRecordMutation.ts new file mode 100644 index 0000000000..d7761690bf --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateGetAllRecordMutation.ts @@ -0,0 +1,88 @@ +/** + * Create mutation hook for GetAllRecord + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { getAllRecordKeys } from '../query-keys'; +import { getAllRecordMutationKeys } from '../mutation-keys'; +import type { + GetAllRecordSelect, + GetAllRecordWithRelations, + CreateGetAllRecordInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GetAllRecordSelect, + GetAllRecordWithRelations, + CreateGetAllRecordInput, +} from '../../orm/input-types'; +/** + * Mutation hook for creating a GetAllRecord + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateGetAllRecordMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateGetAllRecordMutation( + params: { + selection: { + fields: S & GetAllRecordSelect; + } & HookStrictSelect, GetAllRecordSelect>; + } & Omit< + UseMutationOptions< + { + createGetAllRecord: { + getAllRecord: InferSelectResult; + }; + }, + Error, + CreateGetAllRecordInput['getAllRecord'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createGetAllRecord: { + getAllRecord: InferSelectResult; + }; + }, + Error, + CreateGetAllRecordInput['getAllRecord'] +>; +export function useCreateGetAllRecordMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: getAllRecordMutationKeys.create(), + mutationFn: (data: CreateGetAllRecordInput['getAllRecord']) => + getClient() + .getAllRecord.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: getAllRecordKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateOrgFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateOrgFunctionExecutionLogMutation.ts new file mode 100644 index 0000000000..f93b6596de --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateOrgFunctionExecutionLogMutation.ts @@ -0,0 +1,91 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionExecutionLogKeys } from '../query-keys'; +import { orgFunctionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, + CreateOrgFunctionExecutionLogInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, + CreateOrgFunctionExecutionLogInput, +} from '../../orm/input-types'; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateOrgFunctionExecutionLogMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateOrgFunctionExecutionLogMutation( + params: { + selection: { + fields: S & OrgFunctionExecutionLogSelect; + } & HookStrictSelect, OrgFunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + createOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + CreateOrgFunctionExecutionLogInput['orgFunctionExecutionLog'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + CreateOrgFunctionExecutionLogInput['orgFunctionExecutionLog'] +>; +export function useCreateOrgFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: orgFunctionExecutionLogMutationKeys.create(), + mutationFn: (data: CreateOrgFunctionExecutionLogInput['orgFunctionExecutionLog']) => + getClient() + .orgFunctionExecutionLog.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: orgFunctionExecutionLogKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateOrgFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateOrgFunctionInvocationMutation.ts new file mode 100644 index 0000000000..0ddaa50890 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateOrgFunctionInvocationMutation.ts @@ -0,0 +1,91 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionInvocationKeys } from '../query-keys'; +import { orgFunctionInvocationMutationKeys } from '../mutation-keys'; +import type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, + CreateOrgFunctionInvocationInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, + CreateOrgFunctionInvocationInput, +} from '../../orm/input-types'; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateOrgFunctionInvocationMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateOrgFunctionInvocationMutation( + params: { + selection: { + fields: S & OrgFunctionInvocationSelect; + } & HookStrictSelect, OrgFunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + createOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }, + Error, + CreateOrgFunctionInvocationInput['orgFunctionInvocation'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }, + Error, + CreateOrgFunctionInvocationInput['orgFunctionInvocation'] +>; +export function useCreateOrgFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: orgFunctionInvocationMutationKeys.create(), + mutationFn: (data: CreateOrgFunctionInvocationInput['orgFunctionInvocation']) => + getClient() + .orgFunctionInvocation.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: orgFunctionInvocationKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useCreateSecretDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useCreateSecretDefinitionMutation.ts new file mode 100644 index 0000000000..3b9b9185e4 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useCreateSecretDefinitionMutation.ts @@ -0,0 +1,91 @@ +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { secretDefinitionKeys } from '../query-keys'; +import { secretDefinitionMutationKeys } from '../mutation-keys'; +import type { + SecretDefinitionSelect, + SecretDefinitionWithRelations, + CreateSecretDefinitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SecretDefinitionSelect, + SecretDefinitionWithRelations, + CreateSecretDefinitionInput, +} from '../../orm/input-types'; +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateSecretDefinitionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateSecretDefinitionMutation( + params: { + selection: { + fields: S & SecretDefinitionSelect; + } & HookStrictSelect, SecretDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + createSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }, + Error, + CreateSecretDefinitionInput['secretDefinition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }, + Error, + CreateSecretDefinitionInput['secretDefinition'] +>; +export function useCreateSecretDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: secretDefinitionMutationKeys.create(), + mutationFn: (data: CreateSecretDefinitionInput['secretDefinition']) => + getClient() + .secretDefinition.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: secretDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionApiBindingMutation.ts new file mode 100644 index 0000000000..3747959696 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionApiBindingMutation.ts @@ -0,0 +1,104 @@ +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import { functionApiBindingMutationKeys } from '../mutation-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionApiBindingMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionApiBindingMutation( + params: { + selection: { + fields: S & FunctionApiBindingSelect; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionApiBindingMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .functionApiBinding.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionApiBindingKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDefinitionMutation.ts new file mode 100644 index 0000000000..ae239c2a10 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDefinitionMutation.ts @@ -0,0 +1,104 @@ +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import { functionDefinitionMutationKeys } from '../mutation-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionDefinitionMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionDefinitionMutation( + params: { + selection: { + fields: S & FunctionDefinitionSelect; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDefinitionMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .functionDefinition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionDefinitionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentEventMutation.ts new file mode 100644 index 0000000000..a5577c17e0 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentEventMutation.ts @@ -0,0 +1,108 @@ +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import { functionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionDeploymentEventMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionDeploymentEventMutation( + params: { + selection: { + fields: S & FunctionDeploymentEventSelect; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentEventMutationKeys.all, + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionDeploymentEvent.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionDeploymentEventKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentMutation.ts new file mode 100644 index 0000000000..d32d592b1c --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionDeploymentMutation.ts @@ -0,0 +1,104 @@ +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import { functionDeploymentMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionDeploymentMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionDeploymentMutation( + params: { + selection: { + fields: S & FunctionDeploymentSelect; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .functionDeployment.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionDeploymentKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionExecutionLogMutation.ts new file mode 100644 index 0000000000..2847f05358 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionExecutionLogMutation.ts @@ -0,0 +1,108 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import { functionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionExecutionLogMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionExecutionLogMutation( + params: { + selection: { + fields: S & FunctionExecutionLogSelect; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionExecutionLogMutationKeys.all, + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionExecutionLog.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionExecutionLogKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphCommitMutation.ts new file mode 100644 index 0000000000..650752e957 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphCommitMutation.ts @@ -0,0 +1,108 @@ +/** + * Commit history — each commit snapshots a tree root for a store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import { functionGraphCommitMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphCommitMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphCommitMutation( + params: { + selection: { + fields: S & FunctionGraphCommitSelect; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteFunctionGraphCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphCommitMutationKeys.all, + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .functionGraphCommit.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphCommitKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionMutation.ts new file mode 100644 index 0000000000..976deb68f8 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionMutation.ts @@ -0,0 +1,108 @@ +/** + * Ephemeral execution state for flow graph evaluation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import { functionGraphExecutionMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphExecutionMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphExecutionMutation( + params: { + selection: { + fields: S & FunctionGraphExecutionSelect; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + } +>; +export function useDeleteFunctionGraphExecutionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + startedAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionMutationKeys.all, + mutationFn: ({ id, startedAt }: { id: string; startedAt: string }) => + getClient() + .functionGraphExecution.delete({ + where: { + id, + startedAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphExecutionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionNodeStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionNodeStateMutation.ts new file mode 100644 index 0000000000..d1195ca049 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionNodeStateMutation.ts @@ -0,0 +1,116 @@ +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import { functionGraphExecutionNodeStateMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphExecutionNodeStateMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphExecutionNodeStateMutation< + S extends FunctionGraphExecutionNodeStateSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionNodeStateSelect; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionGraphExecutionNodeStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionNodeStateMutationKeys.all, + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionGraphExecutionNodeState.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphExecutionNodeStateKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionOutputMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionOutputMutation.ts new file mode 100644 index 0000000000..83a99597d5 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphExecutionOutputMutation.ts @@ -0,0 +1,113 @@ +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import { functionGraphExecutionOutputMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphExecutionOutputMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphExecutionOutputMutation< + S extends FunctionGraphExecutionOutputSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionOutputSelect; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionGraphExecutionOutputMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionOutputMutationKeys.all, + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionGraphExecutionOutput.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphExecutionOutputKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphMutation.ts new file mode 100644 index 0000000000..65c66edd38 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphMutation.ts @@ -0,0 +1,98 @@ +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import { functionGraphMutationKeys } from '../mutation-keys'; +import type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphMutation( + params: { + selection: { + fields: S & FunctionGraphSelect; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionGraphMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .functionGraph.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphObjectMutation.ts new file mode 100644 index 0000000000..16288eb20b --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphObjectMutation.ts @@ -0,0 +1,108 @@ +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import { functionGraphObjectMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphObjectMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphObjectMutation( + params: { + selection: { + fields: S & FunctionGraphObjectSelect; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteFunctionGraphObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphObjectMutationKeys.all, + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .functionGraphObject.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphObjectKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphRefMutation.ts new file mode 100644 index 0000000000..7b4cdaa50c --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphRefMutation.ts @@ -0,0 +1,102 @@ +/** + * Branch heads — mutable pointers into the commit chain + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import { functionGraphRefMutationKeys } from '../mutation-keys'; +import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphRefMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphRefMutation( + params: { + selection: { + fields: S & FunctionGraphRefSelect; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + } +>; +export function useDeleteFunctionGraphRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphRefMutationKeys.all, + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => + getClient() + .functionGraphRef.delete({ + where: { + id, + databaseId, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphRefKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphStoreMutation.ts new file mode 100644 index 0000000000..33467b80e7 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionGraphStoreMutation.ts @@ -0,0 +1,104 @@ +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import { functionGraphStoreMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionGraphStoreMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionGraphStoreMutation( + params: { + selection: { + fields: S & FunctionGraphStoreSelect; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionGraphStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphStoreMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .functionGraphStore.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionGraphStoreKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationMutation.ts new file mode 100644 index 0000000000..c90980a3a0 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteFunctionInvocationMutation.ts @@ -0,0 +1,108 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import { functionInvocationMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionInvocationMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionInvocationMutation( + params: { + selection: { + fields: S & FunctionInvocationSelect; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionInvocationMutationKeys.all, + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .functionInvocation.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionInvocationKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteOrgFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteOrgFunctionExecutionLogMutation.ts new file mode 100644 index 0000000000..4189cba72b --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteOrgFunctionExecutionLogMutation.ts @@ -0,0 +1,108 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionExecutionLogKeys } from '../query-keys'; +import { orgFunctionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteOrgFunctionExecutionLogMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteOrgFunctionExecutionLogMutation( + params: { + selection: { + fields: S & OrgFunctionExecutionLogSelect; + } & HookStrictSelect, OrgFunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteOrgFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: orgFunctionExecutionLogMutationKeys.all, + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .orgFunctionExecutionLog.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: orgFunctionExecutionLogKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: orgFunctionExecutionLogKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteOrgFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteOrgFunctionInvocationMutation.ts new file mode 100644 index 0000000000..be33dd7429 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteOrgFunctionInvocationMutation.ts @@ -0,0 +1,108 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionInvocationKeys } from '../query-keys'; +import { orgFunctionInvocationMutationKeys } from '../mutation-keys'; +import type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, +} from '../../orm/input-types'; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteOrgFunctionInvocationMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteOrgFunctionInvocationMutation( + params: { + selection: { + fields: S & OrgFunctionInvocationSelect; + } & HookStrictSelect, OrgFunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + } +>; +export function useDeleteOrgFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: orgFunctionInvocationMutationKeys.all, + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => + getClient() + .orgFunctionInvocation.delete({ + where: { + id, + createdAt, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: orgFunctionInvocationKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: orgFunctionInvocationKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useDeleteSecretDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteSecretDefinitionMutation.ts new file mode 100644 index 0000000000..8e5ffe43f3 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useDeleteSecretDefinitionMutation.ts @@ -0,0 +1,98 @@ +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { secretDefinitionKeys } from '../query-keys'; +import { secretDefinitionMutationKeys } from '../mutation-keys'; +import type { SecretDefinitionSelect, SecretDefinitionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SecretDefinitionSelect, SecretDefinitionWithRelations } from '../../orm/input-types'; +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteSecretDefinitionMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteSecretDefinitionMutation( + params: { + selection: { + fields: S & SecretDefinitionSelect; + } & HookStrictSelect, SecretDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + deleteSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteSecretDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: secretDefinitionMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .secretDefinition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: secretDefinitionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: secretDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useImportDefinitionsMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useImportDefinitionsMutation.ts new file mode 100644 index 0000000000..1554fa5a65 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useImportDefinitionsMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for importDefinitions + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ImportDefinitionsVariables } from '../../orm/mutation'; +import type { + ImportDefinitionsPayloadSelect, + ImportDefinitionsPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ImportDefinitionsVariables } from '../../orm/mutation'; +export type { ImportDefinitionsPayloadSelect } from '../../orm/input-types'; +export function useImportDefinitionsMutation( + params: { + selection: { + fields: S & ImportDefinitionsPayloadSelect; + } & HookStrictSelect, ImportDefinitionsPayloadSelect>; + } & Omit< + UseMutationOptions< + { + importDefinitions: InferSelectResult | null; + }, + Error, + ImportDefinitionsVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + importDefinitions: InferSelectResult | null; + }, + Error, + ImportDefinitionsVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.importDefinitions(), + mutationFn: (variables: ImportDefinitionsVariables) => + getClient() + .mutation.importDefinitions(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useImportGraphJsonMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useImportGraphJsonMutation.ts new file mode 100644 index 0000000000..00b6d1e68d --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useImportGraphJsonMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for importGraphJson + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ImportGraphJsonVariables } from '../../orm/mutation'; +import type { ImportGraphJsonPayloadSelect, ImportGraphJsonPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ImportGraphJsonVariables } from '../../orm/mutation'; +export type { ImportGraphJsonPayloadSelect } from '../../orm/input-types'; +export function useImportGraphJsonMutation( + params: { + selection: { + fields: S & ImportGraphJsonPayloadSelect; + } & HookStrictSelect, ImportGraphJsonPayloadSelect>; + } & Omit< + UseMutationOptions< + { + importGraphJson: InferSelectResult | null; + }, + Error, + ImportGraphJsonVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + importGraphJson: InferSelectResult | null; + }, + Error, + ImportGraphJsonVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.importGraphJson(), + mutationFn: (variables: ImportGraphJsonVariables) => + getClient() + .mutation.importGraphJson(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useInitEmptyRepoMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useInitEmptyRepoMutation.ts new file mode 100644 index 0000000000..f82dc9e02c --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useInitEmptyRepoMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for initEmptyRepo + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { InitEmptyRepoVariables } from '../../orm/mutation'; +import type { InitEmptyRepoPayloadSelect, InitEmptyRepoPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InitEmptyRepoVariables } from '../../orm/mutation'; +export type { InitEmptyRepoPayloadSelect } from '../../orm/input-types'; +export function useInitEmptyRepoMutation( + params: { + selection: { + fields: S & InitEmptyRepoPayloadSelect; + } & HookStrictSelect, InitEmptyRepoPayloadSelect>; + } & Omit< + UseMutationOptions< + { + initEmptyRepo: InferSelectResult | null; + }, + Error, + InitEmptyRepoVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + initEmptyRepo: InferSelectResult | null; + }, + Error, + InitEmptyRepoVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.initEmptyRepo(), + mutationFn: (variables: InitEmptyRepoVariables) => + getClient() + .mutation.initEmptyRepo(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useInsertNodeAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useInsertNodeAtPathMutation.ts new file mode 100644 index 0000000000..9da7a1bd56 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useInsertNodeAtPathMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for insertNodeAtPath + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { InsertNodeAtPathVariables } from '../../orm/mutation'; +import type { InsertNodeAtPathPayloadSelect, InsertNodeAtPathPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { InsertNodeAtPathVariables } from '../../orm/mutation'; +export type { InsertNodeAtPathPayloadSelect } from '../../orm/input-types'; +export function useInsertNodeAtPathMutation( + params: { + selection: { + fields: S & InsertNodeAtPathPayloadSelect; + } & HookStrictSelect, InsertNodeAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + insertNodeAtPath: InferSelectResult | null; + }, + Error, + InsertNodeAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + insertNodeAtPath: InferSelectResult | null; + }, + Error, + InsertNodeAtPathVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.insertNodeAtPath(), + mutationFn: (variables: InsertNodeAtPathVariables) => + getClient() + .mutation.insertNodeAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useProvisionBucketMutation.ts new file mode 100644 index 0000000000..2613680e69 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useProvisionBucketMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for provisionBucket + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.provisionBucket(), + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useSaveGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useSaveGraphMutation.ts new file mode 100644 index 0000000000..83f1a5d1d8 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useSaveGraphMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for saveGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { SaveGraphVariables } from '../../orm/mutation'; +import type { SaveGraphPayloadSelect, SaveGraphPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SaveGraphVariables } from '../../orm/mutation'; +export type { SaveGraphPayloadSelect } from '../../orm/input-types'; +export function useSaveGraphMutation( + params: { + selection: { + fields: S & SaveGraphPayloadSelect; + } & HookStrictSelect, SaveGraphPayloadSelect>; + } & Omit< + UseMutationOptions< + { + saveGraph: InferSelectResult | null; + }, + Error, + SaveGraphVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + saveGraph: InferSelectResult | null; + }, + Error, + SaveGraphVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.saveGraph(), + mutationFn: (variables: SaveGraphVariables) => + getClient() + .mutation.saveGraph(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useSetDataAtPathMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useSetDataAtPathMutation.ts new file mode 100644 index 0000000000..63f39667a0 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useSetDataAtPathMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for setDataAtPath + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { SetDataAtPathVariables } from '../../orm/mutation'; +import type { SetDataAtPathPayloadSelect, SetDataAtPathPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { SetDataAtPathVariables } from '../../orm/mutation'; +export type { SetDataAtPathPayloadSelect } from '../../orm/input-types'; +export function useSetDataAtPathMutation( + params: { + selection: { + fields: S & SetDataAtPathPayloadSelect; + } & HookStrictSelect, SetDataAtPathPayloadSelect>; + } & Omit< + UseMutationOptions< + { + setDataAtPath: InferSelectResult | null; + }, + Error, + SetDataAtPathVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + setDataAtPath: InferSelectResult | null; + }, + Error, + SetDataAtPathVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.setDataAtPath(), + mutationFn: (variables: SetDataAtPathVariables) => + getClient() + .mutation.setDataAtPath(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useStartExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useStartExecutionMutation.ts new file mode 100644 index 0000000000..04c6c2cbef --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useStartExecutionMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for startExecution + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { StartExecutionVariables } from '../../orm/mutation'; +import type { StartExecutionPayloadSelect, StartExecutionPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { StartExecutionVariables } from '../../orm/mutation'; +export type { StartExecutionPayloadSelect } from '../../orm/input-types'; +export function useStartExecutionMutation( + params: { + selection: { + fields: S & StartExecutionPayloadSelect; + } & HookStrictSelect, StartExecutionPayloadSelect>; + } & Omit< + UseMutationOptions< + { + startExecution: InferSelectResult | null; + }, + Error, + StartExecutionVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + startExecution: InferSelectResult | null; + }, + Error, + StartExecutionVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.startExecution(), + mutationFn: (variables: StartExecutionVariables) => + getClient() + .mutation.startExecution(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionApiBindingMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionApiBindingMutation.ts new file mode 100644 index 0000000000..22b65cd5ff --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionApiBindingMutation.ts @@ -0,0 +1,116 @@ +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import { functionApiBindingMutationKeys } from '../mutation-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingPatch, +} from '../../orm/input-types'; +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionApiBindingMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionApiBindingPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionApiBindingMutation( + params: { + selection: { + fields: S & FunctionApiBindingSelect; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }, + Error, + { + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; + } +>; +export function useUpdateFunctionApiBindingMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionApiBindingMutationKeys.all, + mutationFn: ({ + id, + functionApiBindingPatch, + }: { + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; + }) => + getClient() + .functionApiBinding.update({ + where: { + id, + }, + data: functionApiBindingPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionApiBindingKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDefinitionMutation.ts new file mode 100644 index 0000000000..948cd642cc --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDefinitionMutation.ts @@ -0,0 +1,116 @@ +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import { functionDefinitionMutationKeys } from '../mutation-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionPatch, +} from '../../orm/input-types'; +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionDefinitionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionDefinitionPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionDefinitionMutation( + params: { + selection: { + fields: S & FunctionDefinitionSelect; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; + } +>; +export function useUpdateFunctionDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDefinitionMutationKeys.all, + mutationFn: ({ + id, + functionDefinitionPatch, + }: { + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; + }) => + getClient() + .functionDefinition.update({ + where: { + id, + }, + data: functionDefinitionPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentEventMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentEventMutation.ts new file mode 100644 index 0000000000..7ff147d922 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentEventMutation.ts @@ -0,0 +1,122 @@ +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import { functionDeploymentEventMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventPatch, +} from '../../orm/input-types'; +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionDeploymentEventMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionDeploymentEventPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionDeploymentEventMutation( + params: { + selection: { + fields: S & FunctionDeploymentEventSelect; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; + } +>; +export function useUpdateFunctionDeploymentEventMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentEventMutationKeys.all, + mutationFn: ({ + id, + createdAt, + functionDeploymentEventPatch, + }: { + id: string; + createdAt: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; + }) => + getClient() + .functionDeploymentEvent.update({ + where: { + id, + createdAt, + }, + data: functionDeploymentEventPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDeploymentEventKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentMutation.ts new file mode 100644 index 0000000000..fcf6de4820 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionDeploymentMutation.ts @@ -0,0 +1,116 @@ +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import { functionDeploymentMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentPatch, +} from '../../orm/input-types'; +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionDeploymentMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionDeploymentPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionDeploymentMutation( + params: { + selection: { + fields: S & FunctionDeploymentSelect; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; + } +>; +export function useUpdateFunctionDeploymentMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentMutationKeys.all, + mutationFn: ({ + id, + functionDeploymentPatch, + }: { + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; + }) => + getClient() + .functionDeployment.update({ + where: { + id, + }, + data: functionDeploymentPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDeploymentKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionExecutionLogMutation.ts new file mode 100644 index 0000000000..98d04bfe4f --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionExecutionLogMutation.ts @@ -0,0 +1,122 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import { functionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogPatch, +} from '../../orm/input-types'; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionExecutionLogMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionExecutionLogPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionExecutionLogMutation( + params: { + selection: { + fields: S & FunctionExecutionLogSelect; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; + } +>; +export function useUpdateFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionExecutionLogMutationKeys.all, + mutationFn: ({ + id, + createdAt, + functionExecutionLogPatch, + }: { + id: string; + createdAt: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; + }) => + getClient() + .functionExecutionLog.update({ + where: { + id, + createdAt, + }, + data: functionExecutionLogPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionExecutionLogKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphCommitMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphCommitMutation.ts new file mode 100644 index 0000000000..92153e5fdd --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphCommitMutation.ts @@ -0,0 +1,122 @@ +/** + * Commit history — each commit snapshots a tree root for a store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import { functionGraphCommitMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitPatch, +} from '../../orm/input-types'; +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphCommitMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphCommitPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphCommitMutation( + params: { + selection: { + fields: S & FunctionGraphCommitSelect; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; + } +>; +export function useUpdateFunctionGraphCommitMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphCommitMutationKeys.all, + mutationFn: ({ + id, + databaseId, + functionGraphCommitPatch, + }: { + id: string; + databaseId: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; + }) => + getClient() + .functionGraphCommit.update({ + where: { + id, + databaseId, + }, + data: functionGraphCommitPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphCommitKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionMutation.ts new file mode 100644 index 0000000000..f01629e070 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionMutation.ts @@ -0,0 +1,122 @@ +/** + * Ephemeral execution state for flow graph evaluation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import { functionGraphExecutionMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionPatch, +} from '../../orm/input-types'; +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphExecutionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphExecutionPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphExecutionMutation( + params: { + selection: { + fields: S & FunctionGraphExecutionSelect; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }, + Error, + { + id: string; + startedAt: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; + } +>; +export function useUpdateFunctionGraphExecutionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + startedAt: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionMutationKeys.all, + mutationFn: ({ + id, + startedAt, + functionGraphExecutionPatch, + }: { + id: string; + startedAt: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; + }) => + getClient() + .functionGraphExecution.update({ + where: { + id, + startedAt, + }, + data: functionGraphExecutionPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionNodeStateMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionNodeStateMutation.ts new file mode 100644 index 0000000000..d3ab51e70f --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionNodeStateMutation.ts @@ -0,0 +1,130 @@ +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import { functionGraphExecutionNodeStateMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStatePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStatePatch, +} from '../../orm/input-types'; +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphExecutionNodeStateMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphExecutionNodeStatePatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphExecutionNodeStateMutation< + S extends FunctionGraphExecutionNodeStateSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionNodeStateSelect; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; + } +>; +export function useUpdateFunctionGraphExecutionNodeStateMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionNodeStateMutationKeys.all, + mutationFn: ({ + id, + createdAt, + functionGraphExecutionNodeStatePatch, + }: { + id: string; + createdAt: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; + }) => + getClient() + .functionGraphExecutionNodeState.update({ + where: { + id, + createdAt, + }, + data: functionGraphExecutionNodeStatePatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionNodeStateKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionOutputMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionOutputMutation.ts new file mode 100644 index 0000000000..3ac4ce3664 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphExecutionOutputMutation.ts @@ -0,0 +1,127 @@ +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import { functionGraphExecutionOutputMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputPatch, +} from '../../orm/input-types'; +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphExecutionOutputMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphExecutionOutputPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphExecutionOutputMutation< + S extends FunctionGraphExecutionOutputSelect, +>( + params: { + selection: { + fields: S & FunctionGraphExecutionOutputSelect; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + >; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; + } +>; +export function useUpdateFunctionGraphExecutionOutputMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphExecutionOutputMutationKeys.all, + mutationFn: ({ + id, + createdAt, + functionGraphExecutionOutputPatch, + }: { + id: string; + createdAt: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; + }) => + getClient() + .functionGraphExecutionOutput.update({ + where: { + id, + createdAt, + }, + data: functionGraphExecutionOutputPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphExecutionOutputKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphMutation.ts new file mode 100644 index 0000000000..149459636f --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphMutation.ts @@ -0,0 +1,116 @@ +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import { functionGraphMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphPatch, +} from '../../orm/input-types'; +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphMutation( + params: { + selection: { + fields: S & FunctionGraphSelect; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphPatch: FunctionGraphPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraph: { + functionGraph: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphPatch: FunctionGraphPatch; + } +>; +export function useUpdateFunctionGraphMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionGraphPatch: FunctionGraphPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphMutationKeys.all, + mutationFn: ({ + id, + functionGraphPatch, + }: { + id: string; + functionGraphPatch: FunctionGraphPatch; + }) => + getClient() + .functionGraph.update({ + where: { + id, + }, + data: functionGraphPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphObjectMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphObjectMutation.ts new file mode 100644 index 0000000000..fcdd9aedc8 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphObjectMutation.ts @@ -0,0 +1,122 @@ +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import { functionGraphObjectMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectPatch, +} from '../../orm/input-types'; +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphObjectMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphObjectPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphObjectMutation( + params: { + selection: { + fields: S & FunctionGraphObjectSelect; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; + } +>; +export function useUpdateFunctionGraphObjectMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphObjectMutationKeys.all, + mutationFn: ({ + id, + databaseId, + functionGraphObjectPatch, + }: { + id: string; + databaseId: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; + }) => + getClient() + .functionGraphObject.update({ + where: { + id, + databaseId, + }, + data: functionGraphObjectPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphObjectKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphRefMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphRefMutation.ts new file mode 100644 index 0000000000..2cdd0eb346 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphRefMutation.ts @@ -0,0 +1,122 @@ +/** + * Branch heads — mutable pointers into the commit chain + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import { functionGraphRefMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefPatch, +} from '../../orm/input-types'; +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphRefMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphRefPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphRefMutation( + params: { + selection: { + fields: S & FunctionGraphRefSelect; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + functionGraphRefPatch: FunctionGraphRefPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }, + Error, + { + id: string; + databaseId: string; + functionGraphRefPatch: FunctionGraphRefPatch; + } +>; +export function useUpdateFunctionGraphRefMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + databaseId: string; + functionGraphRefPatch: FunctionGraphRefPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphRefMutationKeys.all, + mutationFn: ({ + id, + databaseId, + functionGraphRefPatch, + }: { + id: string; + databaseId: string; + functionGraphRefPatch: FunctionGraphRefPatch; + }) => + getClient() + .functionGraphRef.update({ + where: { + id, + databaseId, + }, + data: functionGraphRefPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphRefKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphStoreMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphStoreMutation.ts new file mode 100644 index 0000000000..5f57880f0a --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionGraphStoreMutation.ts @@ -0,0 +1,116 @@ +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import { functionGraphStoreMutationKeys } from '../mutation-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStorePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStorePatch, +} from '../../orm/input-types'; +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionGraphStoreMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionGraphStorePatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionGraphStoreMutation( + params: { + selection: { + fields: S & FunctionGraphStoreSelect; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }, + Error, + { + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; + } +>; +export function useUpdateFunctionGraphStoreMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionGraphStoreMutationKeys.all, + mutationFn: ({ + id, + functionGraphStorePatch, + }: { + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; + }) => + getClient() + .functionGraphStore.update({ + where: { + id, + }, + data: functionGraphStorePatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionGraphStoreKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationMutation.ts new file mode 100644 index 0000000000..0fad5e70fe --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateFunctionInvocationMutation.ts @@ -0,0 +1,122 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import { functionInvocationMutationKeys } from '../mutation-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationPatch, +} from '../../orm/input-types'; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionInvocationMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionInvocationPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionInvocationMutation( + params: { + selection: { + fields: S & FunctionInvocationSelect; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionInvocationPatch: FunctionInvocationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + functionInvocationPatch: FunctionInvocationPatch; + } +>; +export function useUpdateFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + functionInvocationPatch: FunctionInvocationPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionInvocationMutationKeys.all, + mutationFn: ({ + id, + createdAt, + functionInvocationPatch, + }: { + id: string; + createdAt: string; + functionInvocationPatch: FunctionInvocationPatch; + }) => + getClient() + .functionInvocation.update({ + where: { + id, + createdAt, + }, + data: functionInvocationPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionInvocationKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateOrgFunctionExecutionLogMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateOrgFunctionExecutionLogMutation.ts new file mode 100644 index 0000000000..a4efcd6adb --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateOrgFunctionExecutionLogMutation.ts @@ -0,0 +1,122 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionExecutionLogKeys } from '../query-keys'; +import { orgFunctionExecutionLogMutationKeys } from '../mutation-keys'; +import type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, + OrgFunctionExecutionLogPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, + OrgFunctionExecutionLogPatch, +} from '../../orm/input-types'; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateOrgFunctionExecutionLogMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', orgFunctionExecutionLogPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateOrgFunctionExecutionLogMutation( + params: { + selection: { + fields: S & OrgFunctionExecutionLogSelect; + } & HookStrictSelect, OrgFunctionExecutionLogSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; + } +>; +export function useUpdateOrgFunctionExecutionLogMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: orgFunctionExecutionLogMutationKeys.all, + mutationFn: ({ + id, + createdAt, + orgFunctionExecutionLogPatch, + }: { + id: string; + createdAt: string; + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; + }) => + getClient() + .orgFunctionExecutionLog.update({ + where: { + id, + createdAt, + }, + data: orgFunctionExecutionLogPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: orgFunctionExecutionLogKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: orgFunctionExecutionLogKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateOrgFunctionInvocationMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateOrgFunctionInvocationMutation.ts new file mode 100644 index 0000000000..2a1bd3ff22 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateOrgFunctionInvocationMutation.ts @@ -0,0 +1,122 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionInvocationKeys } from '../query-keys'; +import { orgFunctionInvocationMutationKeys } from '../mutation-keys'; +import type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, + OrgFunctionInvocationPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, + OrgFunctionInvocationPatch, +} from '../../orm/input-types'; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateOrgFunctionInvocationMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', orgFunctionInvocationPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateOrgFunctionInvocationMutation( + params: { + selection: { + fields: S & OrgFunctionInvocationSelect; + } & HookStrictSelect, OrgFunctionInvocationSelect>; + } & Omit< + UseMutationOptions< + { + updateOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }, + Error, + { + id: string; + createdAt: string; + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; + } +>; +export function useUpdateOrgFunctionInvocationMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + createdAt: string; + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: orgFunctionInvocationMutationKeys.all, + mutationFn: ({ + id, + createdAt, + orgFunctionInvocationPatch, + }: { + id: string; + createdAt: string; + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; + }) => + getClient() + .orgFunctionInvocation.update({ + where: { + id, + createdAt, + }, + data: orgFunctionInvocationPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: orgFunctionInvocationKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: orgFunctionInvocationKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useUpdateSecretDefinitionMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateSecretDefinitionMutation.ts new file mode 100644 index 0000000000..129a8c9506 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useUpdateSecretDefinitionMutation.ts @@ -0,0 +1,116 @@ +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { secretDefinitionKeys } from '../query-keys'; +import { secretDefinitionMutationKeys } from '../mutation-keys'; +import type { + SecretDefinitionSelect, + SecretDefinitionWithRelations, + SecretDefinitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + SecretDefinitionSelect, + SecretDefinitionWithRelations, + SecretDefinitionPatch, +} from '../../orm/input-types'; +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateSecretDefinitionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', secretDefinitionPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateSecretDefinitionMutation( + params: { + selection: { + fields: S & SecretDefinitionSelect; + } & HookStrictSelect, SecretDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + updateSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + secretDefinitionPatch: SecretDefinitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + secretDefinitionPatch: SecretDefinitionPatch; + } +>; +export function useUpdateSecretDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + secretDefinitionPatch: SecretDefinitionPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: secretDefinitionMutationKeys.all, + mutationFn: ({ + id, + secretDefinitionPatch, + }: { + id: string; + secretDefinitionPatch: SecretDefinitionPatch; + }) => + getClient() + .secretDefinition.update({ + where: { + id, + }, + data: secretDefinitionPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: secretDefinitionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: secretDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/mutations/useValidateFunctionGraphMutation.ts b/sdk/constructive-react/src/compute/hooks/mutations/useValidateFunctionGraphMutation.ts new file mode 100644 index 0000000000..c6cd62a410 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/mutations/useValidateFunctionGraphMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for validateFunctionGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ValidateFunctionGraphVariables } from '../../orm/mutation'; +import type { + ValidateFunctionGraphPayloadSelect, + ValidateFunctionGraphPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ValidateFunctionGraphVariables } from '../../orm/mutation'; +export type { ValidateFunctionGraphPayloadSelect } from '../../orm/input-types'; +export function useValidateFunctionGraphMutation( + params: { + selection: { + fields: S & ValidateFunctionGraphPayloadSelect; + } & HookStrictSelect, ValidateFunctionGraphPayloadSelect>; + } & Omit< + UseMutationOptions< + { + validateFunctionGraph: InferSelectResult | null; + }, + Error, + ValidateFunctionGraphVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + validateFunctionGraph: InferSelectResult | null; + }, + Error, + ValidateFunctionGraphVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.validateFunctionGraph(), + mutationFn: (variables: ValidateFunctionGraphVariables) => + getClient() + .mutation.validateFunctionGraph(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/index.ts b/sdk/constructive-react/src/compute/hooks/queries/index.ts new file mode 100644 index 0000000000..b4221dda67 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/index.ts @@ -0,0 +1,41 @@ +/** + * Query hooks barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export * from './useGetAllQuery'; +export * from './useFunctionApiBindingsQuery'; +export * from './useFunctionApiBindingQuery'; +export * from './useFunctionDeploymentsQuery'; +export * from './useFunctionDeploymentQuery'; +export * from './useFunctionGraphRefsQuery'; +export * from './useFunctionGraphRefQuery'; +export * from './useFunctionGraphStoresQuery'; +export * from './useFunctionGraphStoreQuery'; +export * from './useFunctionGraphObjectsQuery'; +export * from './useFunctionGraphObjectQuery'; +export * from './useFunctionDeploymentEventsQuery'; +export * from './useFunctionDeploymentEventQuery'; +export * from './useOrgFunctionExecutionLogsQuery'; +export * from './useOrgFunctionExecutionLogQuery'; +export * from './useFunctionGraphExecutionOutputsQuery'; +export * from './useFunctionGraphExecutionOutputQuery'; +export * from './useFunctionGraphCommitsQuery'; +export * from './useFunctionGraphCommitQuery'; +export * from './useSecretDefinitionsQuery'; +export * from './useSecretDefinitionQuery'; +export * from './useFunctionExecutionLogsQuery'; +export * from './useFunctionExecutionLogQuery'; +export * from './useFunctionGraphExecutionNodeStatesQuery'; +export * from './useFunctionGraphExecutionNodeStateQuery'; +export * from './useFunctionGraphsQuery'; +export * from './useFunctionGraphQuery'; +export * from './useOrgFunctionInvocationsQuery'; +export * from './useOrgFunctionInvocationQuery'; +export * from './useFunctionInvocationsQuery'; +export * from './useFunctionInvocationQuery'; +export * from './useFunctionGraphExecutionsQuery'; +export * from './useFunctionGraphExecutionQuery'; +export * from './useFunctionDefinitionsQuery'; +export * from './useFunctionDefinitionQuery'; +export * from './useReadFunctionGraphQuery'; diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingQuery.ts new file mode 100644 index 0000000000..b0a007026e --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingQuery.ts @@ -0,0 +1,144 @@ +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionApiBindingQueryKey = functionApiBindingKeys.detail; +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionApiBindingQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionApiBindingQuery< + S extends FunctionApiBindingSelect, + TData = { + functionApiBinding: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseQueryOptions< + { + functionApiBinding: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionApiBindingQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionApiBindingKeys.detail(params.id), + queryFn: () => + getClient() + .functionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```ts + * const data = await fetchFunctionApiBindingQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionApiBindingQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionApiBindingSelect>; +}): Promise<{ + functionApiBinding: InferSelectResult | null; +}>; +export async function fetchFunctionApiBindingQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```ts + * await prefetchFunctionApiBindingQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionApiBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionApiBindingSelect>; + } +): Promise; +export async function prefetchFunctionApiBindingQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionApiBindingKeys.detail(params.id), + queryFn: () => + getClient() + .functionApiBinding.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingsQuery.ts new file mode 100644 index 0000000000..778b7f6daf --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionApiBindingsQuery.ts @@ -0,0 +1,171 @@ +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionApiBindingKeys } from '../query-keys'; +import type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionApiBindingSelect, + FunctionApiBindingWithRelations, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionApiBindingsQueryKey = functionApiBindingKeys.list; +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionApiBindingsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionApiBindingsQuery< + S extends FunctionApiBindingSelect, + TData = { + functionApiBindings: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionApiBindingSelect>; + } & Omit< + UseQueryOptions< + { + functionApiBindings: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionApiBindingsQuery( + params: { + selection: ListSelectionConfig< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionApiBindingKeys.list(args), + queryFn: () => getClient().functionApiBinding.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```ts + * const data = await fetchFunctionApiBindingsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionApiBindingsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionApiBindingSelect>; +}): Promise<{ + functionApiBindings: ConnectionResult>; +}>; +export async function fetchFunctionApiBindingsQuery(params: { + selection: ListSelectionConfig< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >(params.selection); + return getClient().functionApiBinding.findMany(args).unwrap(); +} +/** + * Join table binding function definitions to API endpoints with per-binding alias and config + * + * @example + * ```ts + * await prefetchFunctionApiBindingsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionApiBindingsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionApiBindingSelect>; + } +): Promise; +export async function prefetchFunctionApiBindingsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionApiBindingKeys.list(args), + queryFn: () => getClient().functionApiBinding.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionQuery.ts new file mode 100644 index 0000000000..c6d10b7109 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionQuery.ts @@ -0,0 +1,144 @@ +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDefinitionQueryKey = functionDefinitionKeys.detail; +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDefinitionQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionDefinitionQuery< + S extends FunctionDefinitionSelect, + TData = { + functionDefinition: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + functionDefinition: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDefinitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDefinitionKeys.detail(params.id), + queryFn: () => + getClient() + .functionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```ts + * const data = await fetchFunctionDefinitionQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionDefinitionQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDefinitionSelect>; +}): Promise<{ + functionDefinition: InferSelectResult | null; +}>; +export async function fetchFunctionDefinitionQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```ts + * await prefetchFunctionDefinitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDefinitionSelect>; + } +): Promise; +export async function prefetchFunctionDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDefinitionKeys.detail(params.id), + queryFn: () => + getClient() + .functionDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionsQuery.ts new file mode 100644 index 0000000000..5087f1f27a --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDefinitionsQuery.ts @@ -0,0 +1,171 @@ +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDefinitionKeys } from '../query-keys'; +import type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDefinitionSelect, + FunctionDefinitionWithRelations, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDefinitionsQueryKey = functionDefinitionKeys.list; +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDefinitionsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionDefinitionsQuery< + S extends FunctionDefinitionSelect, + TData = { + functionDefinitions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + functionDefinitions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDefinitionsQuery( + params: { + selection: ListSelectionConfig< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDefinitionKeys.list(args), + queryFn: () => getClient().functionDefinition.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```ts + * const data = await fetchFunctionDefinitionsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionDefinitionsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionDefinitionSelect>; +}): Promise<{ + functionDefinitions: ConnectionResult>; +}>; +export async function fetchFunctionDefinitionsQuery(params: { + selection: ListSelectionConfig< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >(params.selection); + return getClient().functionDefinition.findMany(args).unwrap(); +} +/** + * Function definitions — registered cloud functions with routing, queue, and retry configuration + * + * @example + * ```ts + * await prefetchFunctionDefinitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDefinitionSelect>; + } +): Promise; +export async function prefetchFunctionDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDefinitionKeys.list(args), + queryFn: () => getClient().functionDefinition.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventQuery.ts new file mode 100644 index 0000000000..8eaed05c76 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventQuery.ts @@ -0,0 +1,146 @@ +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDeploymentEventQueryKey = functionDeploymentEventKeys.detail; +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDeploymentEventQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionDeploymentEventQuery< + S extends FunctionDeploymentEventSelect, + TData = { + functionDeploymentEvent: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentEvent: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentEventQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDeploymentEventKeys.detail(params.id), + queryFn: () => + getClient() + .functionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```ts + * const data = await fetchFunctionDeploymentEventQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionDeploymentEventQuery< + S extends FunctionDeploymentEventSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentEventSelect>; +}): Promise<{ + functionDeploymentEvent: InferSelectResult | null; +}>; +export async function fetchFunctionDeploymentEventQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```ts + * await prefetchFunctionDeploymentEventQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionDeploymentEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentEventSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentEventQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDeploymentEventKeys.detail(params.id), + queryFn: () => + getClient() + .functionDeploymentEvent.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventsQuery.ts new file mode 100644 index 0000000000..a2f06adeb7 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentEventsQuery.ts @@ -0,0 +1,182 @@ +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDeploymentEventKeys } from '../query-keys'; +import type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDeploymentEventSelect, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDeploymentEventsQueryKey = functionDeploymentEventKeys.list; +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDeploymentEventsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionDeploymentEventsQuery< + S extends FunctionDeploymentEventSelect, + TData = { + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentEventSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentEventsQuery( + params: { + selection: ListSelectionConfig< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDeploymentEventKeys.list(args), + queryFn: () => getClient().functionDeploymentEvent.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```ts + * const data = await fetchFunctionDeploymentEventsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionDeploymentEventsQuery< + S extends FunctionDeploymentEventSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentEventSelect>; +}): Promise<{ + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchFunctionDeploymentEventsQuery(params: { + selection: ListSelectionConfig< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >(params.selection); + return getClient().functionDeploymentEvent.findMany(args).unwrap(); +} +/** + * Deployment lifecycle events — audit log of provisioning, scaling, and failure events + * + * @example + * ```ts + * await prefetchFunctionDeploymentEventsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionDeploymentEventsQuery< + S extends FunctionDeploymentEventSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentEventSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentEventsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDeploymentEventKeys.list(args), + queryFn: () => getClient().functionDeploymentEvent.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentQuery.ts new file mode 100644 index 0000000000..4aeed8eb0f --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentQuery.ts @@ -0,0 +1,144 @@ +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDeploymentQueryKey = functionDeploymentKeys.detail; +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDeploymentQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionDeploymentQuery< + S extends FunctionDeploymentSelect, + TData = { + functionDeployment: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseQueryOptions< + { + functionDeployment: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDeploymentKeys.detail(params.id), + queryFn: () => + getClient() + .functionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```ts + * const data = await fetchFunctionDeploymentQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionDeploymentQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentSelect>; +}): Promise<{ + functionDeployment: InferSelectResult | null; +}>; +export async function fetchFunctionDeploymentQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```ts + * await prefetchFunctionDeploymentQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionDeploymentQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDeploymentKeys.detail(params.id), + queryFn: () => + getClient() + .functionDeployment.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentsQuery.ts new file mode 100644 index 0000000000..7715eb263f --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionDeploymentsQuery.ts @@ -0,0 +1,171 @@ +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDeploymentKeys } from '../query-keys'; +import type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDeploymentSelect, + FunctionDeploymentWithRelations, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDeploymentsQueryKey = functionDeploymentKeys.list; +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDeploymentsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionDeploymentsQuery< + S extends FunctionDeploymentSelect, + TData = { + functionDeployments: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentSelect>; + } & Omit< + UseQueryOptions< + { + functionDeployments: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentsQuery( + params: { + selection: ListSelectionConfig< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDeploymentKeys.list(args), + queryFn: () => getClient().functionDeployment.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```ts + * const data = await fetchFunctionDeploymentsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionDeploymentsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionDeploymentSelect>; +}): Promise<{ + functionDeployments: ConnectionResult>; +}>; +export async function fetchFunctionDeploymentsQuery(params: { + selection: ListSelectionConfig< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >(params.selection); + return getClient().functionDeployment.findMany(args).unwrap(); +} +/** + * Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing + * + * @example + * ```ts + * await prefetchFunctionDeploymentsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionDeploymentsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDeploymentKeys.list(args), + queryFn: () => getClient().functionDeployment.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogQuery.ts new file mode 100644 index 0000000000..074fef50e0 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogQuery.ts @@ -0,0 +1,144 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionExecutionLogQueryKey = functionExecutionLogKeys.detail; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionExecutionLogQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionExecutionLogQuery< + S extends FunctionExecutionLogSelect, + TData = { + functionExecutionLog: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + functionExecutionLog: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionExecutionLogQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionExecutionLogKeys.detail(params.id), + queryFn: () => + getClient() + .functionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * const data = await fetchFunctionExecutionLogQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionExecutionLogQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionExecutionLogSelect>; +}): Promise<{ + functionExecutionLog: InferSelectResult | null; +}>; +export async function fetchFunctionExecutionLogQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * await prefetchFunctionExecutionLogQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionExecutionLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchFunctionExecutionLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionExecutionLogKeys.detail(params.id), + queryFn: () => + getClient() + .functionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogsQuery.ts new file mode 100644 index 0000000000..b76b950fa5 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionExecutionLogsQuery.ts @@ -0,0 +1,178 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionExecutionLogKeys } from '../query-keys'; +import type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionExecutionLogSelect, + FunctionExecutionLogWithRelations, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionExecutionLogsQueryKey = functionExecutionLogKeys.list; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionExecutionLogsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionExecutionLogsQuery< + S extends FunctionExecutionLogSelect, + TData = { + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionExecutionLogsQuery( + params: { + selection: ListSelectionConfig< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionExecutionLogKeys.list(args), + queryFn: () => getClient().functionExecutionLog.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * const data = await fetchFunctionExecutionLogsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionExecutionLogsQuery< + S extends FunctionExecutionLogSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionExecutionLogSelect>; +}): Promise<{ + functionExecutionLogs: ConnectionResult>; +}>; +export async function fetchFunctionExecutionLogsQuery(params: { + selection: ListSelectionConfig< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >(params.selection); + return getClient().functionExecutionLog.findMany(args).unwrap(); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * await prefetchFunctionExecutionLogsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionExecutionLogsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchFunctionExecutionLogsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionExecutionLogKeys.list(args), + queryFn: () => getClient().functionExecutionLog.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitQuery.ts new file mode 100644 index 0000000000..f96a53deff --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitQuery.ts @@ -0,0 +1,144 @@ +/** + * Commit history — each commit snapshots a tree root for a store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphCommitQueryKey = functionGraphCommitKeys.detail; +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphCommitQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphCommitQuery< + S extends FunctionGraphCommitSelect, + TData = { + functionGraphCommit: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphCommit: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphCommitQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphCommitKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```ts + * const data = await fetchFunctionGraphCommitQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphCommitQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphCommitSelect>; +}): Promise<{ + functionGraphCommit: InferSelectResult | null; +}>; +export async function fetchFunctionGraphCommitQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraphCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```ts + * await prefetchFunctionGraphCommitQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphCommitSelect>; + } +): Promise; +export async function prefetchFunctionGraphCommitQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphCommitKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphCommit.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitsQuery.ts new file mode 100644 index 0000000000..ce85d7e246 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphCommitsQuery.ts @@ -0,0 +1,174 @@ +/** + * Commit history — each commit snapshots a tree root for a store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphCommitKeys } from '../query-keys'; +import type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphCommitSelect, + FunctionGraphCommitWithRelations, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphCommitsQueryKey = functionGraphCommitKeys.list; +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphCommitsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphCommitsQuery< + S extends FunctionGraphCommitSelect, + TData = { + functionGraphCommits: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphCommitSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphCommits: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphCommitsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphCommitKeys.list(args), + queryFn: () => getClient().functionGraphCommit.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```ts + * const data = await fetchFunctionGraphCommitsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphCommitsQuery(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphCommitSelect>; +}): Promise<{ + functionGraphCommits: ConnectionResult>; +}>; +export async function fetchFunctionGraphCommitsQuery(params: { + selection: ListSelectionConfig< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >(params.selection); + return getClient().functionGraphCommit.findMany(args).unwrap(); +} +/** + * Commit history — each commit snapshots a tree root for a store + * + * @example + * ```ts + * await prefetchFunctionGraphCommitsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphCommitsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphCommitSelect>; + } +): Promise; +export async function prefetchFunctionGraphCommitsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphCommitKeys.list(args), + queryFn: () => getClient().functionGraphCommit.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStateQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStateQuery.ts new file mode 100644 index 0000000000..c782b92ef3 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStateQuery.ts @@ -0,0 +1,157 @@ +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphExecutionNodeStateQueryKey = functionGraphExecutionNodeStateKeys.detail; +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphExecutionNodeStateQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphExecutionNodeStateQuery< + S extends FunctionGraphExecutionNodeStateSelect, + TData = { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionNodeStateQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphExecutionNodeStateKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphExecutionNodeState.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```ts + * const data = await fetchFunctionGraphExecutionNodeStateQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphExecutionNodeStateQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; +}): Promise<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; +}>; +export async function fetchFunctionGraphExecutionNodeStateQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraphExecutionNodeState.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```ts + * await prefetchFunctionGraphExecutionNodeStateQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphExecutionNodeStateQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionNodeStateQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphExecutionNodeStateKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphExecutionNodeState.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStatesQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStatesQuery.ts new file mode 100644 index 0000000000..5240e30f9e --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionNodeStatesQuery.ts @@ -0,0 +1,194 @@ +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphExecutionNodeStateKeys } from '../query-keys'; +import type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphExecutionNodeStatesQueryKey = functionGraphExecutionNodeStateKeys.list; +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphExecutionNodeStatesQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphExecutionNodeStatesQuery< + S extends FunctionGraphExecutionNodeStateSelect, + TData = { + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionNodeStatesQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphExecutionNodeStateKeys.list(args), + queryFn: () => getClient().functionGraphExecutionNodeState.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```ts + * const data = await fetchFunctionGraphExecutionNodeStatesQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphExecutionNodeStatesQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; +}): Promise<{ + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchFunctionGraphExecutionNodeStatesQuery(params: { + selection: ListSelectionConfig< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >(params.selection); + return getClient().functionGraphExecutionNodeState.findMany(args).unwrap(); +} +/** + * Per-node execution state — tracks individual node lifecycle for debugging + * + * @example + * ```ts + * await prefetchFunctionGraphExecutionNodeStatesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphExecutionNodeStatesQuery< + S extends FunctionGraphExecutionNodeStateSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionNodeStatesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphExecutionNodeStateKeys.list(args), + queryFn: () => getClient().functionGraphExecutionNodeState.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputQuery.ts new file mode 100644 index 0000000000..0ec4a9114f --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputQuery.ts @@ -0,0 +1,157 @@ +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphExecutionOutputQueryKey = functionGraphExecutionOutputKeys.detail; +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphExecutionOutputQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphExecutionOutputQuery< + S extends FunctionGraphExecutionOutputSelect, + TData = { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionOutputQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphExecutionOutputKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphExecutionOutput.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```ts + * const data = await fetchFunctionGraphExecutionOutputQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphExecutionOutputQuery< + S extends FunctionGraphExecutionOutputSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; +}): Promise<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; +}>; +export async function fetchFunctionGraphExecutionOutputQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraphExecutionOutput.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```ts + * await prefetchFunctionGraphExecutionOutputQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphExecutionOutputQuery< + S extends FunctionGraphExecutionOutputSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionOutputQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphExecutionOutputKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphExecutionOutput.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputsQuery.ts new file mode 100644 index 0000000000..79ee1cf117 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionOutputsQuery.ts @@ -0,0 +1,190 @@ +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphExecutionOutputKeys } from '../query-keys'; +import type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphExecutionOutputsQueryKey = functionGraphExecutionOutputKeys.list; +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphExecutionOutputsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphExecutionOutputsQuery< + S extends FunctionGraphExecutionOutputSelect, + TData = { + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionOutputsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphExecutionOutputKeys.list(args), + queryFn: () => getClient().functionGraphExecutionOutput.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```ts + * const data = await fetchFunctionGraphExecutionOutputsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphExecutionOutputsQuery< + S extends FunctionGraphExecutionOutputSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionOutputSelect>; +}): Promise<{ + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchFunctionGraphExecutionOutputsQuery(params: { + selection: ListSelectionConfig< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >(params.selection); + return getClient().functionGraphExecutionOutput.findMany(args).unwrap(); +} +/** + * Content-addressed store for execution outputs — hash-referenced from node_outputs + * + * @example + * ```ts + * await prefetchFunctionGraphExecutionOutputsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphExecutionOutputsQuery< + S extends FunctionGraphExecutionOutputSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionOutputSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionOutputsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphExecutionOutputKeys.list(args), + queryFn: () => getClient().functionGraphExecutionOutput.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionQuery.ts new file mode 100644 index 0000000000..0df800ce67 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionQuery.ts @@ -0,0 +1,146 @@ +/** + * Ephemeral execution state for flow graph evaluation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphExecutionQueryKey = functionGraphExecutionKeys.detail; +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphExecutionQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphExecutionQuery< + S extends FunctionGraphExecutionSelect, + TData = { + functionGraphExecution: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecution: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphExecutionKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphExecution.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```ts + * const data = await fetchFunctionGraphExecutionQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphExecutionQuery< + S extends FunctionGraphExecutionSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionSelect>; +}): Promise<{ + functionGraphExecution: InferSelectResult | null; +}>; +export async function fetchFunctionGraphExecutionQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraphExecution.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```ts + * await prefetchFunctionGraphExecutionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphExecutionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphExecutionSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphExecutionKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphExecution.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionsQuery.ts new file mode 100644 index 0000000000..a8910329fe --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphExecutionsQuery.ts @@ -0,0 +1,180 @@ +/** + * Ephemeral execution state for flow graph evaluation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphExecutionKeys } from '../query-keys'; +import type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphExecutionSelect, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphExecutionsQueryKey = functionGraphExecutionKeys.list; +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphExecutionsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphExecutionsQuery< + S extends FunctionGraphExecutionSelect, + TData = { + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphExecutionsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphExecutionKeys.list(args), + queryFn: () => getClient().functionGraphExecution.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```ts + * const data = await fetchFunctionGraphExecutionsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphExecutionsQuery< + S extends FunctionGraphExecutionSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionSelect>; +}): Promise<{ + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchFunctionGraphExecutionsQuery(params: { + selection: ListSelectionConfig< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >(params.selection); + return getClient().functionGraphExecution.findMany(args).unwrap(); +} +/** + * Ephemeral execution state for flow graph evaluation + * + * @example + * ```ts + * await prefetchFunctionGraphExecutionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphExecutionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphExecutionSelect>; + } +): Promise; +export async function prefetchFunctionGraphExecutionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphExecutionKeys.list(args), + queryFn: () => getClient().functionGraphExecution.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectQuery.ts new file mode 100644 index 0000000000..984d9dfdb1 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectQuery.ts @@ -0,0 +1,144 @@ +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const getNodeAtPathQueryKey = functionGraphObjectKeys.detail; +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphObjectQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphObjectQuery< + S extends FunctionGraphObjectSelect, + TData = { + getNodeAtPath: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseQueryOptions< + { + getNodeAtPath: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphObjectQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphObjectKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```ts + * const data = await fetchFunctionGraphObjectQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphObjectQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphObjectSelect>; +}): Promise<{ + getNodeAtPath: InferSelectResult | null; +}>; +export async function fetchFunctionGraphObjectQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraphObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```ts + * await prefetchFunctionGraphObjectQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphObjectSelect>; + } +): Promise; +export async function prefetchFunctionGraphObjectQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphObjectKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphObject.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectsQuery.ts new file mode 100644 index 0000000000..0582ac5d79 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphObjectsQuery.ts @@ -0,0 +1,174 @@ +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphObjectKeys } from '../query-keys'; +import type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphObjectSelect, + FunctionGraphObjectWithRelations, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphObjectsQueryKey = functionGraphObjectKeys.list; +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphObjectsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphObjectsQuery< + S extends FunctionGraphObjectSelect, + TData = { + functionGraphObjects: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphObjectSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphObjects: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphObjectsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphObjectKeys.list(args), + queryFn: () => getClient().functionGraphObject.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```ts + * const data = await fetchFunctionGraphObjectsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphObjectsQuery(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphObjectSelect>; +}): Promise<{ + functionGraphObjects: ConnectionResult>; +}>; +export async function fetchFunctionGraphObjectsQuery(params: { + selection: ListSelectionConfig< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >(params.selection); + return getClient().functionGraphObject.findMany(args).unwrap(); +} +/** + * Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children + * + * @example + * ```ts + * await prefetchFunctionGraphObjectsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphObjectsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphObjectSelect>; + } +): Promise; +export async function prefetchFunctionGraphObjectsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphObjectKeys.list(args), + queryFn: () => getClient().functionGraphObject.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphQuery.ts new file mode 100644 index 0000000000..7ab189edfa --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphQuery.ts @@ -0,0 +1,138 @@ +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphSelect, FunctionGraphWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphQueryKey = functionGraphKeys.detail; +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphQuery< + S extends FunctionGraphSelect, + TData = { + functionGraph: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseQueryOptions< + { + functionGraph: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraph.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```ts + * const data = await fetchFunctionGraphQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphSelect>; +}): Promise<{ + functionGraph: InferSelectResult | null; +}>; +export async function fetchFunctionGraphQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraph.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```ts + * await prefetchFunctionGraphQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphSelect>; + } +): Promise; +export async function prefetchFunctionGraphQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraph.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefQuery.ts new file mode 100644 index 0000000000..d6b4563bbe --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefQuery.ts @@ -0,0 +1,138 @@ +/** + * Branch heads — mutable pointers into the commit chain + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { FunctionGraphRefSelect, FunctionGraphRefWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphRefQueryKey = functionGraphRefKeys.detail; +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphRefQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphRefQuery< + S extends FunctionGraphRefSelect, + TData = { + functionGraphRef: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphRef: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphRefQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphRefKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```ts + * const data = await fetchFunctionGraphRefQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphRefQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphRefSelect>; +}): Promise<{ + functionGraphRef: InferSelectResult | null; +}>; +export async function fetchFunctionGraphRefQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraphRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```ts + * await prefetchFunctionGraphRefQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphRefSelect>; + } +): Promise; +export async function prefetchFunctionGraphRefQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphRefKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphRef.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefsQuery.ts new file mode 100644 index 0000000000..9180bbfc54 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphRefsQuery.ts @@ -0,0 +1,163 @@ +/** + * Branch heads — mutable pointers into the commit chain + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphRefKeys } from '../query-keys'; +import type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphRefSelect, + FunctionGraphRefWithRelations, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphRefsQueryKey = functionGraphRefKeys.list; +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphRefsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphRefsQuery< + S extends FunctionGraphRefSelect, + TData = { + functionGraphRefs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphRefSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphRefs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphRefsQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphRefKeys.list(args), + queryFn: () => getClient().functionGraphRef.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```ts + * const data = await fetchFunctionGraphRefsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphRefsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphRefSelect>; +}): Promise<{ + functionGraphRefs: ConnectionResult>; +}>; +export async function fetchFunctionGraphRefsQuery(params: { + selection: ListSelectionConfig< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >(params.selection); + return getClient().functionGraphRef.findMany(args).unwrap(); +} +/** + * Branch heads — mutable pointers into the commit chain + * + * @example + * ```ts + * await prefetchFunctionGraphRefsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphRefsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphRefSelect>; + } +): Promise; +export async function prefetchFunctionGraphRefsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphRefKeys.list(args), + queryFn: () => getClient().functionGraphRef.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoreQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoreQuery.ts new file mode 100644 index 0000000000..405477734c --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoreQuery.ts @@ -0,0 +1,144 @@ +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphStoreQueryKey = functionGraphStoreKeys.detail; +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphStoreQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionGraphStoreQuery< + S extends FunctionGraphStoreSelect, + TData = { + functionGraphStore: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphStore: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphStoreQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphStoreKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```ts + * const data = await fetchFunctionGraphStoreQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionGraphStoreQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphStoreSelect>; +}): Promise<{ + functionGraphStore: InferSelectResult | null; +}>; +export async function fetchFunctionGraphStoreQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionGraphStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```ts + * await prefetchFunctionGraphStoreQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionGraphStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionGraphStoreSelect>; + } +): Promise; +export async function prefetchFunctionGraphStoreQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphStoreKeys.detail(params.id), + queryFn: () => + getClient() + .functionGraphStore.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoresQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoresQuery.ts new file mode 100644 index 0000000000..e9dc35a66e --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphStoresQuery.ts @@ -0,0 +1,171 @@ +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphStoreKeys } from '../query-keys'; +import type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphStoreSelect, + FunctionGraphStoreWithRelations, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphStoresQueryKey = functionGraphStoreKeys.list; +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphStoresQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphStoresQuery< + S extends FunctionGraphStoreSelect, + TData = { + functionGraphStores: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphStoreSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphStores: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphStoresQuery( + params: { + selection: ListSelectionConfig< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphStoreKeys.list(args), + queryFn: () => getClient().functionGraphStore.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```ts + * const data = await fetchFunctionGraphStoresQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphStoresQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphStoreSelect>; +}): Promise<{ + functionGraphStores: ConnectionResult>; +}>; +export async function fetchFunctionGraphStoresQuery(params: { + selection: ListSelectionConfig< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >(params.selection); + return getClient().functionGraphStore.findMany(args).unwrap(); +} +/** + * Named stores — one per version-controlled tree (e.g. one graph, one definition set) + * + * @example + * ```ts + * await prefetchFunctionGraphStoresQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphStoresQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionGraphStoreSelect>; + } +): Promise; +export async function prefetchFunctionGraphStoresQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphStoreKeys.list(args), + queryFn: () => getClient().functionGraphStore.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphsQuery.ts new file mode 100644 index 0000000000..8ab60ddbb2 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionGraphsQuery.ts @@ -0,0 +1,151 @@ +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionGraphKeys } from '../query-keys'; +import type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphFilter, + FunctionGraphOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionGraphSelect, + FunctionGraphWithRelations, + FunctionGraphFilter, + FunctionGraphOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionGraphsQueryKey = functionGraphKeys.list; +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionGraphsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionGraphsQuery< + S extends FunctionGraphSelect, + TData = { + functionGraphs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphSelect>; + } & Omit< + UseQueryOptions< + { + functionGraphs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionGraphsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionGraphKeys.list(args), + queryFn: () => getClient().functionGraph.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```ts + * const data = await fetchFunctionGraphsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionGraphsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphSelect>; +}): Promise<{ + functionGraphs: ConnectionResult>; +}>; +export async function fetchFunctionGraphsQuery(params: { + selection: ListSelectionConfig; +}) { + const args = buildListSelectionArgs< + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy + >(params.selection); + return getClient().functionGraph.findMany(args).unwrap(); +} +/** + * Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store + * + * @example + * ```ts + * await prefetchFunctionGraphsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionGraphsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionGraphSelect>; + } +): Promise; +export async function prefetchFunctionGraphsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionGraphKeys.list(args), + queryFn: () => getClient().functionGraph.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationQuery.ts new file mode 100644 index 0000000000..186493c92a --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationQuery.ts @@ -0,0 +1,144 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionInvocationQueryKey = functionInvocationKeys.detail; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionInvocationQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionInvocationQuery< + S extends FunctionInvocationSelect, + TData = { + functionInvocation: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocation: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionInvocationKeys.detail(params.id), + queryFn: () => + getClient() + .functionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * const data = await fetchFunctionInvocationQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionInvocationQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationSelect>; +}): Promise<{ + functionInvocation: InferSelectResult | null; +}>; +export async function fetchFunctionInvocationQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * await prefetchFunctionInvocationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionInvocationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionInvocationSelect>; + } +): Promise; +export async function prefetchFunctionInvocationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionInvocationKeys.detail(params.id), + queryFn: () => + getClient() + .functionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationsQuery.ts new file mode 100644 index 0000000000..8b6b595dee --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useFunctionInvocationsQuery.ts @@ -0,0 +1,171 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionInvocationKeys } from '../query-keys'; +import type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationFilter, + FunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionInvocationSelect, + FunctionInvocationWithRelations, + FunctionInvocationFilter, + FunctionInvocationOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionInvocationsQueryKey = functionInvocationKeys.list; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionInvocationsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionInvocationsQuery< + S extends FunctionInvocationSelect, + TData = { + functionInvocations: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + functionInvocations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionInvocationsQuery( + params: { + selection: ListSelectionConfig< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionInvocationKeys.list(args), + queryFn: () => getClient().functionInvocation.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * const data = await fetchFunctionInvocationsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionInvocationsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, FunctionInvocationSelect>; +}): Promise<{ + functionInvocations: ConnectionResult>; +}>; +export async function fetchFunctionInvocationsQuery(params: { + selection: ListSelectionConfig< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >(params.selection); + return getClient().functionInvocation.findMany(args).unwrap(); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * await prefetchFunctionInvocationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionInvocationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionInvocationSelect>; + } +): Promise; +export async function prefetchFunctionInvocationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionInvocationKeys.list(args), + queryFn: () => getClient().functionInvocation.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useGetAllQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useGetAllQuery.ts new file mode 100644 index 0000000000..fa74ed4aae --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useGetAllQuery.ts @@ -0,0 +1,145 @@ +/** + * List query hook for GetAllRecord + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { getAllRecordKeys } from '../query-keys'; +import type { + GetAllRecordSelect, + GetAllRecordWithRelations, + GetAllRecordFilter, + GetAllRecordsOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + GetAllRecordSelect, + GetAllRecordWithRelations, + GetAllRecordFilter, + GetAllRecordsOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const getAllQueryKey = getAllRecordKeys.list; +/** + * Query hook for fetching GetAllRecord list + * + * @example + * ```tsx + * const { data, isLoading } = useGetAllQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useGetAllQuery< + S extends GetAllRecordSelect, + TData = { + getAll: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, GetAllRecordSelect>; + } & Omit< + UseQueryOptions< + { + getAll: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGetAllQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: getAllRecordKeys.list(args), + queryFn: () => getClient().getAllRecord.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Fetch GetAllRecord list without React hooks + * + * @example + * ```ts + * const data = await fetchGetAllQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchGetAllQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, GetAllRecordSelect>; +}): Promise<{ + getAll: ConnectionResult>; +}>; +export async function fetchGetAllQuery(params: { + selection: ListSelectionConfig; +}) { + const args = buildListSelectionArgs( + params.selection + ); + return getClient().getAllRecord.findMany(args).unwrap(); +} +/** + * Prefetch GetAllRecord list for SSR or cache warming + * + * @example + * ```ts + * await prefetchGetAllQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchGetAllQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, GetAllRecordSelect>; + } +): Promise; +export async function prefetchGetAllQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); + await queryClient.prefetchQuery({ + queryKey: getAllRecordKeys.list(args), + queryFn: () => getClient().getAllRecord.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionExecutionLogQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionExecutionLogQuery.ts new file mode 100644 index 0000000000..9cd794f92d --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionExecutionLogQuery.ts @@ -0,0 +1,146 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionExecutionLogKeys } from '../query-keys'; +import type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const orgFunctionExecutionLogQueryKey = orgFunctionExecutionLogKeys.detail; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { data, isLoading } = useOrgFunctionExecutionLogQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useOrgFunctionExecutionLogQuery< + S extends OrgFunctionExecutionLogSelect, + TData = { + orgFunctionExecutionLog: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgFunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + orgFunctionExecutionLog: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgFunctionExecutionLogQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: orgFunctionExecutionLogKeys.detail(params.id), + queryFn: () => + getClient() + .orgFunctionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * const data = await fetchOrgFunctionExecutionLogQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchOrgFunctionExecutionLogQuery< + S extends OrgFunctionExecutionLogSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgFunctionExecutionLogSelect>; +}): Promise<{ + orgFunctionExecutionLog: InferSelectResult | null; +}>; +export async function fetchOrgFunctionExecutionLogQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .orgFunctionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * await prefetchOrgFunctionExecutionLogQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchOrgFunctionExecutionLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgFunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchOrgFunctionExecutionLogQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: orgFunctionExecutionLogKeys.detail(params.id), + queryFn: () => + getClient() + .orgFunctionExecutionLog.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionExecutionLogsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionExecutionLogsQuery.ts new file mode 100644 index 0000000000..d2fafbc29a --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionExecutionLogsQuery.ts @@ -0,0 +1,182 @@ +/** + * Function execution logs — structured console output per invocation + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { orgFunctionExecutionLogKeys } from '../query-keys'; +import type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogWithRelations, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const orgFunctionExecutionLogsQueryKey = orgFunctionExecutionLogKeys.list; +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```tsx + * const { data, isLoading } = useOrgFunctionExecutionLogsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useOrgFunctionExecutionLogsQuery< + S extends OrgFunctionExecutionLogSelect, + TData = { + orgFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgFunctionExecutionLogSelect>; + } & Omit< + UseQueryOptions< + { + orgFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgFunctionExecutionLogsQuery( + params: { + selection: ListSelectionConfig< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: orgFunctionExecutionLogKeys.list(args), + queryFn: () => getClient().orgFunctionExecutionLog.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * const data = await fetchOrgFunctionExecutionLogsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchOrgFunctionExecutionLogsQuery< + S extends OrgFunctionExecutionLogSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgFunctionExecutionLogSelect>; +}): Promise<{ + orgFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchOrgFunctionExecutionLogsQuery(params: { + selection: ListSelectionConfig< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + >; +}) { + const args = buildListSelectionArgs< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + >(params.selection); + return getClient().orgFunctionExecutionLog.findMany(args).unwrap(); +} +/** + * Function execution logs — structured console output per invocation + * + * @example + * ```ts + * await prefetchOrgFunctionExecutionLogsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchOrgFunctionExecutionLogsQuery< + S extends OrgFunctionExecutionLogSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgFunctionExecutionLogSelect>; + } +): Promise; +export async function prefetchOrgFunctionExecutionLogsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: orgFunctionExecutionLogKeys.list(args), + queryFn: () => getClient().orgFunctionExecutionLog.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionInvocationQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionInvocationQuery.ts new file mode 100644 index 0000000000..1268c6f367 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionInvocationQuery.ts @@ -0,0 +1,146 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { orgFunctionInvocationKeys } from '../query-keys'; +import type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const orgFunctionInvocationQueryKey = orgFunctionInvocationKeys.detail; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { data, isLoading } = useOrgFunctionInvocationQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useOrgFunctionInvocationQuery< + S extends OrgFunctionInvocationSelect, + TData = { + orgFunctionInvocation: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgFunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + orgFunctionInvocation: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgFunctionInvocationQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: orgFunctionInvocationKeys.detail(params.id), + queryFn: () => + getClient() + .orgFunctionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * const data = await fetchOrgFunctionInvocationQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchOrgFunctionInvocationQuery< + S extends OrgFunctionInvocationSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgFunctionInvocationSelect>; +}): Promise<{ + orgFunctionInvocation: InferSelectResult | null; +}>; +export async function fetchOrgFunctionInvocationQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .orgFunctionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * await prefetchOrgFunctionInvocationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchOrgFunctionInvocationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgFunctionInvocationSelect>; + } +): Promise; +export async function prefetchOrgFunctionInvocationQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: orgFunctionInvocationKeys.detail(params.id), + queryFn: () => + getClient() + .orgFunctionInvocation.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionInvocationsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionInvocationsQuery.ts new file mode 100644 index 0000000000..66c2a93144 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useOrgFunctionInvocationsQuery.ts @@ -0,0 +1,180 @@ +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { orgFunctionInvocationKeys } from '../query-keys'; +import type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgFunctionInvocationSelect, + OrgFunctionInvocationWithRelations, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const orgFunctionInvocationsQueryKey = orgFunctionInvocationKeys.list; +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```tsx + * const { data, isLoading } = useOrgFunctionInvocationsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useOrgFunctionInvocationsQuery< + S extends OrgFunctionInvocationSelect, + TData = { + orgFunctionInvocations: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgFunctionInvocationSelect>; + } & Omit< + UseQueryOptions< + { + orgFunctionInvocations: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgFunctionInvocationsQuery( + params: { + selection: ListSelectionConfig< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: orgFunctionInvocationKeys.list(args), + queryFn: () => getClient().orgFunctionInvocation.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * const data = await fetchOrgFunctionInvocationsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchOrgFunctionInvocationsQuery< + S extends OrgFunctionInvocationSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgFunctionInvocationSelect>; +}): Promise<{ + orgFunctionInvocations: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchOrgFunctionInvocationsQuery(params: { + selection: ListSelectionConfig< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + >; +}) { + const args = buildListSelectionArgs< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + >(params.selection); + return getClient().orgFunctionInvocation.findMany(args).unwrap(); +} +/** + * Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. + * + * @example + * ```ts + * await prefetchOrgFunctionInvocationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchOrgFunctionInvocationsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, OrgFunctionInvocationSelect>; + } +): Promise; +export async function prefetchOrgFunctionInvocationsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: orgFunctionInvocationKeys.list(args), + queryFn: () => getClient().orgFunctionInvocation.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useReadFunctionGraphQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useReadFunctionGraphQuery.ts new file mode 100644 index 0000000000..83fbb4ee52 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useReadFunctionGraphQuery.ts @@ -0,0 +1,107 @@ +/** + * Custom query hook for readFunctionGraph + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customQueryKeys } from '../query-keys'; +import type { ReadFunctionGraphVariables } from '../../orm/query'; +export type { ReadFunctionGraphVariables } from '../../orm/query'; +/** Query key factory - re-exported from query-keys.ts */ +export const readFunctionGraphQueryKey = customQueryKeys.readFunctionGraph; +/** + * Query hook for readFunctionGraph + * + * @example + * ```tsx + * const { data, isLoading } = useReadFunctionGraphQuery({ variables: { graphId } }); + * + * if (data?.readFunctionGraph) { + * console.log(data.readFunctionGraph); + * } + * ``` + */ +export function useReadFunctionGraphQuery< + TData = { + readFunctionGraph: unknown | null; + }, +>( + params?: { + variables?: ReadFunctionGraphVariables; + } & Omit< + UseQueryOptions< + { + readFunctionGraph: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useReadFunctionGraphQuery< + TData = { + readFunctionGraph: unknown | null; + }, +>( + params?: { + variables?: ReadFunctionGraphVariables; + } & Omit< + UseQueryOptions< + { + readFunctionGraph: unknown | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult { + const variables = params?.variables ?? {}; + const { variables: _variables, ...queryOptions } = params ?? {}; + void _variables; + return useQuery({ + queryKey: readFunctionGraphQueryKey(variables), + queryFn: () => getClient().query.readFunctionGraph(variables).unwrap(), + ...queryOptions, + }); +} +/** + * Fetch readFunctionGraph without React hooks + * + * @example + * ```ts + * const data = await fetchReadFunctionGraphQuery({ variables: { graphId } }); + * ``` + */ +export async function fetchReadFunctionGraphQuery(params?: { + variables?: ReadFunctionGraphVariables; +}) { + const variables = params?.variables ?? {}; + return getClient().query.readFunctionGraph(variables).unwrap(); +} +/** + * Prefetch readFunctionGraph for SSR or cache warming + * + * @example + * ```ts + * await prefetchReadFunctionGraphQuery(queryClient, { variables: { graphId } }); + * ``` + */ +export async function prefetchReadFunctionGraphQuery( + queryClient: QueryClient, + params?: { + variables?: ReadFunctionGraphVariables; + } +): Promise { + const variables = params?.variables ?? {}; + await queryClient.prefetchQuery({ + queryKey: readFunctionGraphQueryKey(variables), + queryFn: () => getClient().query.readFunctionGraph(variables).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useSecretDefinitionQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useSecretDefinitionQuery.ts new file mode 100644 index 0000000000..b33a5734aa --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useSecretDefinitionQuery.ts @@ -0,0 +1,138 @@ +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { secretDefinitionKeys } from '../query-keys'; +import type { SecretDefinitionSelect, SecretDefinitionWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { SecretDefinitionSelect, SecretDefinitionWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const secretDefinitionQueryKey = secretDefinitionKeys.detail; +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```tsx + * const { data, isLoading } = useSecretDefinitionQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useSecretDefinitionQuery< + S extends SecretDefinitionSelect, + TData = { + secretDefinition: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SecretDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + secretDefinition: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSecretDefinitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: secretDefinitionKeys.detail(params.id), + queryFn: () => + getClient() + .secretDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```ts + * const data = await fetchSecretDefinitionQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchSecretDefinitionQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SecretDefinitionSelect>; +}): Promise<{ + secretDefinition: InferSelectResult | null; +}>; +export async function fetchSecretDefinitionQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .secretDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```ts + * await prefetchSecretDefinitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchSecretDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, SecretDefinitionSelect>; + } +): Promise; +export async function prefetchSecretDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: secretDefinitionKeys.detail(params.id), + queryFn: () => + getClient() + .secretDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/queries/useSecretDefinitionsQuery.ts b/sdk/constructive-react/src/compute/hooks/queries/useSecretDefinitionsQuery.ts new file mode 100644 index 0000000000..f5935e8efc --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/queries/useSecretDefinitionsQuery.ts @@ -0,0 +1,163 @@ +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { secretDefinitionKeys } from '../query-keys'; +import type { + SecretDefinitionSelect, + SecretDefinitionWithRelations, + SecretDefinitionFilter, + SecretDefinitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + SecretDefinitionSelect, + SecretDefinitionWithRelations, + SecretDefinitionFilter, + SecretDefinitionOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const secretDefinitionsQueryKey = secretDefinitionKeys.list; +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```tsx + * const { data, isLoading } = useSecretDefinitionsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useSecretDefinitionsQuery< + S extends SecretDefinitionSelect, + TData = { + secretDefinitions: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SecretDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + secretDefinitions: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useSecretDefinitionsQuery( + params: { + selection: ListSelectionConfig< + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: secretDefinitionKeys.list(args), + queryFn: () => getClient().secretDefinition.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```ts + * const data = await fetchSecretDefinitionsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchSecretDefinitionsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SecretDefinitionSelect>; +}): Promise<{ + secretDefinitions: ConnectionResult>; +}>; +export async function fetchSecretDefinitionsQuery(params: { + selection: ListSelectionConfig< + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy + >; +}) { + const args = buildListSelectionArgs< + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy + >(params.selection); + return getClient().secretDefinition.findMany(args).unwrap(); +} +/** + * Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. + * + * @example + * ```ts + * await prefetchSecretDefinitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchSecretDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, SecretDefinitionSelect>; + } +): Promise; +export async function prefetchSecretDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: secretDefinitionKeys.list(args), + queryFn: () => getClient().secretDefinition.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/compute/hooks/query-keys.ts b/sdk/constructive-react/src/compute/hooks/query-keys.ts new file mode 100644 index 0000000000..840d3786cd --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/query-keys.ts @@ -0,0 +1,241 @@ +/** + * Centralized query key factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// ============================================================================ +// This file provides a centralized, type-safe query key factory following +// the lukemorales query-key-factory pattern for React Query. +// +// Benefits: +// - Single source of truth for all query keys +// - Type-safe key access with autocomplete +// - Hierarchical invalidation (invalidate all 'user.*' queries) +// - Scoped keys for parent-child relationships +// ============================================================================ + +// ============================================================================ +// Entity Query Keys +// ============================================================================ + +export const getAllRecordKeys = { + /** All getAllRecord queries */ all: ['getallrecord'] as const, + /** List query keys */ lists: () => [...getAllRecordKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...getAllRecordKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...getAllRecordKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...getAllRecordKeys.details(), id] as const, +} as const; +export const functionApiBindingKeys = { + /** All functionApiBinding queries */ all: ['functionapibinding'] as const, + /** List query keys */ lists: () => [...functionApiBindingKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionApiBindingKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionApiBindingKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionApiBindingKeys.details(), id] as const, +} as const; +export const functionDeploymentKeys = { + /** All functionDeployment queries */ all: ['functiondeployment'] as const, + /** List query keys */ lists: () => [...functionDeploymentKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDeploymentKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDeploymentKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDeploymentKeys.details(), id] as const, +} as const; +export const functionGraphRefKeys = { + /** All functionGraphRef queries */ all: ['functiongraphref'] as const, + /** List query keys */ lists: () => [...functionGraphRefKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphRefKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphRefKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphRefKeys.details(), id] as const, +} as const; +export const functionGraphStoreKeys = { + /** All functionGraphStore queries */ all: ['functiongraphstore'] as const, + /** List query keys */ lists: () => [...functionGraphStoreKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphStoreKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphStoreKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphStoreKeys.details(), id] as const, +} as const; +export const functionGraphObjectKeys = { + /** All functionGraphObject queries */ all: ['functiongraphobject'] as const, + /** List query keys */ lists: () => [...functionGraphObjectKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphObjectKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphObjectKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphObjectKeys.details(), id] as const, +} as const; +export const functionDeploymentEventKeys = { + /** All functionDeploymentEvent queries */ all: ['functiondeploymentevent'] as const, + /** List query keys */ lists: () => [...functionDeploymentEventKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDeploymentEventKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDeploymentEventKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDeploymentEventKeys.details(), id] as const, +} as const; +export const orgFunctionExecutionLogKeys = { + /** All orgFunctionExecutionLog queries */ all: ['orgfunctionexecutionlog'] as const, + /** List query keys */ lists: () => [...orgFunctionExecutionLogKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgFunctionExecutionLogKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgFunctionExecutionLogKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgFunctionExecutionLogKeys.details(), id] as const, +} as const; +export const functionGraphExecutionOutputKeys = { + /** All functionGraphExecutionOutput queries */ all: ['functiongraphexecutionoutput'] as const, + /** List query keys */ lists: () => [...functionGraphExecutionOutputKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphExecutionOutputKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...functionGraphExecutionOutputKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphExecutionOutputKeys.details(), id] as const, +} as const; +export const functionGraphCommitKeys = { + /** All functionGraphCommit queries */ all: ['functiongraphcommit'] as const, + /** List query keys */ lists: () => [...functionGraphCommitKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphCommitKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphCommitKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphCommitKeys.details(), id] as const, +} as const; +export const secretDefinitionKeys = { + /** All secretDefinition queries */ all: ['secretdefinition'] as const, + /** List query keys */ lists: () => [...secretDefinitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...secretDefinitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...secretDefinitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...secretDefinitionKeys.details(), id] as const, +} as const; +export const functionExecutionLogKeys = { + /** All functionExecutionLog queries */ all: ['functionexecutionlog'] as const, + /** List query keys */ lists: () => [...functionExecutionLogKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionExecutionLogKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionExecutionLogKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionExecutionLogKeys.details(), id] as const, +} as const; +export const functionGraphExecutionNodeStateKeys = { + /** All functionGraphExecutionNodeState queries */ all: [ + 'functiongraphexecutionnodestate', + ] as const, + /** List query keys */ lists: () => [...functionGraphExecutionNodeStateKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphExecutionNodeStateKeys.lists(), variables] as const, + /** Detail query keys */ details: () => + [...functionGraphExecutionNodeStateKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphExecutionNodeStateKeys.details(), id] as const, +} as const; +export const functionGraphKeys = { + /** All functionGraph queries */ all: ['functiongraph'] as const, + /** List query keys */ lists: () => [...functionGraphKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphKeys.details(), id] as const, +} as const; +export const orgFunctionInvocationKeys = { + /** All orgFunctionInvocation queries */ all: ['orgfunctioninvocation'] as const, + /** List query keys */ lists: () => [...orgFunctionInvocationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgFunctionInvocationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgFunctionInvocationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgFunctionInvocationKeys.details(), id] as const, +} as const; +export const functionInvocationKeys = { + /** All functionInvocation queries */ all: ['functioninvocation'] as const, + /** List query keys */ lists: () => [...functionInvocationKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionInvocationKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionInvocationKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionInvocationKeys.details(), id] as const, +} as const; +export const functionGraphExecutionKeys = { + /** All functionGraphExecution queries */ all: ['functiongraphexecution'] as const, + /** List query keys */ lists: () => [...functionGraphExecutionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionGraphExecutionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionGraphExecutionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionGraphExecutionKeys.details(), id] as const, +} as const; +export const functionDefinitionKeys = { + /** All functionDefinition queries */ all: ['functiondefinition'] as const, + /** List query keys */ lists: () => [...functionDefinitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDefinitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDefinitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDefinitionKeys.details(), id] as const, +} as const; + +// ============================================================================ +// Custom Query Keys +// ============================================================================ + +export const customQueryKeys = { + /** Query key for readFunctionGraph */ readFunctionGraph: (variables?: object) => + ['readFunctionGraph', variables] as const, +} as const; +/** + +// ============================================================================ +// Unified Query Key Store +// ============================================================================ + + * Unified query key store + * + * Use this for type-safe query key access across your application. + * + * @example + * ```ts + * // Invalidate all user queries + * queryClient.invalidateQueries({ queryKey: queryKeys.user.all }); + * + * // Invalidate user list queries + * queryClient.invalidateQueries({ queryKey: queryKeys.user.lists() }); + * + * // Invalidate specific user + * queryClient.invalidateQueries({ queryKey: queryKeys.user.detail(userId) }); + * ``` + */ +export const queryKeys = { + getAllRecord: getAllRecordKeys, + functionApiBinding: functionApiBindingKeys, + functionDeployment: functionDeploymentKeys, + functionGraphRef: functionGraphRefKeys, + functionGraphStore: functionGraphStoreKeys, + functionGraphObject: functionGraphObjectKeys, + functionDeploymentEvent: functionDeploymentEventKeys, + orgFunctionExecutionLog: orgFunctionExecutionLogKeys, + functionGraphExecutionOutput: functionGraphExecutionOutputKeys, + functionGraphCommit: functionGraphCommitKeys, + secretDefinition: secretDefinitionKeys, + functionExecutionLog: functionExecutionLogKeys, + functionGraphExecutionNodeState: functionGraphExecutionNodeStateKeys, + functionGraph: functionGraphKeys, + orgFunctionInvocation: orgFunctionInvocationKeys, + functionInvocation: functionInvocationKeys, + functionGraphExecution: functionGraphExecutionKeys, + functionDefinition: functionDefinitionKeys, + custom: customQueryKeys, +} as const; +/** Type representing all available query key scopes */ +export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/compute/hooks/selection.ts b/sdk/constructive-react/src/compute/hooks/selection.ts new file mode 100644 index 0000000000..2952aab647 --- /dev/null +++ b/sdk/constructive-react/src/compute/hooks/selection.ts @@ -0,0 +1,60 @@ +/** + * Selection helpers for React Query hooks + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface SelectionConfig { + fields: TFields; +} + +export interface ListSelectionConfig extends SelectionConfig { + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +function ensureSelectionFields( + selection: SelectionConfig | undefined +): asserts selection is SelectionConfig { + if (!selection || typeof selection !== 'object' || !('fields' in selection)) { + throw new Error( + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' + ); + } +} + +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { + ensureSelectionFields(selection); + return { select: selection.fields }; +} + +export function buildListSelectionArgs( + selection: ListSelectionConfig +): { + select: TFields; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} { + ensureSelectionFields(selection); + return { + select: selection.fields, + where: selection.where, + orderBy: selection.orderBy, + first: selection.first, + last: selection.last, + after: selection.after, + before: selection.before, + offset: selection.offset, + }; +} diff --git a/sdk/constructive-react/src/compute/index.ts b/sdk/constructive-react/src/compute/index.ts new file mode 100644 index 0000000000..2b8402539a --- /dev/null +++ b/sdk/constructive-react/src/compute/index.ts @@ -0,0 +1,7 @@ +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/compute/orm/README.md b/sdk/constructive-react/src/compute/orm/README.md new file mode 100644 index 0000000000..c266bdfcb7 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/README.md @@ -0,0 +1,986 @@ +# ORM Client + +

+ +

+ + + +## Setup + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); +``` + +## Models + +| Model | Operations | +|-------|------------| +| `getAllRecord` | findMany, findOne, create, update, delete | +| `functionApiBinding` | findMany, findOne, create, update, delete | +| `functionDeployment` | findMany, findOne, create, update, delete | +| `functionGraphRef` | findMany, findOne, create, update, delete | +| `functionGraphStore` | findMany, findOne, create, update, delete | +| `functionGraphObject` | findMany, findOne, create, update, delete | +| `functionDeploymentEvent` | findMany, findOne, create, update, delete | +| `orgFunctionExecutionLog` | findMany, findOne, create, update, delete | +| `functionGraphExecutionOutput` | findMany, findOne, create, update, delete | +| `functionGraphCommit` | findMany, findOne, create, update, delete | +| `secretDefinition` | findMany, findOne, create, update, delete | +| `functionExecutionLog` | findMany, findOne, create, update, delete | +| `functionGraphExecutionNodeState` | findMany, findOne, create, update, delete | +| `functionGraph` | findMany, findOne, create, update, delete | +| `orgFunctionInvocation` | findMany, findOne, create, update, delete | +| `functionInvocation` | findMany, findOne, create, update, delete | +| `functionGraphExecution` | findMany, findOne, create, update, delete | +| `functionDefinition` | findMany, findOne, create, update, delete | + +## Table Operations + +### `db.getAllRecord` + +CRUD operations for GetAllRecord records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `path` | String | Yes | +| `data` | JSON | Yes | + +**Operations:** + +```typescript +// List all getAllRecord records +const items = await db.getAllRecord.findMany({ select: { path: true, data: true } }).execute(); + +// Get one by id +const item = await db.getAllRecord.findOne({ id: '', select: { path: true, data: true } }).execute(); + +// Create +const created = await db.getAllRecord.create({ data: { path: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.getAllRecord.update({ where: { id: '' }, data: { path: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.getAllRecord.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionApiBinding` + +CRUD operations for FunctionApiBinding records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `functionDefinitionId` | UUID | Yes | +| `apiId` | UUID | Yes | +| `alias` | String | Yes | +| `config` | JSON | Yes | + +**Operations:** + +```typescript +// List all functionApiBinding records +const items = await db.functionApiBinding.findMany({ select: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }).execute(); + +// Get one by id +const item = await db.functionApiBinding.findOne({ id: '', select: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }).execute(); + +// Create +const created = await db.functionApiBinding.create({ data: { functionDefinitionId: '', apiId: '', alias: '', config: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionApiBinding.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionApiBinding.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDeployment` + +CRUD operations for FunctionDeployment records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `functionDefinitionId` | UUID | Yes | +| `namespaceId` | UUID | Yes | +| `status` | String | Yes | +| `serviceUrl` | String | Yes | +| `serviceName` | String | Yes | +| `revision` | Int | Yes | +| `image` | String | Yes | +| `concurrency` | Int | Yes | +| `scaleMin` | Int | Yes | +| `scaleMax` | Int | Yes | +| `timeoutSeconds` | Int | Yes | +| `resources` | JSON | Yes | +| `lastError` | String | Yes | +| `lastErrorAt` | Datetime | Yes | +| `errorCount` | Int | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionDeployment records +const items = await db.functionDeployment.findMany({ select: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionDeployment.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionDeployment.create({ data: { functionDefinitionId: '', namespaceId: '', status: '', serviceUrl: '', serviceName: '', revision: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', lastError: '', lastErrorAt: '', errorCount: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeployment.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeployment.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphRef` + +CRUD operations for FunctionGraphRef records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `name` | String | Yes | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `commitId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionGraphRef records +const items = await db.functionGraphRef.findMany({ select: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }).execute(); + +// Get one by id +const item = await db.functionGraphRef.findOne({ id: '', select: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }).execute(); + +// Create +const created = await db.functionGraphRef.create({ data: { name: '', databaseId: '', storeId: '', commitId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphRef.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphRef.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphStore` + +CRUD operations for FunctionGraphStore records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `name` | String | Yes | +| `databaseId` | UUID | Yes | +| `hash` | UUID | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraphStore records +const items = await db.functionGraphStore.findMany({ select: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraphStore.findOne({ id: '', select: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }).execute(); + +// Create +const created = await db.functionGraphStore.create({ data: { name: '', databaseId: '', hash: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphStore.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphStore.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphObject` + +CRUD operations for FunctionGraphObject records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `kids` | UUID | Yes | +| `ktree` | String | Yes | +| `data` | JSON | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraphObject records +const items = await db.functionGraphObject.findMany({ select: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraphObject.findOne({ id: '', select: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }).execute(); + +// Create +const created = await db.functionGraphObject.create({ data: { databaseId: '', kids: '', ktree: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphObject.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphObject.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDeploymentEvent` + +CRUD operations for FunctionDeploymentEvent records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `deploymentId` | UUID | Yes | +| `eventType` | String | Yes | +| `actorId` | UUID | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionDeploymentEvent records +const items = await db.functionDeploymentEvent.findMany({ select: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionDeploymentEvent.findOne({ id: '', select: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionDeploymentEvent.create({ data: { deploymentId: '', eventType: '', actorId: '', message: '', metadata: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeploymentEvent.update({ where: { id: '' }, data: { deploymentId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeploymentEvent.delete({ where: { id: '' } }).execute(); +``` + +### `db.orgFunctionExecutionLog` + +CRUD operations for OrgFunctionExecutionLog records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `invocationId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `logLevel` | String | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `actorId` | UUID | Yes | + +**Operations:** + +```typescript +// List all orgFunctionExecutionLog records +const items = await db.orgFunctionExecutionLog.findMany({ select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }).execute(); + +// Get one by id +const item = await db.orgFunctionExecutionLog.findOne({ id: '', select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }).execute(); + +// Create +const created = await db.orgFunctionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgFunctionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgFunctionExecutionLog.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecutionOutput` + +CRUD operations for FunctionGraphExecutionOutput records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `hash` | Base64EncodedBinary | Yes | +| `data` | JSON | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecutionOutput records +const items = await db.functionGraphExecutionOutput.findMany({ select: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecutionOutput.findOne({ id: '', select: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }).execute(); + +// Create +const created = await db.functionGraphExecutionOutput.create({ data: { databaseId: '', hash: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecutionOutput.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecutionOutput.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphCommit` + +CRUD operations for FunctionGraphCommit records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `message` | String | Yes | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `parentIds` | UUID | Yes | +| `authorId` | UUID | Yes | +| `committerId` | UUID | Yes | +| `treeId` | UUID | Yes | +| `date` | Datetime | Yes | + +**Operations:** + +```typescript +// List all functionGraphCommit records +const items = await db.functionGraphCommit.findMany({ select: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }).execute(); + +// Get one by id +const item = await db.functionGraphCommit.findOne({ id: '', select: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }).execute(); + +// Create +const created = await db.functionGraphCommit.create({ data: { message: '', databaseId: '', storeId: '', parentIds: '', authorId: '', committerId: '', treeId: '', date: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphCommit.update({ where: { id: '' }, data: { message: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphCommit.delete({ where: { id: '' } }).execute(); +``` + +### `db.secretDefinition` + +CRUD operations for SecretDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `name` | String | Yes | +| `description` | String | Yes | +| `isBuiltIn` | Boolean | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all secretDefinition records +const items = await db.secretDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.secretDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Create +const created = await db.secretDefinition.create({ data: { name: '', description: '', isBuiltIn: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.secretDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.secretDefinition.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionExecutionLog` + +CRUD operations for FunctionExecutionLog records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `invocationId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `logLevel` | String | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `actorId` | UUID | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionExecutionLog records +const items = await db.functionExecutionLog.findMany({ select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionExecutionLog.findOne({ id: '', select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionExecutionLog.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecutionNodeState` + +CRUD operations for FunctionGraphExecutionNodeState records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `executionId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `nodeName` | String | Yes | +| `nodePath` | String | Yes | +| `status` | String | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `errorCode` | String | Yes | +| `errorMessage` | String | Yes | +| `outputId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecutionNodeState records +const items = await db.functionGraphExecutionNodeState.findMany({ select: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecutionNodeState.findOne({ id: '', select: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }).execute(); + +// Create +const created = await db.functionGraphExecutionNodeState.create({ data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraph` + +CRUD operations for FunctionGraph records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `context` | String | Yes | +| `name` | String | Yes | +| `description` | String | Yes | +| `definitionsCommitId` | UUID | Yes | +| `isValid` | Boolean | Yes | +| `validationErrors` | JSON | Yes | +| `createdBy` | UUID | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraph records +const items = await db.functionGraph.findMany({ select: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraph.findOne({ id: '', select: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }).execute(); + +// Create +const created = await db.functionGraph.create({ data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); +``` + +### `db.orgFunctionInvocation` + +CRUD operations for OrgFunctionInvocation records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `actorId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `payload` | JSON | Yes | +| `status` | String | Yes | +| `result` | JSON | Yes | +| `error` | String | Yes | +| `durationMs` | Int | Yes | +| `jobId` | BigInt | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `parentInvocationId` | UUID | Yes | +| `graphExecutionId` | UUID | Yes | + +**Operations:** + +```typescript +// List all orgFunctionInvocation records +const items = await db.orgFunctionInvocation.findMany({ select: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Get one by id +const item = await db.orgFunctionInvocation.findOne({ id: '', select: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Create +const created = await db.orgFunctionInvocation.create({ data: { actorId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgFunctionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgFunctionInvocation.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionInvocation` + +CRUD operations for FunctionInvocation records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `actorId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `payload` | JSON | Yes | +| `status` | String | Yes | +| `result` | JSON | Yes | +| `error` | String | Yes | +| `durationMs` | Int | Yes | +| `jobId` | BigInt | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `parentInvocationId` | UUID | Yes | +| `graphExecutionId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionInvocation records +const items = await db.functionInvocation.findMany({ select: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Get one by id +const item = await db.functionInvocation.findOne({ id: '', select: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Create +const created = await db.functionInvocation.create({ data: { actorId: '', databaseId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionInvocation.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecution` + +CRUD operations for FunctionGraphExecution records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `startedAt` | Datetime | Yes | +| `id` | UUID | No | +| `graphId` | UUID | Yes | +| `invocationId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `outputNode` | String | Yes | +| `outputPort` | String | Yes | +| `status` | String | Yes | +| `inputPayload` | JSON | Yes | +| `outputPayload` | JSON | Yes | +| `nodeOutputs` | JSON | Yes | +| `executionPlan` | JSON | Yes | +| `currentWave` | Int | Yes | +| `parentExecutionId` | UUID | Yes | +| `parentNodeName` | String | Yes | +| `definitionsCommitId` | UUID | Yes | +| `tickCount` | Int | Yes | +| `completedAt` | Datetime | Yes | +| `maxTicks` | Int | Yes | +| `maxPendingJobs` | Int | Yes | +| `timeoutAt` | Datetime | Yes | +| `errorCode` | String | Yes | +| `errorMessage` | String | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecution records +const items = await db.functionGraphExecution.findMany({ select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecution.findOne({ id: '', select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }).execute(); + +// Create +const created = await db.functionGraphExecution.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', entityId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecution.update({ where: { id: '' }, data: { startedAt: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecution.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDefinition` + +CRUD operations for FunctionDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `scope` | String | Yes | +| `name` | String | Yes | +| `taskIdentifier` | String | Yes | +| `description` | String | Yes | +| `isInvocable` | Boolean | Yes | +| `maxAttempts` | Int | Yes | +| `priority` | Int | Yes | +| `queueName` | String | Yes | +| `runtime` | String | Yes | +| `image` | String | Yes | +| `concurrency` | Int | Yes | +| `scaleMin` | Int | Yes | +| `scaleMax` | Int | Yes | +| `timeoutSeconds` | Int | Yes | +| `resources` | JSON | Yes | +| `isBuiltIn` | Boolean | Yes | +| `requiredSecrets` | FunctionRequirement | Yes | +| `requiredConfigs` | FunctionRequirement | Yes | +| `requiredBuckets` | String | Yes | +| `requiredModels` | String | Yes | +| `inputs` | JSON | Yes | +| `outputs` | JSON | Yes | +| `props` | JSON | Yes | +| `volatile` | Boolean | Yes | +| `icon` | String | Yes | +| `category` | String | Yes | + +**Operations:** + +```typescript +// List all functionDefinition records +const items = await db.functionDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }).execute(); + +// Get one by id +const item = await db.functionDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }).execute(); + +// Create +const created = await db.functionDefinition.create({ data: { scope: '', name: '', taskIdentifier: '', description: '', isInvocable: '', maxAttempts: '', priority: '', queueName: '', runtime: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', isBuiltIn: '', requiredSecrets: '', requiredConfigs: '', requiredBuckets: '', requiredModels: '', inputs: '', outputs: '', props: '', volatile: '', icon: '', category: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDefinition.update({ where: { id: '' }, data: { scope: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDefinition.delete({ where: { id: '' } }).execute(); +``` + +## Custom Operations + +### `db.query.readFunctionGraph` + +readFunctionGraph + +- **Type:** query +- **Arguments:** + + | Argument | Type | + |----------|------| + | `graphId` | UUID | + +```typescript +const result = await db.query.readFunctionGraph({ graphId: '' }).execute(); +``` + +### `db.mutation.validateFunctionGraph` + +validateFunctionGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ValidateFunctionGraphInput (required) | + +```typescript +const result = await db.mutation.validateFunctionGraph({ input: { graphId: '' } }).execute(); +``` + +### `db.mutation.initEmptyRepo` + +initEmptyRepo + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InitEmptyRepoInput (required) | + +```typescript +const result = await db.mutation.initEmptyRepo({ input: { sId: '', storeId: '' } }).execute(); +``` + +### `db.mutation.setDataAtPath` + +setDataAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SetDataAtPathInput (required) | + +```typescript +const result = await db.mutation.setDataAtPath({ input: { sId: '', root: '', path: '', data: '' } }).execute(); +``` + +### `db.mutation.importDefinitions` + +importDefinitions + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportDefinitionsInput (required) | + +```typescript +const result = await db.mutation.importDefinitions({ input: { graphId: '', sourceScopeId: '', sourceCommitId: '', contexts: '' } }).execute(); +``` + +### `db.mutation.copyGraph` + +copyGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CopyGraphInput (required) | + +```typescript +const result = await db.mutation.copyGraph({ input: { databaseId: '', graphId: '', name: '' } }).execute(); +``` + +### `db.mutation.saveGraph` + +saveGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SaveGraphInput (required) | + +```typescript +const result = await db.mutation.saveGraph({ input: { graphId: '', rootHash: '', message: '' } }).execute(); +``` + +### `db.mutation.addEdgeAndSave` + +addEdgeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeAndSaveInput (required) | + +```typescript +const result = await db.mutation.addEdgeAndSave({ input: '' }).execute(); +``` + +### `db.mutation.addNodeAndSave` + +addNodeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeAndSaveInput (required) | + +```typescript +const result = await db.mutation.addNodeAndSave({ input: '' }).execute(); +``` + +### `db.mutation.addEdge` + +addEdge + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeInput (required) | + +```typescript +const result = await db.mutation.addEdge({ input: '' }).execute(); +``` + +### `db.mutation.addNode` + +addNode + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeInput (required) | + +```typescript +const result = await db.mutation.addNode({ input: '' }).execute(); +``` + +### `db.mutation.importGraphJson` + +importGraphJson + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportGraphJsonInput (required) | + +```typescript +const result = await db.mutation.importGraphJson({ input: '' }).execute(); +``` + +### `db.mutation.insertNodeAtPath` + +insertNodeAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InsertNodeAtPathInput (required) | + +```typescript +const result = await db.mutation.insertNodeAtPath({ input: '' }).execute(); +``` + +### `db.mutation.startExecution` + +startExecution + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | StartExecutionInput (required) | + +```typescript +const result = await db.mutation.startExecution({ input: '' }).execute(); +``` + +### `db.mutation.provisionBucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-react/src/compute/orm/client.ts b/sdk/constructive-react/src/compute/orm/client.ts new file mode 100644 index 0000000000..16e683c712 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/client.ts @@ -0,0 +1,244 @@ +/** + * ORM Client - Runtime GraphQL executor + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; +import { createFetch } from '@constructive-io/graphql-query/runtime'; + +import type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + Unsubscribe, +} from './realtime'; +import { RealtimeManager } from './realtime'; + +export type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; + +export type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + SubscriptionOperation, + Unsubscribe, + WsClient, +} from './realtime'; +export { RealtimeManager } from './realtime'; + +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +export class FetchAdapter implements GraphQLAdapter { + private headers: Record; + private fetchFn: typeof globalThis.fetch; + + constructor( + private endpoint: string, + headers?: Record, + fetchFn?: typeof globalThis.fetch + ) { + this.headers = headers ?? {}; + this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); + } + + async execute(document: string, variables?: Record): Promise> { + const response = await this.fetchFn(this.endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + ...this.headers, + }, + body: JSON.stringify({ + query: document, + variables: variables ?? {}, + }), + }); + + if (!response.ok) { + return { + ok: false, + data: null, + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], + }; + } + + const json = (await response.json()) as { + data?: T; + errors?: GraphQLError[]; + }; + + if (json.errors && json.errors.length > 0) { + return { + ok: false, + data: null, + errors: json.errors, + }; + } + + return { + ok: true, + data: json.data as T, + errors: undefined, + }; + } + + setHeaders(headers: Record): void { + this.headers = { ...this.headers, ...headers }; + } + + getEndpoint(): string { + return this.endpoint; + } +} + +/** + * Configuration for creating an ORM client. + * Either provide endpoint (and optional headers/fetch) for HTTP requests, + * or provide a custom adapter for alternative execution strategies. + */ +export interface OrmClientConfig { + /** GraphQL endpoint URL (required if adapter not provided) */ + endpoint?: string; + /** Default headers for HTTP requests (only used with endpoint) */ + headers?: Record; + /** + * Custom fetch implementation. Defaults to createFetch() from + * @constructive-io/graphql-query/runtime which handles *.localhost + * DNS and Host headers in Node.js. Pass your own for test mocking + * or custom proxy/credentials. + */ + fetch?: typeof globalThis.fetch; + /** Custom adapter for GraphQL execution (overrides endpoint/headers/fetch) */ + adapter?: GraphQLAdapter; + /** + * Optional realtime (WebSocket) configuration. + * When provided, enables subscription methods on models. + * The WebSocket connection is created lazily on first subscribe(). + */ + realtime?: RealtimeConfig; +} + +/** + * Error thrown when GraphQL request fails + */ +export class GraphQLRequestError extends Error { + constructor( + public readonly errors: GraphQLError[], + public readonly data: unknown = null + ) { + const messages = errors.map((e) => e.message).join('; '); + super(`GraphQL Error: ${messages}`); + this.name = 'GraphQLRequestError'; + } +} + +export class OrmClient { + private adapter: GraphQLAdapter; + private realtimeManager?: RealtimeManager; + + constructor(config: OrmClientConfig) { + if (config.adapter) { + this.adapter = config.adapter; + } else if (config.endpoint) { + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); + } else { + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); + } + + if (config.realtime) { + this.realtimeManager = new RealtimeManager(config.realtime); + } + } + + async execute(document: string, variables?: Record): Promise> { + return this.adapter.execute(document, variables); + } + + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + if (!this.realtimeManager) { + throw new Error( + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' + ); + } + return this.realtimeManager.subscribe(meta, document, variables, options); + } + + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers: Record): void { + if (this.adapter.setHeaders) { + this.adapter.setHeaders(headers); + } + } + + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint(): string { + return this.adapter.getEndpoint?.() ?? ''; + } + + /** Get current WebSocket connection state */ + getConnectionState(): ConnectionState { + return this.realtimeManager?.getConnectionState() ?? 'disconnected'; + } + + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + if (!this.realtimeManager) return () => {}; + return this.realtimeManager.onConnectionStateChange(listener); + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.realtimeManager?.getActiveSubscriptionCount() ?? 0; + } + + /** Whether realtime is configured */ + get isRealtimeEnabled(): boolean { + return this.realtimeManager !== undefined; + } + + /** Dispose the realtime manager (close WebSocket) */ + dispose(): void { + this.realtimeManager?.dispose(); + } +} diff --git a/sdk/constructive-react/src/compute/orm/index.ts b/sdk/constructive-react/src/compute/orm/index.ts new file mode 100644 index 0000000000..99193c1d28 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/index.ts @@ -0,0 +1,82 @@ +/** + * ORM Client - createClient factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { GetAllRecordModel } from './models/getAllRecord'; +import { FunctionApiBindingModel } from './models/functionApiBinding'; +import { FunctionDeploymentModel } from './models/functionDeployment'; +import { FunctionGraphRefModel } from './models/functionGraphRef'; +import { FunctionGraphStoreModel } from './models/functionGraphStore'; +import { FunctionGraphObjectModel } from './models/functionGraphObject'; +import { FunctionDeploymentEventModel } from './models/functionDeploymentEvent'; +import { OrgFunctionExecutionLogModel } from './models/orgFunctionExecutionLog'; +import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecutionOutput'; +import { FunctionGraphCommitModel } from './models/functionGraphCommit'; +import { SecretDefinitionModel } from './models/secretDefinition'; +import { FunctionExecutionLogModel } from './models/functionExecutionLog'; +import { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; +import { FunctionGraphModel } from './models/functionGraph'; +import { OrgFunctionInvocationModel } from './models/orgFunctionInvocation'; +import { FunctionInvocationModel } from './models/functionInvocation'; +import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; +import { FunctionDefinitionModel } from './models/functionDefinition'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +export function createClient(config: OrmClientConfig) { + const client = new OrmClient(config); + return { + getAllRecord: new GetAllRecordModel(client), + functionApiBinding: new FunctionApiBindingModel(client), + functionDeployment: new FunctionDeploymentModel(client), + functionGraphRef: new FunctionGraphRefModel(client), + functionGraphStore: new FunctionGraphStoreModel(client), + functionGraphObject: new FunctionGraphObjectModel(client), + functionDeploymentEvent: new FunctionDeploymentEventModel(client), + orgFunctionExecutionLog: new OrgFunctionExecutionLogModel(client), + functionGraphExecutionOutput: new FunctionGraphExecutionOutputModel(client), + functionGraphCommit: new FunctionGraphCommitModel(client), + secretDefinition: new SecretDefinitionModel(client), + functionExecutionLog: new FunctionExecutionLogModel(client), + functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), + functionGraph: new FunctionGraphModel(client), + orgFunctionInvocation: new OrgFunctionInvocationModel(client), + functionInvocation: new FunctionInvocationModel(client), + functionGraphExecution: new FunctionGraphExecutionModel(client), + functionDefinition: new FunctionDefinitionModel(client), + query: createQueryOperations(client), + mutation: createMutationOperations(client), + }; +} diff --git a/sdk/constructive-react/src/compute/orm/input-types.ts b/sdk/constructive-react/src/compute/orm/input-types.ts new file mode 100644 index 0000000000..f88c3e77d1 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/input-types.ts @@ -0,0 +1,4706 @@ +/** + * GraphQL types for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// ============ Scalar Filter Types ============ +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: Record; + containedBy?: Record; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containsOrEqualTo?: string; + containedBy?: string; + containedByOrEqualTo?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +// ============ Custom Scalar Types ============ +export type Base64EncodedBinary = unknown; +export type FunctionRequirement = unknown; +// ============ Entity Types ============ +export interface GetAllRecord { + path?: string[] | null; + data?: Record | null; +} +/** Join table binding function definitions to API endpoints with per-binding alias and config */ +export interface FunctionApiBinding { + id: string; + /** Function definition this binding belongs to */ + functionDefinitionId?: string | null; + /** API endpoint this function is bound to */ + apiId?: string | null; + /** Binding alias (e.g. default, staging, production) */ + alias?: string | null; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: Record | null; +} +/** Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing */ +export interface FunctionDeployment { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Function definition being deployed to this namespace */ + functionDefinitionId?: string | null; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId?: string | null; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string | null; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string | null; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string | null; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number | null; + /** Container image override (NULL = inherit from function definition) */ + image?: string | null; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number | null; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number | null; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number | null; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number | null; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: Record | null; + /** Most recent provisioning or runtime error message */ + lastError?: string | null; + /** Timestamp of the most recent error */ + lastErrorAt?: string | null; + /** Cumulative error count for this deployment */ + errorCount?: number | null; + /** Key/value pairs for selecting and filtering deployments */ + labels?: Record | null; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Branch heads — mutable pointers into the commit chain */ +export interface FunctionGraphRef { + /** Unique ref identifier */ + id: string; + /** Ref name (e.g. HEAD, main) */ + name?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Store this ref belongs to */ + storeId?: string | null; + /** Commit this ref points to */ + commitId?: string | null; +} +/** Named stores — one per version-controlled tree (e.g. one graph, one definition set) */ +export interface FunctionGraphStore { + /** Unique store identifier */ + id: string; + /** Human-readable store name */ + name?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Current root object hash of this store */ + hash?: string | null; + /** Timestamp of store creation */ + createdAt?: string | null; +} +/** Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children */ +export interface FunctionGraphObject { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Ordered array of child object IDs */ + kids?: string[] | null; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[] | null; + /** Payload data for this object node */ + data?: Record | null; + /** Timestamp of object creation */ + createdAt?: string | null; +} +/** Deployment lifecycle events — audit log of provisioning, scaling, and failure events */ +export interface FunctionDeploymentEvent { + /** Event timestamp (partition key) */ + createdAt?: string | null; + /** Unique event identifier */ + id: string; + /** Deployment this event belongs to */ + deploymentId?: string | null; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType?: string | null; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string | null; + /** Human-readable description of the event */ + message?: string | null; + /** Structured context (old/new values, error details, etc.) */ + metadata?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Function execution logs — structured console output per invocation */ +export interface OrgFunctionExecutionLog { + /** Log entry timestamp (partition key) */ + createdAt?: string | null; + /** Unique log entry identifier */ + id: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string | null; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string | null; + /** Log severity: debug, info, warn, error */ + logLevel?: string | null; + /** Log message text */ + message?: string | null; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record | null; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string | null; +} +/** Content-addressed store for execution outputs — hash-referenced from node_outputs */ +export interface FunctionGraphExecutionOutput { + /** Timestamp of output creation */ + createdAt?: string | null; + /** Unique execution output identifier */ + id: string; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash?: Base64EncodedBinary | null; + /** The actual output payload from a completed node */ + data?: Record | null; +} +/** Commit history — each commit snapshots a tree root for a store */ +export interface FunctionGraphCommit { + /** Unique commit identifier */ + id: string; + /** Optional commit message */ + message?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Store this commit belongs to */ + storeId?: string | null; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[] | null; + /** User who authored the changes */ + authorId?: string | null; + /** User who committed (may differ from author) */ + committerId?: string | null; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string | null; + /** Commit timestamp */ + date?: string | null; +} +/** Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. */ +export interface SecretDefinition { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Secret name (must match app_secrets.name for resolution) */ + name?: string | null; + /** Human-readable description of what this secret is used for */ + description?: string | null; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean | null; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: Record | null; + /** Freeform metadata annotations for secret definitions */ + annotations?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Function execution logs — structured console output per invocation */ +export interface FunctionExecutionLog { + /** Log entry timestamp (partition key) */ + createdAt?: string | null; + /** Unique log entry identifier */ + id: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string | null; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string | null; + /** Log severity: debug, info, warn, error */ + logLevel?: string | null; + /** Log message text */ + message?: string | null; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record | null; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Per-node execution state — tracks individual node lifecycle for debugging */ +export interface FunctionGraphExecutionNodeState { + /** Timestamp of node state creation (partition key) */ + createdAt?: string | null; + /** Unique node state identifier */ + id: string; + /** FK to the parent graph execution */ + executionId?: string | null; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName?: string | null; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[] | null; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string | null; + /** Timestamp when the node began executing */ + startedAt?: string | null; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string | null; + /** Machine-readable error code when status = failed */ + errorCode?: string | null; + /** Human-readable error description when status = failed */ + errorMessage?: string | null; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string | null; +} +/** Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store */ +export interface FunctionGraph { + /** Unique graph identifier */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Graph store (Merkle store) holding the graph definition */ + storeId?: string | null; + /** Entity context (org/team) for scoped billing */ + entityId?: string | null; + /** Evaluator/runtime context (function, js, sql, system) */ + context?: string | null; + /** Graph name (unique per database) */ + name?: string | null; + /** Human-readable description of the graph */ + description?: string | null; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string | null; + /** Whether graph passes structural validation */ + isValid?: boolean | null; + /** Array of validation error objects when is_valid = false */ + validationErrors?: Record | null; + /** Actor who created this graph */ + createdBy?: string | null; + /** Timestamp of graph creation */ + createdAt?: string | null; + /** Timestamp of last modification */ + updatedAt?: string | null; +} +/** Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. */ +export interface OrgFunctionInvocation { + /** Invocation creation timestamp (partition key) */ + createdAt?: string | null; + /** Unique invocation identifier */ + id: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string | null; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string | null; + /** Function input payload */ + payload?: Record | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Function return value (success) or structured error (failure) */ + result?: Record | null; + /** Error message when status is failed */ + error?: string | null; + /** Wall-clock execution time in milliseconds */ + durationMs?: number | null; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string | null; + /** When execution started */ + startedAt?: string | null; + /** When execution completed */ + completedAt?: string | null; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string | null; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string | null; +} +/** Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. */ +export interface FunctionInvocation { + /** Invocation creation timestamp (partition key) */ + createdAt?: string | null; + /** Unique invocation identifier */ + id: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string | null; + /** Function input payload */ + payload?: Record | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Function return value (success) or structured error (failure) */ + result?: Record | null; + /** Error message when status is failed */ + error?: string | null; + /** Wall-clock execution time in milliseconds */ + durationMs?: number | null; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string | null; + /** When execution started */ + startedAt?: string | null; + /** When execution completed */ + completedAt?: string | null; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string | null; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string | null; +} +/** Ephemeral execution state for flow graph evaluation */ +export interface FunctionGraphExecution { + /** Execution start timestamp */ + startedAt?: string | null; + /** Unique execution identifier */ + id: string; + /** FK to the graph definition being executed */ + graphId?: string | null; + /** Parent function_invocations row (for metering) */ + invocationId?: string | null; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** Entity context (org/team) for scoped billing */ + entityId?: string | null; + /** Target output boundary node name to resolve */ + outputNode?: string | null; + /** Target output port name (default: value) */ + outputPort?: string | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Initial inputs provided at invocation time */ + inputPayload?: Record | null; + /** Final result extracted from terminal output node */ + outputPayload?: Record | null; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: Record | null; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: Record | null; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number | null; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string | null; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string | null; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string | null; + /** Number of evaluate_step ticks executed */ + tickCount?: number | null; + /** Execution completion timestamp */ + completedAt?: string | null; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number | null; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number | null; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string | null; + /** Machine-readable error code when status = failed */ + errorCode?: string | null; + /** Human-readable error description when status = failed */ + errorMessage?: string | null; +} +/** Function definitions — registered cloud functions with routing, queue, and retry configuration */ +export interface FunctionDefinition { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope?: string | null; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name?: string | null; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier?: string | null; + /** Human-readable description of what this function does */ + description?: string | null; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean | null; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number | null; + /** Job priority (lower = higher priority) */ + priority?: number | null; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string | null; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string | null; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string | null; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number | null; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number | null; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number | null; + /** Knative request timeout in seconds */ + timeoutSeconds?: number | null; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: Record | null; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean | null; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirement[] | null; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirement[] | null; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[] | null; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[] | null; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: Record | null; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: Record | null; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: Record | null; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean | null; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string | null; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string | null; +} +// ============ Relation Helper Types ============ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +// ============ Entity Relation Types ============ +export interface GetAllRecordRelations {} +export interface FunctionApiBindingRelations { + functionDefinition?: FunctionDefinition | null; +} +export interface FunctionDeploymentRelations { + functionDefinition?: FunctionDefinition | null; +} +export interface FunctionGraphRefRelations {} +export interface FunctionGraphStoreRelations {} +export interface FunctionGraphObjectRelations {} +export interface FunctionDeploymentEventRelations {} +export interface OrgFunctionExecutionLogRelations {} +export interface FunctionGraphExecutionOutputRelations {} +export interface FunctionGraphCommitRelations {} +export interface SecretDefinitionRelations {} +export interface FunctionExecutionLogRelations {} +export interface FunctionGraphExecutionNodeStateRelations {} +export interface FunctionGraphRelations {} +export interface OrgFunctionInvocationRelations {} +export interface FunctionInvocationRelations {} +export interface FunctionGraphExecutionRelations { + graph?: FunctionGraph | null; +} +export interface FunctionDefinitionRelations { + functionApiBindings?: ConnectionResult; + functionDeployments?: ConnectionResult; +} +// ============ Entity Types With Relations ============ +export type GetAllRecordWithRelations = GetAllRecord & GetAllRecordRelations; +export type FunctionApiBindingWithRelations = FunctionApiBinding & FunctionApiBindingRelations; +export type FunctionDeploymentWithRelations = FunctionDeployment & FunctionDeploymentRelations; +export type FunctionGraphRefWithRelations = FunctionGraphRef & FunctionGraphRefRelations; +export type FunctionGraphStoreWithRelations = FunctionGraphStore & FunctionGraphStoreRelations; +export type FunctionGraphObjectWithRelations = FunctionGraphObject & FunctionGraphObjectRelations; +export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & + FunctionDeploymentEventRelations; +export type OrgFunctionExecutionLogWithRelations = OrgFunctionExecutionLog & + OrgFunctionExecutionLogRelations; +export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & + FunctionGraphExecutionOutputRelations; +export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGraphCommitRelations; +export type SecretDefinitionWithRelations = SecretDefinition & SecretDefinitionRelations; +export type FunctionExecutionLogWithRelations = FunctionExecutionLog & + FunctionExecutionLogRelations; +export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & + FunctionGraphExecutionNodeStateRelations; +export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; +export type OrgFunctionInvocationWithRelations = OrgFunctionInvocation & + OrgFunctionInvocationRelations; +export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; +export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & + FunctionGraphExecutionRelations; +export type FunctionDefinitionWithRelations = FunctionDefinition & FunctionDefinitionRelations; +// ============ Entity Select Types ============ +export type GetAllRecordSelect = { + path?: boolean; + data?: boolean; +}; +export type FunctionApiBindingSelect = { + id?: boolean; + functionDefinitionId?: boolean; + apiId?: boolean; + alias?: boolean; + config?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; +}; +export type FunctionDeploymentSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + functionDefinitionId?: boolean; + namespaceId?: boolean; + status?: boolean; + serviceUrl?: boolean; + serviceName?: boolean; + revision?: boolean; + image?: boolean; + concurrency?: boolean; + scaleMin?: boolean; + scaleMax?: boolean; + timeoutSeconds?: boolean; + resources?: boolean; + lastError?: boolean; + lastErrorAt?: boolean; + errorCount?: boolean; + labels?: boolean; + annotations?: boolean; + databaseId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; +}; +export type FunctionGraphRefSelect = { + id?: boolean; + name?: boolean; + databaseId?: boolean; + storeId?: boolean; + commitId?: boolean; +}; +export type FunctionGraphStoreSelect = { + id?: boolean; + name?: boolean; + databaseId?: boolean; + hash?: boolean; + createdAt?: boolean; +}; +export type FunctionGraphObjectSelect = { + id?: boolean; + databaseId?: boolean; + kids?: boolean; + ktree?: boolean; + data?: boolean; + createdAt?: boolean; +}; +export type FunctionDeploymentEventSelect = { + createdAt?: boolean; + id?: boolean; + deploymentId?: boolean; + eventType?: boolean; + actorId?: boolean; + message?: boolean; + metadata?: boolean; + databaseId?: boolean; +}; +export type OrgFunctionExecutionLogSelect = { + createdAt?: boolean; + id?: boolean; + invocationId?: boolean; + taskIdentifier?: boolean; + logLevel?: boolean; + message?: boolean; + metadata?: boolean; + actorId?: boolean; +}; +export type FunctionGraphExecutionOutputSelect = { + createdAt?: boolean; + id?: boolean; + databaseId?: boolean; + hash?: boolean; + data?: boolean; +}; +export type FunctionGraphCommitSelect = { + id?: boolean; + message?: boolean; + databaseId?: boolean; + storeId?: boolean; + parentIds?: boolean; + authorId?: boolean; + committerId?: boolean; + treeId?: boolean; + date?: boolean; +}; +export type SecretDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + name?: boolean; + description?: boolean; + isBuiltIn?: boolean; + labels?: boolean; + annotations?: boolean; + databaseId?: boolean; +}; +export type FunctionExecutionLogSelect = { + createdAt?: boolean; + id?: boolean; + invocationId?: boolean; + taskIdentifier?: boolean; + logLevel?: boolean; + message?: boolean; + metadata?: boolean; + actorId?: boolean; + databaseId?: boolean; +}; +export type FunctionGraphExecutionNodeStateSelect = { + createdAt?: boolean; + id?: boolean; + executionId?: boolean; + databaseId?: boolean; + nodeName?: boolean; + nodePath?: boolean; + status?: boolean; + startedAt?: boolean; + completedAt?: boolean; + errorCode?: boolean; + errorMessage?: boolean; + outputId?: boolean; +}; +export type FunctionGraphSelect = { + id?: boolean; + databaseId?: boolean; + storeId?: boolean; + entityId?: boolean; + context?: boolean; + name?: boolean; + description?: boolean; + definitionsCommitId?: boolean; + isValid?: boolean; + validationErrors?: boolean; + createdBy?: boolean; + createdAt?: boolean; + updatedAt?: boolean; +}; +export type OrgFunctionInvocationSelect = { + createdAt?: boolean; + id?: boolean; + actorId?: boolean; + taskIdentifier?: boolean; + payload?: boolean; + status?: boolean; + result?: boolean; + error?: boolean; + durationMs?: boolean; + jobId?: boolean; + startedAt?: boolean; + completedAt?: boolean; + parentInvocationId?: boolean; + graphExecutionId?: boolean; +}; +export type FunctionInvocationSelect = { + createdAt?: boolean; + id?: boolean; + actorId?: boolean; + databaseId?: boolean; + taskIdentifier?: boolean; + payload?: boolean; + status?: boolean; + result?: boolean; + error?: boolean; + durationMs?: boolean; + jobId?: boolean; + startedAt?: boolean; + completedAt?: boolean; + parentInvocationId?: boolean; + graphExecutionId?: boolean; +}; +export type FunctionGraphExecutionSelect = { + startedAt?: boolean; + id?: boolean; + graphId?: boolean; + invocationId?: boolean; + databaseId?: boolean; + entityId?: boolean; + outputNode?: boolean; + outputPort?: boolean; + status?: boolean; + inputPayload?: boolean; + outputPayload?: boolean; + nodeOutputs?: boolean; + executionPlan?: boolean; + currentWave?: boolean; + parentExecutionId?: boolean; + parentNodeName?: boolean; + definitionsCommitId?: boolean; + tickCount?: boolean; + completedAt?: boolean; + maxTicks?: boolean; + maxPendingJobs?: boolean; + timeoutAt?: boolean; + errorCode?: boolean; + errorMessage?: boolean; + graph?: { + select: FunctionGraphSelect; + }; +}; +export type FunctionDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + scope?: boolean; + name?: boolean; + taskIdentifier?: boolean; + description?: boolean; + isInvocable?: boolean; + maxAttempts?: boolean; + priority?: boolean; + queueName?: boolean; + runtime?: boolean; + image?: boolean; + concurrency?: boolean; + scaleMin?: boolean; + scaleMax?: boolean; + timeoutSeconds?: boolean; + resources?: boolean; + isBuiltIn?: boolean; + requiredSecrets?: boolean; + requiredConfigs?: boolean; + requiredBuckets?: boolean; + requiredModels?: boolean; + inputs?: boolean; + outputs?: boolean; + props?: boolean; + volatile?: boolean; + icon?: boolean; + category?: boolean; + functionApiBindings?: { + select: FunctionApiBindingSelect; + first?: number; + filter?: FunctionApiBindingFilter; + orderBy?: FunctionApiBindingOrderBy[]; + }; + functionDeployments?: { + select: FunctionDeploymentSelect; + first?: number; + filter?: FunctionDeploymentFilter; + orderBy?: FunctionDeploymentOrderBy[]; + }; +}; +// ============ Table Filter Types ============ +export interface GetAllRecordFilter { + path?: StringListFilter; + data?: JSONFilter; + and?: GetAllRecordFilter[]; + or?: GetAllRecordFilter[]; + not?: GetAllRecordFilter; +} +export interface FunctionApiBindingFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `apiId` field. */ + apiId?: UUIDFilter; + /** Filter by the object’s `alias` field. */ + alias?: StringFilter; + /** Filter by the object’s `config` field. */ + config?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionApiBindingFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionApiBindingFilter[]; + /** Negates the expression. */ + not?: FunctionApiBindingFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +export interface FunctionDeploymentFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `serviceName` field. */ + serviceName?: StringFilter; + /** Filter by the object’s `revision` field. */ + revision?: IntFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `lastError` field. */ + lastError?: StringFilter; + /** Filter by the object’s `lastErrorAt` field. */ + lastErrorAt?: DatetimeFilter; + /** Filter by the object’s `errorCount` field. */ + errorCount?: IntFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +export interface FunctionGraphRefFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `commitId` field. */ + commitId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphRefFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphRefFilter[]; + /** Negates the expression. */ + not?: FunctionGraphRefFilter; +} +export interface FunctionGraphStoreFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphStoreFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphStoreFilter[]; + /** Negates the expression. */ + not?: FunctionGraphStoreFilter; +} +export interface FunctionGraphObjectFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `kids` field. */ + kids?: UUIDListFilter; + /** Filter by the object’s `ktree` field. */ + ktree?: StringListFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphObjectFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphObjectFilter[]; + /** Negates the expression. */ + not?: FunctionGraphObjectFilter; +} +export interface FunctionDeploymentEventFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `deploymentId` field. */ + deploymentId?: UUIDFilter; + /** Filter by the object’s `eventType` field. */ + eventType?: StringFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentEventFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentEventFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentEventFilter; +} +export interface OrgFunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: OrgFunctionExecutionLogFilter; +} +export interface FunctionGraphExecutionOutputFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: Base64EncodedBinaryFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionOutputFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionOutputFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionOutputFilter; +} +export interface FunctionGraphCommitFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `parentIds` field. */ + parentIds?: UUIDListFilter; + /** Filter by the object’s `authorId` field. */ + authorId?: UUIDFilter; + /** Filter by the object’s `committerId` field. */ + committerId?: UUIDFilter; + /** Filter by the object’s `treeId` field. */ + treeId?: UUIDFilter; + /** Filter by the object’s `date` field. */ + date?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphCommitFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphCommitFilter[]; + /** Negates the expression. */ + not?: FunctionGraphCommitFilter; +} +export interface SecretDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: SecretDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: SecretDefinitionFilter[]; + /** Negates the expression. */ + not?: SecretDefinitionFilter; +} +export interface FunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: FunctionExecutionLogFilter; +} +export interface FunctionGraphExecutionNodeStateFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `executionId` field. */ + executionId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `nodeName` field. */ + nodeName?: StringFilter; + /** Filter by the object’s `nodePath` field. */ + nodePath?: StringListFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Filter by the object’s `outputId` field. */ + outputId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionNodeStateFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionNodeStateFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionNodeStateFilter; +} +export interface FunctionGraphFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `context` field. */ + context?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `isValid` field. */ + isValid?: BooleanFilter; + /** Filter by the object’s `validationErrors` field. */ + validationErrors?: JSONFilter; + /** Filter by the object’s `createdBy` field. */ + createdBy?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphFilter[]; + /** Negates the expression. */ + not?: FunctionGraphFilter; +} +export interface OrgFunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionInvocationFilter[]; + /** Negates the expression. */ + not?: OrgFunctionInvocationFilter; +} +export interface FunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionInvocationFilter[]; + /** Negates the expression. */ + not?: FunctionInvocationFilter; +} +export interface FunctionGraphExecutionFilter { + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `graphId` field. */ + graphId?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `outputNode` field. */ + outputNode?: StringFilter; + /** Filter by the object’s `outputPort` field. */ + outputPort?: StringFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `inputPayload` field. */ + inputPayload?: JSONFilter; + /** Filter by the object’s `outputPayload` field. */ + outputPayload?: JSONFilter; + /** Filter by the object’s `nodeOutputs` field. */ + nodeOutputs?: JSONFilter; + /** Filter by the object’s `executionPlan` field. */ + executionPlan?: JSONFilter; + /** Filter by the object’s `currentWave` field. */ + currentWave?: IntFilter; + /** Filter by the object’s `parentExecutionId` field. */ + parentExecutionId?: UUIDFilter; + /** Filter by the object’s `parentNodeName` field. */ + parentNodeName?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `tickCount` field. */ + tickCount?: IntFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `maxTicks` field. */ + maxTicks?: IntFilter; + /** Filter by the object’s `maxPendingJobs` field. */ + maxPendingJobs?: IntFilter; + /** Filter by the object’s `timeoutAt` field. */ + timeoutAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionFilter; + /** Filter by the object’s `graph` relation. */ + graph?: FunctionGraphFilter; +} +export interface FunctionDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `runtime` field. */ + runtime?: StringFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `requiredBuckets` field. */ + requiredBuckets?: StringListFilter; + /** Filter by the object’s `requiredModels` field. */ + requiredModels?: StringListFilter; + /** Filter by the object’s `inputs` field. */ + inputs?: JSONFilter; + /** Filter by the object’s `outputs` field. */ + outputs?: JSONFilter; + /** Filter by the object’s `props` field. */ + props?: JSONFilter; + /** Filter by the object’s `volatile` field. */ + volatile?: BooleanFilter; + /** Filter by the object’s `icon` field. */ + icon?: StringFilter; + /** Filter by the object’s `category` field. */ + category?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: FunctionDefinitionFilter; + /** Filter by the object’s `functionApiBindings` relation. */ + functionApiBindings?: FunctionDefinitionToManyFunctionApiBindingFilter; + /** `functionApiBindings` exist. */ + functionApiBindingsExist?: boolean; + /** Filter by the object’s `functionDeployments` relation. */ + functionDeployments?: FunctionDefinitionToManyFunctionDeploymentFilter; + /** `functionDeployments` exist. */ + functionDeploymentsExist?: boolean; +} +// ============ OrderBy Types ============ +export type GetAllRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'DATA_ASC' + | 'DATA_DESC'; +export type FunctionApiBindingOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC'; +export type FunctionDeploymentOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionGraphRefOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC'; +export type FunctionGraphStoreOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +export type FunctionGraphObjectOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +export type FunctionDeploymentEventOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type OrgFunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC'; +export type FunctionGraphExecutionOutputOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'DATA_ASC' + | 'DATA_DESC'; +export type FunctionGraphCommitOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC'; +export type SecretDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionGraphExecutionNodeStateOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC'; +export type FunctionGraphOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgFunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +export type FunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +export type FunctionGraphExecutionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC'; +export type FunctionDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_INVOCABLE_ASC' + | 'IS_INVOCABLE_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC'; +// ============ CRUD Input Types ============ +export interface CreateGetAllRecordInput { + clientMutationId?: string; + getAllRecord: { + path?: string[]; + data?: Record; + }; +} +export interface GetAllRecordPatch { + path?: string[] | null; + data?: Record | null; +} +export interface UpdateGetAllRecordInput { + clientMutationId?: string; + id: string; + getAllRecordPatch: GetAllRecordPatch; +} +export interface DeleteGetAllRecordInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionApiBindingInput { + clientMutationId?: string; + functionApiBinding: { + functionDefinitionId: string; + apiId: string; + alias?: string; + config?: Record; + }; +} +export interface FunctionApiBindingPatch { + functionDefinitionId?: string | null; + apiId?: string | null; + alias?: string | null; + config?: Record | null; +} +export interface UpdateFunctionApiBindingInput { + clientMutationId?: string; + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; +} +export interface DeleteFunctionApiBindingInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDeploymentInput { + clientMutationId?: string; + functionDeployment: { + functionDefinitionId: string; + namespaceId: string; + status?: string; + serviceUrl?: string; + serviceName?: string; + revision?: number; + image?: string; + concurrency?: number; + scaleMin?: number; + scaleMax?: number; + timeoutSeconds?: number; + resources?: Record; + lastError?: string; + lastErrorAt?: string; + errorCount?: number; + labels?: Record; + annotations?: Record; + databaseId: string; + }; +} +export interface FunctionDeploymentPatch { + functionDefinitionId?: string | null; + namespaceId?: string | null; + status?: string | null; + serviceUrl?: string | null; + serviceName?: string | null; + revision?: number | null; + image?: string | null; + concurrency?: number | null; + scaleMin?: number | null; + scaleMax?: number | null; + timeoutSeconds?: number | null; + resources?: Record | null; + lastError?: string | null; + lastErrorAt?: string | null; + errorCount?: number | null; + labels?: Record | null; + annotations?: Record | null; + databaseId?: string | null; +} +export interface UpdateFunctionDeploymentInput { + clientMutationId?: string; + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; +} +export interface DeleteFunctionDeploymentInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphRefInput { + clientMutationId?: string; + functionGraphRef: { + name: string; + databaseId: string; + storeId: string; + commitId?: string; + }; +} +export interface FunctionGraphRefPatch { + name?: string | null; + databaseId?: string | null; + storeId?: string | null; + commitId?: string | null; +} +export interface UpdateFunctionGraphRefInput { + clientMutationId?: string; + id: string; + functionGraphRefPatch: FunctionGraphRefPatch; +} +export interface DeleteFunctionGraphRefInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphStoreInput { + clientMutationId?: string; + functionGraphStore: { + name: string; + databaseId: string; + hash?: string; + }; +} +export interface FunctionGraphStorePatch { + name?: string | null; + databaseId?: string | null; + hash?: string | null; +} +export interface UpdateFunctionGraphStoreInput { + clientMutationId?: string; + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; +} +export interface DeleteFunctionGraphStoreInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphObjectInput { + clientMutationId?: string; + functionGraphObject: { + databaseId: string; + kids?: string[]; + ktree?: string[]; + data?: Record; + }; +} +export interface FunctionGraphObjectPatch { + databaseId?: string | null; + kids?: string[] | null; + ktree?: string[] | null; + data?: Record | null; +} +export interface UpdateFunctionGraphObjectInput { + clientMutationId?: string; + id: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; +} +export interface DeleteFunctionGraphObjectInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDeploymentEventInput { + clientMutationId?: string; + functionDeploymentEvent: { + deploymentId: string; + eventType: string; + actorId?: string; + message?: string; + metadata?: Record; + databaseId: string; + }; +} +export interface FunctionDeploymentEventPatch { + deploymentId?: string | null; + eventType?: string | null; + actorId?: string | null; + message?: string | null; + metadata?: Record | null; + databaseId?: string | null; +} +export interface UpdateFunctionDeploymentEventInput { + clientMutationId?: string; + id: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; +} +export interface DeleteFunctionDeploymentEventInput { + clientMutationId?: string; + id: string; +} +export interface CreateOrgFunctionExecutionLogInput { + clientMutationId?: string; + orgFunctionExecutionLog: { + invocationId?: string; + taskIdentifier?: string; + logLevel?: string; + message: string; + metadata?: Record; + actorId?: string; + }; +} +export interface OrgFunctionExecutionLogPatch { + invocationId?: string | null; + taskIdentifier?: string | null; + logLevel?: string | null; + message?: string | null; + metadata?: Record | null; + actorId?: string | null; +} +export interface UpdateOrgFunctionExecutionLogInput { + clientMutationId?: string; + id: string; + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; +} +export interface DeleteOrgFunctionExecutionLogInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + functionGraphExecutionOutput: { + databaseId: string; + hash: Base64EncodedBinary; + data: Record; + }; +} +export interface FunctionGraphExecutionOutputPatch { + databaseId?: string | null; + hash?: Base64EncodedBinary | null; + data?: Record | null; +} +export interface UpdateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + id: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; +} +export interface DeleteFunctionGraphExecutionOutputInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphCommitInput { + clientMutationId?: string; + functionGraphCommit: { + message?: string; + databaseId: string; + storeId: string; + parentIds?: string[]; + authorId?: string; + committerId?: string; + treeId?: string; + date?: string; + }; +} +export interface FunctionGraphCommitPatch { + message?: string | null; + databaseId?: string | null; + storeId?: string | null; + parentIds?: string[] | null; + authorId?: string | null; + committerId?: string | null; + treeId?: string | null; + date?: string | null; +} +export interface UpdateFunctionGraphCommitInput { + clientMutationId?: string; + id: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; +} +export interface DeleteFunctionGraphCommitInput { + clientMutationId?: string; + id: string; +} +export interface CreateSecretDefinitionInput { + clientMutationId?: string; + secretDefinition: { + name: string; + description?: string; + isBuiltIn?: boolean; + labels?: Record; + annotations?: Record; + databaseId: string; + }; +} +export interface SecretDefinitionPatch { + name?: string | null; + description?: string | null; + isBuiltIn?: boolean | null; + labels?: Record | null; + annotations?: Record | null; + databaseId?: string | null; +} +export interface UpdateSecretDefinitionInput { + clientMutationId?: string; + id: string; + secretDefinitionPatch: SecretDefinitionPatch; +} +export interface DeleteSecretDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionExecutionLogInput { + clientMutationId?: string; + functionExecutionLog: { + invocationId?: string; + taskIdentifier?: string; + logLevel?: string; + message: string; + metadata?: Record; + actorId?: string; + databaseId: string; + }; +} +export interface FunctionExecutionLogPatch { + invocationId?: string | null; + taskIdentifier?: string | null; + logLevel?: string | null; + message?: string | null; + metadata?: Record | null; + actorId?: string | null; + databaseId?: string | null; +} +export interface UpdateFunctionExecutionLogInput { + clientMutationId?: string; + id: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; +} +export interface DeleteFunctionExecutionLogInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + functionGraphExecutionNodeState: { + executionId: string; + databaseId: string; + nodeName: string; + nodePath?: string[]; + status?: string; + startedAt?: string; + completedAt?: string; + errorCode?: string; + errorMessage?: string; + outputId?: string; + }; +} +export interface FunctionGraphExecutionNodeStatePatch { + executionId?: string | null; + databaseId?: string | null; + nodeName?: string | null; + nodePath?: string[] | null; + status?: string | null; + startedAt?: string | null; + completedAt?: string | null; + errorCode?: string | null; + errorMessage?: string | null; + outputId?: string | null; +} +export interface UpdateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + id: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; +} +export interface DeleteFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphInput { + clientMutationId?: string; + functionGraph: { + databaseId: string; + storeId: string; + entityId: string; + context?: string; + name?: string; + description?: string; + definitionsCommitId: string; + isValid?: boolean; + validationErrors?: Record; + createdBy?: string; + }; +} +export interface FunctionGraphPatch { + databaseId?: string | null; + storeId?: string | null; + entityId?: string | null; + context?: string | null; + name?: string | null; + description?: string | null; + definitionsCommitId?: string | null; + isValid?: boolean | null; + validationErrors?: Record | null; + createdBy?: string | null; +} +export interface UpdateFunctionGraphInput { + clientMutationId?: string; + id: string; + functionGraphPatch: FunctionGraphPatch; +} +export interface DeleteFunctionGraphInput { + clientMutationId?: string; + id: string; +} +export interface CreateOrgFunctionInvocationInput { + clientMutationId?: string; + orgFunctionInvocation: { + actorId?: string; + taskIdentifier: string; + payload?: Record; + status?: string; + result?: Record; + error?: string; + durationMs?: number; + jobId?: string; + startedAt?: string; + completedAt?: string; + parentInvocationId?: string; + graphExecutionId?: string; + }; +} +export interface OrgFunctionInvocationPatch { + actorId?: string | null; + taskIdentifier?: string | null; + payload?: Record | null; + status?: string | null; + result?: Record | null; + error?: string | null; + durationMs?: number | null; + jobId?: string | null; + startedAt?: string | null; + completedAt?: string | null; + parentInvocationId?: string | null; + graphExecutionId?: string | null; +} +export interface UpdateOrgFunctionInvocationInput { + clientMutationId?: string; + id: string; + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; +} +export interface DeleteOrgFunctionInvocationInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionInvocationInput { + clientMutationId?: string; + functionInvocation: { + actorId?: string; + databaseId: string; + taskIdentifier: string; + payload?: Record; + status?: string; + result?: Record; + error?: string; + durationMs?: number; + jobId?: string; + startedAt?: string; + completedAt?: string; + parentInvocationId?: string; + graphExecutionId?: string; + }; +} +export interface FunctionInvocationPatch { + actorId?: string | null; + databaseId?: string | null; + taskIdentifier?: string | null; + payload?: Record | null; + status?: string | null; + result?: Record | null; + error?: string | null; + durationMs?: number | null; + jobId?: string | null; + startedAt?: string | null; + completedAt?: string | null; + parentInvocationId?: string | null; + graphExecutionId?: string | null; +} +export interface UpdateFunctionInvocationInput { + clientMutationId?: string; + id: string; + functionInvocationPatch: FunctionInvocationPatch; +} +export interface DeleteFunctionInvocationInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionInput { + clientMutationId?: string; + functionGraphExecution: { + startedAt?: string; + graphId: string; + invocationId?: string; + databaseId: string; + entityId?: string; + outputNode: string; + outputPort?: string; + status?: string; + inputPayload?: Record; + outputPayload?: Record; + nodeOutputs?: Record; + executionPlan?: Record; + currentWave?: number; + parentExecutionId?: string; + parentNodeName?: string; + definitionsCommitId?: string; + tickCount?: number; + completedAt?: string; + maxTicks?: number; + maxPendingJobs?: number; + timeoutAt?: string; + errorCode?: string; + errorMessage?: string; + }; +} +export interface FunctionGraphExecutionPatch { + startedAt?: string | null; + graphId?: string | null; + invocationId?: string | null; + databaseId?: string | null; + entityId?: string | null; + outputNode?: string | null; + outputPort?: string | null; + status?: string | null; + inputPayload?: Record | null; + outputPayload?: Record | null; + nodeOutputs?: Record | null; + executionPlan?: Record | null; + currentWave?: number | null; + parentExecutionId?: string | null; + parentNodeName?: string | null; + definitionsCommitId?: string | null; + tickCount?: number | null; + completedAt?: string | null; + maxTicks?: number | null; + maxPendingJobs?: number | null; + timeoutAt?: string | null; + errorCode?: string | null; + errorMessage?: string | null; +} +export interface UpdateFunctionGraphExecutionInput { + clientMutationId?: string; + id: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; +} +export interface DeleteFunctionGraphExecutionInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDefinitionInput { + clientMutationId?: string; + functionDefinition: { + scope: string; + name: string; + taskIdentifier: string; + description?: string; + isInvocable?: boolean; + maxAttempts?: number; + priority?: number; + queueName?: string; + runtime?: string; + image?: string; + concurrency?: number; + scaleMin?: number; + scaleMax?: number; + timeoutSeconds?: number; + resources?: Record; + isBuiltIn?: boolean; + requiredSecrets?: FunctionRequirementInput[]; + requiredConfigs?: FunctionRequirementInput[]; + requiredBuckets?: string[]; + requiredModels?: string[]; + inputs?: Record; + outputs?: Record; + props?: Record; + volatile?: boolean; + icon?: string; + category?: string; + }; +} +export interface FunctionDefinitionPatch { + scope?: string | null; + name?: string | null; + taskIdentifier?: string | null; + description?: string | null; + isInvocable?: boolean | null; + maxAttempts?: number | null; + priority?: number | null; + queueName?: string | null; + runtime?: string | null; + image?: string | null; + concurrency?: number | null; + scaleMin?: number | null; + scaleMax?: number | null; + timeoutSeconds?: number | null; + resources?: Record | null; + isBuiltIn?: boolean | null; + requiredSecrets?: FunctionRequirementInput[] | null; + requiredConfigs?: FunctionRequirementInput[] | null; + requiredBuckets?: string[] | null; + requiredModels?: string[] | null; + inputs?: Record | null; + outputs?: Record | null; + props?: Record | null; + volatile?: boolean | null; + icon?: string | null; + category?: string | null; +} +export interface UpdateFunctionDefinitionInput { + clientMutationId?: string; + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; +} +export interface DeleteFunctionDefinitionInput { + clientMutationId?: string; + id: string; +} +// ============ Connection Fields Map ============ +export const connectionFieldsMap = { + FunctionDefinition: { + functionApiBindings: 'FunctionApiBinding', + functionDeployments: 'FunctionDeployment', + }, +} as Record>; +// ============ Custom Input Types (from schema) ============ +export interface ValidateFunctionGraphInput { + clientMutationId?: string; + graphId?: string; +} +export interface InitEmptyRepoInput { + clientMutationId?: string; + sId?: string; + storeId?: string; +} +export interface SetDataAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: Record; +} +export interface ImportDefinitionsInput { + clientMutationId?: string; + graphId?: string; + sourceScopeId?: string; + sourceCommitId?: string; + contexts?: string[]; +} +export interface CopyGraphInput { + clientMutationId?: string; + databaseId?: string; + graphId?: string; + name?: string; +} +export interface SaveGraphInput { + clientMutationId?: string; + graphId?: string; + rootHash?: string; + message?: string; +} +export interface AddEdgeAndSaveInput { + clientMutationId?: string; + graphId?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + message?: string; +} +export interface AddNodeAndSaveInput { + clientMutationId?: string; + graphId?: string; + nodeName?: string; + nodeType?: string; + props?: Record; + meta?: Record; + message?: string; +} +export interface AddEdgeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + context?: string; + graphName?: string; +} +export interface AddNodeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + nodeName?: string; + nodeType?: string; + context?: string; + graphName?: string; + props?: Record; + meta?: Record; +} +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: Record; + context?: string; + description?: string; + entityId?: string; + createdBy?: string; + definitionsCommitId?: string; +} +export interface InsertNodeAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: Record; + kids?: string[]; + ktree?: string[]; +} +export interface StartExecutionInput { + clientMutationId?: string; + graphId?: string; + inputPayload?: Record; + outputNode?: string; + outputPort?: string; + maxTicks?: number; + maxPendingJobs?: number; + timeoutInterval?: IntervalInput; + parentExecutionId?: string; + parentNodeName?: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** A filter to be used against Base64EncodedBinary fields. All fields are combined with a logical ‘and.’ */ +export interface Base64EncodedBinaryFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: Base64EncodedBinary; + /** Not equal to the specified value. */ + notEqualTo?: Base64EncodedBinary; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: Base64EncodedBinary; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: Base64EncodedBinary; + /** Included in the specified list. */ + in?: Base64EncodedBinary[]; + /** Not included in the specified list. */ + notIn?: Base64EncodedBinary[]; +} +/** A filter to be used against many `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionApiBindingFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionApiBindingFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionApiBindingFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionApiBindingFilter; +} +/** A filter to be used against many `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionDeploymentFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionDeploymentFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionDeploymentFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionDeploymentFilter; +} +/** An input for mutations affecting `FunctionApiBinding` */ +export interface FunctionApiBindingInput { + id?: string; + /** Function definition this binding belongs to */ + functionDefinitionId: string; + /** API endpoint this function is bound to */ + apiId: string; + /** Binding alias (e.g. default, staging, production) */ + alias?: string; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: Record; +} +/** An input for mutations affecting `FunctionDeployment` */ +export interface FunctionDeploymentInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function definition being deployed to this namespace */ + functionDefinitionId: string; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId: string; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number; + /** Container image override (NULL = inherit from function definition) */ + image?: string; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: Record; + /** Most recent provisioning or runtime error message */ + lastError?: string; + /** Timestamp of the most recent error */ + lastErrorAt?: string; + /** Cumulative error count for this deployment */ + errorCount?: number; + /** Key/value pairs for selecting and filtering deployments */ + labels?: Record; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionGraphRef` */ +export interface FunctionGraphRefInput { + /** Unique ref identifier */ + id?: string; + /** Ref name (e.g. HEAD, main) */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this ref belongs to */ + storeId: string; + /** Commit this ref points to */ + commitId?: string; +} +/** An input for mutations affecting `FunctionGraphStore` */ +export interface FunctionGraphStoreInput { + /** Unique store identifier */ + id?: string; + /** Human-readable store name */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Current root object hash of this store */ + hash?: string; + /** Timestamp of store creation */ + createdAt?: string; +} +/** An input for mutations affecting `FunctionGraphObject` */ +export interface FunctionGraphObjectInput { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Ordered array of child object IDs */ + kids?: string[]; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[]; + /** Payload data for this object node */ + data?: Record; + /** Timestamp of object creation */ + createdAt?: string; +} +/** An input for mutations affecting `FunctionDeploymentEvent` */ +export interface FunctionDeploymentEventInput { + /** Event timestamp (partition key) */ + createdAt?: string; + /** Unique event identifier */ + id?: string; + /** Deployment this event belongs to */ + deploymentId: string; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType: string; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string; + /** Human-readable description of the event */ + message?: string; + /** Structured context (old/new values, error details, etc.) */ + metadata?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `OrgFunctionExecutionLog` */ +export interface OrgFunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; +} +/** An input for mutations affecting `FunctionGraphExecutionOutput` */ +export interface FunctionGraphExecutionOutputInput { + /** Timestamp of output creation */ + createdAt?: string; + /** Unique execution output identifier */ + id?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash: Base64EncodedBinary; + /** The actual output payload from a completed node */ + data: Record; +} +/** An input for mutations affecting `FunctionGraphCommit` */ +export interface FunctionGraphCommitInput { + /** Unique commit identifier */ + id?: string; + /** Optional commit message */ + message?: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this commit belongs to */ + storeId: string; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[]; + /** User who authored the changes */ + authorId?: string; + /** User who committed (may differ from author) */ + committerId?: string; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string; + /** Commit timestamp */ + date?: string; +} +/** An input for mutations affecting `SecretDefinition` */ +export interface SecretDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Secret name (must match app_secrets.name for resolution) */ + name: string; + /** Human-readable description of what this secret is used for */ + description?: string; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: Record; + /** Freeform metadata annotations for secret definitions */ + annotations?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionExecutionLog` */ +export interface FunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionGraphExecutionNodeState` */ +export interface FunctionGraphExecutionNodeStateInput { + /** Timestamp of node state creation (partition key) */ + createdAt?: string; + /** Unique node state identifier */ + id?: string; + /** FK to the parent graph execution */ + executionId: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName: string; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[]; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string; + /** Timestamp when the node began executing */ + startedAt?: string; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string; +} +/** An input for mutations affecting `OrgFunctionInvocation` */ +export interface OrgFunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: Record; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: Record; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +/** An input for mutations affecting `FunctionInvocation` */ +export interface FunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: Record; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: Record; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +/** An input for mutations affecting `FunctionGraphExecution` */ +export interface FunctionGraphExecutionInput { + /** Execution start timestamp */ + startedAt?: string; + /** Unique execution identifier */ + id?: string; + /** FK to the graph definition being executed */ + graphId: string; + /** Parent function_invocations row (for metering) */ + invocationId?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Entity context (org/team) for scoped billing */ + entityId?: string; + /** Target output boundary node name to resolve */ + outputNode: string; + /** Target output port name (default: value) */ + outputPort?: string; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Initial inputs provided at invocation time */ + inputPayload?: Record; + /** Final result extracted from terminal output node */ + outputPayload?: Record; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: Record; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: Record; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string; + /** Number of evaluate_step ticks executed */ + tickCount?: number; + /** Execution completion timestamp */ + completedAt?: string; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; +} +/** An input for mutations affecting `FunctionDefinition` */ +export interface FunctionDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope: string; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name: string; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier: string; + /** Human-readable description of what this function does */ + description?: string; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number; + /** Job priority (lower = higher priority) */ + priority?: number; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number; + /** Knative request timeout in seconds */ + timeoutSeconds?: number; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: Record; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirementInput[]; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirementInput[]; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[]; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[]; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: Record; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: Record; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: Record; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string; +} +/** An input for mutations affecting `FunctionRequirement` */ +export interface FunctionRequirementInput { + name?: string; + required?: boolean; +} +/** An interval of time that has passed where the smallest distinct unit is a second. */ +export interface IntervalInput { + /** + * A quantity of seconds. This is the only non-integer field, as all the other + * fields will dump their overflow into a smaller unit of time. Intervals don’t + * have a smaller unit than seconds. + */ + seconds?: number; + /** A quantity of minutes. */ + minutes?: number; + /** A quantity of hours. */ + hours?: number; + /** A quantity of days. */ + days?: number; + /** A quantity of months. */ + months?: number; + /** A quantity of years. */ + years?: number; +} +/** A filter to be used against `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionApiBindingFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `apiId` field. */ + apiId?: UUIDFilter; + /** Filter by the object’s `alias` field. */ + alias?: StringFilter; + /** Filter by the object’s `config` field. */ + config?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionApiBindingFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionApiBindingFilter[]; + /** Negates the expression. */ + not?: FunctionApiBindingFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDeploymentFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `serviceName` field. */ + serviceName?: StringFilter; + /** Filter by the object’s `revision` field. */ + revision?: IntFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `lastError` field. */ + lastError?: StringFilter; + /** Filter by the object’s `lastErrorAt` field. */ + lastErrorAt?: DatetimeFilter; + /** Filter by the object’s `errorCount` field. */ + errorCount?: IntFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against UUID fields. All fields are combined with a logical ‘and.’ */ +export interface UUIDFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; +} +/** A filter to be used against String fields. All fields are combined with a logical ‘and.’ */ +export interface StringFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; + /** Contains the specified string (case-sensitive). */ + includes?: string; + /** Does not contain the specified string (case-sensitive). */ + notIncludes?: string; + /** Contains the specified string (case-insensitive). */ + includesInsensitive?: string; + /** Does not contain the specified string (case-insensitive). */ + notIncludesInsensitive?: string; + /** Starts with the specified string (case-sensitive). */ + startsWith?: string; + /** Does not start with the specified string (case-sensitive). */ + notStartsWith?: string; + /** Starts with the specified string (case-insensitive). */ + startsWithInsensitive?: string; + /** Does not start with the specified string (case-insensitive). */ + notStartsWithInsensitive?: string; + /** Ends with the specified string (case-sensitive). */ + endsWith?: string; + /** Does not end with the specified string (case-sensitive). */ + notEndsWith?: string; + /** Ends with the specified string (case-insensitive). */ + endsWithInsensitive?: string; + /** Does not end with the specified string (case-insensitive). */ + notEndsWithInsensitive?: string; + /** Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + like?: string; + /** Does not match the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + notLike?: string; + /** Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + likeInsensitive?: string; + /** Does not match the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + notLikeInsensitive?: string; + /** Equal to the specified value (case-insensitive). */ + equalToInsensitive?: string; + /** Not equal to the specified value (case-insensitive). */ + notEqualToInsensitive?: string; + /** Not equal to the specified value, treating null like an ordinary value (case-insensitive). */ + distinctFromInsensitive?: string; + /** Equal to the specified value, treating null like an ordinary value (case-insensitive). */ + notDistinctFromInsensitive?: string; + /** Included in the specified list (case-insensitive). */ + inInsensitive?: string[]; + /** Not included in the specified list (case-insensitive). */ + notInInsensitive?: string[]; + /** Less than the specified value (case-insensitive). */ + lessThanInsensitive?: string; + /** Less than or equal to the specified value (case-insensitive). */ + lessThanOrEqualToInsensitive?: string; + /** Greater than the specified value (case-insensitive). */ + greaterThanInsensitive?: string; + /** Greater than or equal to the specified value (case-insensitive). */ + greaterThanOrEqualToInsensitive?: string; +} +/** A filter to be used against JSON fields. All fields are combined with a logical ‘and.’ */ +export interface JSONFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: Record; + /** Not equal to the specified value. */ + notEqualTo?: Record; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: Record; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: Record; + /** Included in the specified list. */ + in?: Record[]; + /** Not included in the specified list. */ + notIn?: Record[]; + /** Less than the specified value. */ + lessThan?: Record; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: Record; + /** Greater than the specified value. */ + greaterThan?: Record; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: Record; + /** Contains the specified JSON. */ + contains?: Record; + /** Contains the specified key. */ + containsKey?: string; + /** Contains all of the specified keys. */ + containsAllKeys?: string[]; + /** Contains any of the specified keys. */ + containsAnyKeys?: string[]; + /** Contained by the specified JSON. */ + containedBy?: Record; +} +/** A filter to be used against `FunctionDefinition` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `runtime` field. */ + runtime?: StringFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `requiredBuckets` field. */ + requiredBuckets?: StringListFilter; + /** Filter by the object’s `requiredModels` field. */ + requiredModels?: StringListFilter; + /** Filter by the object’s `inputs` field. */ + inputs?: JSONFilter; + /** Filter by the object’s `outputs` field. */ + outputs?: JSONFilter; + /** Filter by the object’s `props` field. */ + props?: JSONFilter; + /** Filter by the object’s `volatile` field. */ + volatile?: BooleanFilter; + /** Filter by the object’s `icon` field. */ + icon?: StringFilter; + /** Filter by the object’s `category` field. */ + category?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: FunctionDefinitionFilter; + /** Filter by the object’s `functionApiBindings` relation. */ + functionApiBindings?: FunctionDefinitionToManyFunctionApiBindingFilter; + /** `functionApiBindings` exist. */ + functionApiBindingsExist?: boolean; + /** Filter by the object’s `functionDeployments` relation. */ + functionDeployments?: FunctionDefinitionToManyFunctionDeploymentFilter; + /** `functionDeployments` exist. */ + functionDeploymentsExist?: boolean; +} +/** A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ */ +export interface DatetimeFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; +} +/** A filter to be used against Int fields. All fields are combined with a logical ‘and.’ */ +export interface IntFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: number; + /** Not equal to the specified value. */ + notEqualTo?: number; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: number; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: number; + /** Included in the specified list. */ + in?: number[]; + /** Not included in the specified list. */ + notIn?: number[]; + /** Less than the specified value. */ + lessThan?: number; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: number; + /** Greater than the specified value. */ + greaterThan?: number; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: number; +} +/** A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ */ +export interface BooleanFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: boolean; + /** Not equal to the specified value. */ + notEqualTo?: boolean; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: boolean; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: boolean; + /** Included in the specified list. */ + in?: boolean[]; + /** Not included in the specified list. */ + notIn?: boolean[]; + /** Less than the specified value. */ + lessThan?: boolean; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: boolean; + /** Greater than the specified value. */ + greaterThan?: boolean; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: boolean; +} +/** A filter to be used against String List fields. All fields are combined with a logical ‘and.’ */ +export interface StringListFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string[]; + /** Not equal to the specified value. */ + notEqualTo?: string[]; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string[]; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string[]; + /** Less than the specified value. */ + lessThan?: string[]; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string[]; + /** Greater than the specified value. */ + greaterThan?: string[]; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string[]; + /** Contains the specified list of values. */ + contains?: string[]; + /** Contained by the specified list of values. */ + containedBy?: string[]; + /** Overlaps the specified list of values. */ + overlaps?: string[]; + /** Any array item is equal to the specified value. */ + anyEqualTo?: string; + /** Any array item is not equal to the specified value. */ + anyNotEqualTo?: string; + /** Any array item is less than the specified value. */ + anyLessThan?: string; + /** Any array item is less than or equal to the specified value. */ + anyLessThanOrEqualTo?: string; + /** Any array item is greater than the specified value. */ + anyGreaterThan?: string; + /** Any array item is greater than or equal to the specified value. */ + anyGreaterThanOrEqualTo?: string; +} +// ============ Payload/Return Types (for custom operations) ============ +export interface ValidateFunctionGraphPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type ValidateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface InitEmptyRepoPayload { + clientMutationId?: string | null; +} +export type InitEmptyRepoPayloadSelect = { + clientMutationId?: boolean; +}; +export interface SetDataAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type SetDataAtPathPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ImportDefinitionsPayload { + clientMutationId?: string | null; +} +export type ImportDefinitionsPayloadSelect = { + clientMutationId?: boolean; +}; +export interface CopyGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CopyGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface SaveGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type SaveGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddEdgeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddEdgeAndSavePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddNodeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddNodeAndSavePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddEdgePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddEdgePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddNodePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddNodePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ImportGraphJsonPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type ImportGraphJsonPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface InsertNodeAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type InsertNodeAtPathPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface StartExecutionPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type StartExecutionPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +export type ProvisionBucketPayloadSelect = { + success?: boolean; + bucketName?: boolean; + accessType?: boolean; + provider?: boolean; + endpoint?: boolean; + error?: boolean; +}; +export interface CreateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was created by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type CreateFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface UpdateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was updated by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type UpdateFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface DeleteFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was deleted by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type DeleteFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface CreateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was created by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type CreateFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was updated by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type UpdateFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was deleted by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type DeleteFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface CreateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was created by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type CreateFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface UpdateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was updated by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type UpdateFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface DeleteFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was deleted by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type DeleteFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface CreateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was created by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type CreateFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface UpdateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was updated by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type UpdateFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface DeleteFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was deleted by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type DeleteFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface CreateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was created by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type CreateFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface UpdateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was updated by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type UpdateFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface DeleteFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was deleted by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type DeleteFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface CreateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was created by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type CreateFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was updated by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type UpdateFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was deleted by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type DeleteFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface CreateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was created by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type CreateOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface UpdateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was updated by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type UpdateOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface DeleteOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was deleted by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type DeleteOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was created by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type CreateFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was updated by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type UpdateFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was deleted by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type DeleteFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface CreateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was created by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type CreateFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface UpdateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was updated by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type UpdateFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface DeleteFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was deleted by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type DeleteFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface CreateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was created by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type CreateSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface UpdateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was updated by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type UpdateSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface DeleteSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was deleted by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type DeleteSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface CreateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was created by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type CreateFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface UpdateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was updated by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type UpdateFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface DeleteFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was deleted by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type DeleteFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was created by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type CreateFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was updated by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type UpdateFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was deleted by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type DeleteFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface CreateFunctionGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface UpdateFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was updated by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export type UpdateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + functionGraph?: { + select: FunctionGraphSelect; + }; + functionGraphEdge?: { + select: FunctionGraphEdgeSelect; + }; +}; +export interface DeleteFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was deleted by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export type DeleteFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + functionGraph?: { + select: FunctionGraphSelect; + }; + functionGraphEdge?: { + select: FunctionGraphEdgeSelect; + }; +}; +export interface CreateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was created by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type CreateOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface UpdateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was updated by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type UpdateOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface DeleteOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was deleted by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type DeleteOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface CreateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was created by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type CreateFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface UpdateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was updated by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type UpdateFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface DeleteFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was deleted by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type DeleteFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was created by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type CreateFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was updated by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type UpdateFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was deleted by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type DeleteFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface CreateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was created by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type CreateFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +export interface UpdateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was updated by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type UpdateFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +export interface DeleteFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was deleted by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type DeleteFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +/** A `FunctionApiBinding` edge in the connection. */ +export interface FunctionApiBindingEdge { + cursor?: string | null; + /** The `FunctionApiBinding` at the end of the edge. */ + node?: FunctionApiBinding | null; +} +export type FunctionApiBindingEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionApiBindingSelect; + }; +}; +/** A `FunctionDeployment` edge in the connection. */ +export interface FunctionDeploymentEdge { + cursor?: string | null; + /** The `FunctionDeployment` at the end of the edge. */ + node?: FunctionDeployment | null; +} +export type FunctionDeploymentEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentSelect; + }; +}; +/** A `FunctionGraphRef` edge in the connection. */ +export interface FunctionGraphRefEdge { + cursor?: string | null; + /** The `FunctionGraphRef` at the end of the edge. */ + node?: FunctionGraphRef | null; +} +export type FunctionGraphRefEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphRefSelect; + }; +}; +/** A `FunctionGraphStore` edge in the connection. */ +export interface FunctionGraphStoreEdge { + cursor?: string | null; + /** The `FunctionGraphStore` at the end of the edge. */ + node?: FunctionGraphStore | null; +} +export type FunctionGraphStoreEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphStoreSelect; + }; +}; +/** A `FunctionGraphObject` edge in the connection. */ +export interface FunctionGraphObjectEdge { + cursor?: string | null; + /** The `FunctionGraphObject` at the end of the edge. */ + node?: FunctionGraphObject | null; +} +export type FunctionGraphObjectEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphObjectSelect; + }; +}; +/** A `FunctionDeploymentEvent` edge in the connection. */ +export interface FunctionDeploymentEventEdge { + cursor?: string | null; + /** The `FunctionDeploymentEvent` at the end of the edge. */ + node?: FunctionDeploymentEvent | null; +} +export type FunctionDeploymentEventEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentEventSelect; + }; +}; +/** A `OrgFunctionExecutionLog` edge in the connection. */ +export interface OrgFunctionExecutionLogEdge { + cursor?: string | null; + /** The `OrgFunctionExecutionLog` at the end of the edge. */ + node?: OrgFunctionExecutionLog | null; +} +export type OrgFunctionExecutionLogEdgeSelect = { + cursor?: boolean; + node?: { + select: OrgFunctionExecutionLogSelect; + }; +}; +/** A `FunctionGraphExecutionOutput` edge in the connection. */ +export interface FunctionGraphExecutionOutputEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionOutput` at the end of the edge. */ + node?: FunctionGraphExecutionOutput | null; +} +export type FunctionGraphExecutionOutputEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionOutputSelect; + }; +}; +/** A `FunctionGraphCommit` edge in the connection. */ +export interface FunctionGraphCommitEdge { + cursor?: string | null; + /** The `FunctionGraphCommit` at the end of the edge. */ + node?: FunctionGraphCommit | null; +} +export type FunctionGraphCommitEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphCommitSelect; + }; +}; +/** A `SecretDefinition` edge in the connection. */ +export interface SecretDefinitionEdge { + cursor?: string | null; + /** The `SecretDefinition` at the end of the edge. */ + node?: SecretDefinition | null; +} +export type SecretDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: SecretDefinitionSelect; + }; +}; +/** A `FunctionExecutionLog` edge in the connection. */ +export interface FunctionExecutionLogEdge { + cursor?: string | null; + /** The `FunctionExecutionLog` at the end of the edge. */ + node?: FunctionExecutionLog | null; +} +export type FunctionExecutionLogEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionExecutionLogSelect; + }; +}; +/** A `FunctionGraphExecutionNodeState` edge in the connection. */ +export interface FunctionGraphExecutionNodeStateEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionNodeState` at the end of the edge. */ + node?: FunctionGraphExecutionNodeState | null; +} +export type FunctionGraphExecutionNodeStateEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionNodeStateSelect; + }; +}; +/** A `FunctionGraph` edge in the connection. */ +export interface FunctionGraphEdge { + cursor?: string | null; + /** The `FunctionGraph` at the end of the edge. */ + node?: FunctionGraph | null; +} +export type FunctionGraphEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphSelect; + }; +}; +/** A `OrgFunctionInvocation` edge in the connection. */ +export interface OrgFunctionInvocationEdge { + cursor?: string | null; + /** The `OrgFunctionInvocation` at the end of the edge. */ + node?: OrgFunctionInvocation | null; +} +export type OrgFunctionInvocationEdgeSelect = { + cursor?: boolean; + node?: { + select: OrgFunctionInvocationSelect; + }; +}; +/** A `FunctionInvocation` edge in the connection. */ +export interface FunctionInvocationEdge { + cursor?: string | null; + /** The `FunctionInvocation` at the end of the edge. */ + node?: FunctionInvocation | null; +} +export type FunctionInvocationEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionInvocationSelect; + }; +}; +/** A `FunctionGraphExecution` edge in the connection. */ +export interface FunctionGraphExecutionEdge { + cursor?: string | null; + /** The `FunctionGraphExecution` at the end of the edge. */ + node?: FunctionGraphExecution | null; +} +export type FunctionGraphExecutionEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionSelect; + }; +}; +/** A `FunctionDefinition` edge in the connection. */ +export interface FunctionDefinitionEdge { + cursor?: string | null; + /** The `FunctionDefinition` at the end of the edge. */ + node?: FunctionDefinition | null; +} +export type FunctionDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDefinitionSelect; + }; +}; diff --git a/sdk/constructive-react/src/compute/orm/models/functionApiBinding.ts b/sdk/constructive-react/src/compute/orm/models/functionApiBinding.ts new file mode 100644 index 0000000000..a98f9d2a06 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionApiBinding.ts @@ -0,0 +1,245 @@ +/** + * FunctionApiBinding model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionApiBinding, + FunctionApiBindingWithRelations, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, + CreateFunctionApiBindingInput, + UpdateFunctionApiBindingInput, + FunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionApiBindingModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBindings: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBindings', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBinding: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', + document, + variables, + transform: (data: { + functionApiBindings?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBinding: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', + document, + variables, + transform: (data: { + functionApiBindings?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionApiBinding', + 'createFunctionApiBinding', + 'functionApiBinding', + args.select, + args.data, + 'CreateFunctionApiBindingInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'createFunctionApiBinding', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionApiBinding', + 'updateFunctionApiBinding', + 'functionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdateFunctionApiBindingInput', + 'id', + 'functionApiBindingPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'updateFunctionApiBinding', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionApiBinding', + 'deleteFunctionApiBinding', + 'functionApiBinding', + { + id: args.where.id, + }, + 'DeleteFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'deleteFunctionApiBinding', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionDefinition.ts b/sdk/constructive-react/src/compute/orm/models/functionDefinition.ts new file mode 100644 index 0000000000..be6cb3ac27 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionDefinition.ts @@ -0,0 +1,245 @@ +/** + * FunctionDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDefinition, + FunctionDefinitionWithRelations, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, + CreateFunctionDefinitionInput, + UpdateFunctionDefinitionInput, + FunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinitions: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', + document, + variables, + transform: (data: { + functionDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', + document, + variables, + transform: (data: { + functionDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDefinition', + 'createFunctionDefinition', + 'functionDefinition', + args.select, + args.data, + 'CreateFunctionDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'createFunctionDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDefinition', + 'updateFunctionDefinition', + 'functionDefinition', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDefinitionInput', + 'id', + 'functionDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'updateFunctionDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDefinition', + 'deleteFunctionDefinition', + 'functionDefinition', + { + id: args.where.id, + }, + 'DeleteFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'deleteFunctionDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionDeployment.ts b/sdk/constructive-react/src/compute/orm/models/functionDeployment.ts new file mode 100644 index 0000000000..d54820ebba --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionDeployment.ts @@ -0,0 +1,245 @@ +/** + * FunctionDeployment model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeployment, + FunctionDeploymentWithRelations, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, + CreateFunctionDeploymentInput, + UpdateFunctionDeploymentInput, + FunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployments: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployments', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployment: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', + document, + variables, + transform: (data: { + functionDeployments?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployment: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', + document, + variables, + transform: (data: { + functionDeployments?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeployment', + 'createFunctionDeployment', + 'functionDeployment', + args.select, + args.data, + 'CreateFunctionDeploymentInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'createFunctionDeployment', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeployment', + 'updateFunctionDeployment', + 'functionDeployment', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentInput', + 'id', + 'functionDeploymentPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'updateFunctionDeployment', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeployment', + 'deleteFunctionDeployment', + 'functionDeployment', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'deleteFunctionDeployment', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionDeploymentEvent.ts b/sdk/constructive-react/src/compute/orm/models/functionDeploymentEvent.ts new file mode 100644 index 0000000000..6b95be6471 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionDeploymentEvent.ts @@ -0,0 +1,252 @@ +/** + * FunctionDeploymentEvent model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentEvent, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, + CreateFunctionDeploymentEventInput, + UpdateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentEventModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvents', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvent: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', + document, + variables, + transform: (data: { + functionDeploymentEvents?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvent: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', + document, + variables, + transform: (data: { + functionDeploymentEvents?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentEvent', + 'createFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.data, + 'CreateFunctionDeploymentEventInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'createFunctionDeploymentEvent', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentEvent', + 'updateFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentEventInput', + 'id', + 'functionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'updateFunctionDeploymentEvent', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentEvent', + 'deleteFunctionDeploymentEvent', + 'functionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'deleteFunctionDeploymentEvent', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionExecutionLog.ts b/sdk/constructive-react/src/compute/orm/models/functionExecutionLog.ts new file mode 100644 index 0000000000..a581eeab83 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionExecutionLog.ts @@ -0,0 +1,252 @@ +/** + * FunctionExecutionLog model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionExecutionLog, + FunctionExecutionLogWithRelations, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, + CreateFunctionExecutionLogInput, + UpdateFunctionExecutionLogInput, + FunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionExecutionLogModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLogs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', + document, + variables, + transform: (data: { + functionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', + document, + variables, + transform: (data: { + functionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionExecutionLog', + 'createFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.data, + 'CreateFunctionExecutionLogInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'createFunctionExecutionLog', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionExecutionLog', + 'updateFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateFunctionExecutionLogInput', + 'id', + 'functionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'updateFunctionExecutionLog', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionExecutionLog', + 'deleteFunctionExecutionLog', + 'functionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'deleteFunctionExecutionLog', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraph.ts b/sdk/constructive-react/src/compute/orm/models/functionGraph.ts new file mode 100644 index 0000000000..8355e31658 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraph.ts @@ -0,0 +1,245 @@ +/** + * FunctionGraph model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraph, + FunctionGraphWithRelations, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, + CreateFunctionGraphInput, + UpdateFunctionGraphInput, + FunctionGraphPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraphs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraph: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', + document, + variables, + transform: (data: { + functionGraphs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraph: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', + document, + variables, + transform: (data: { + functionGraphs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraph', + 'createFunctionGraph', + 'functionGraph', + args.select, + args.data, + 'CreateFunctionGraphInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'createFunctionGraph', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraph', + 'updateFunctionGraph', + 'functionGraph', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphInput', + 'id', + 'functionGraphPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'updateFunctionGraph', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraph', + 'deleteFunctionGraph', + 'functionGraph', + { + id: args.where.id, + }, + 'DeleteFunctionGraphInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'deleteFunctionGraph', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphCommit.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphCommit.ts new file mode 100644 index 0000000000..65426339ae --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphCommit.ts @@ -0,0 +1,250 @@ +/** + * FunctionGraphCommit model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphCommit, + FunctionGraphCommitWithRelations, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, + CreateFunctionGraphCommitInput, + UpdateFunctionGraphCommitInput, + FunctionGraphCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphCommitModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommits: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommits', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommit: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', + document, + variables, + transform: (data: { + functionGraphCommits?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommit: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', + document, + variables, + transform: (data: { + functionGraphCommits?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphCommit', + 'createFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.data, + 'CreateFunctionGraphCommitInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'createFunctionGraphCommit', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphCommit', + 'updateFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphCommitInput', + 'id', + 'functionGraphCommitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'updateFunctionGraphCommit', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphCommit', + 'deleteFunctionGraphCommit', + 'functionGraphCommit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphCommitInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'deleteFunctionGraphCommit', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphExecution.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphExecution.ts new file mode 100644 index 0000000000..36ba0d39b8 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphExecution.ts @@ -0,0 +1,252 @@ +/** + * FunctionGraphExecution model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecution, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, + CreateFunctionGraphExecutionInput, + UpdateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecutions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecution: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', + document, + variables, + transform: (data: { + functionGraphExecutions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecution: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', + document, + variables, + transform: (data: { + functionGraphExecutions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecution', + 'createFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.data, + 'CreateFunctionGraphExecutionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'createFunctionGraphExecution', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + startedAt: string; + }, + FunctionGraphExecutionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecution', + 'updateFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionInput', + 'id', + 'functionGraphExecutionPatch', + connectionFieldsMap, + { + startedAt: args.where.startedAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'updateFunctionGraphExecution', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + startedAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecution', + 'deleteFunctionGraphExecution', + 'functionGraphExecution', + { + id: args.where.id, + startedAt: args.where.startedAt, + }, + 'DeleteFunctionGraphExecutionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'deleteFunctionGraphExecution', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionNodeState.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionNodeState.ts new file mode 100644 index 0000000000..734317c006 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionNodeState.ts @@ -0,0 +1,278 @@ +/** + * FunctionGraphExecutionNodeState model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionNodeState, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, + CreateFunctionGraphExecutionNodeStateInput, + UpdateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionNodeStateModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeStates', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', + document, + variables, + transform: (data: { + functionGraphExecutionNodeStates?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', + document, + variables, + transform: (data: { + functionGraphExecutionNodeStates?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs< + S, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionNodeState', + 'createFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.data, + 'CreateFunctionGraphExecutionNodeStateInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'createFunctionGraphExecutionNodeState', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionNodeStatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionNodeState', + 'updateFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionNodeStateInput', + 'id', + 'functionGraphExecutionNodeStatePatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'updateFunctionGraphExecutionNodeState', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionNodeState', + 'deleteFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionNodeStateInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'deleteFunctionGraphExecutionNodeState', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionOutput.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionOutput.ts new file mode 100644 index 0000000000..c9a5085e5e --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphExecutionOutput.ts @@ -0,0 +1,266 @@ +/** + * FunctionGraphExecutionOutput model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionOutput, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, + CreateFunctionGraphExecutionOutputInput, + UpdateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionOutputModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutputs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', + document, + variables, + transform: (data: { + functionGraphExecutionOutputs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', + document, + variables, + transform: (data: { + functionGraphExecutionOutputs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionOutput', + 'createFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.data, + 'CreateFunctionGraphExecutionOutputInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'createFunctionGraphExecutionOutput', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionOutputPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionOutput', + 'updateFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionOutputInput', + 'id', + 'functionGraphExecutionOutputPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'updateFunctionGraphExecutionOutput', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionOutput', + 'deleteFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionOutputInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'deleteFunctionGraphExecutionOutput', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphObject.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphObject.ts new file mode 100644 index 0000000000..cf946855ac --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphObject.ts @@ -0,0 +1,236 @@ +/** + * FunctionGraphObject model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphObject, + FunctionGraphObjectWithRelations, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, + CreateFunctionGraphObjectInput, + UpdateFunctionGraphObjectInput, + FunctionGraphObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphObjectModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObjects: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObjects', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObject: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', + document, + variables, + transform: (data: { + functionGraphObjects?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphObject: data.functionGraphObjects?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObject: InferSelectResult | null; + }> { + const { document, variables } = buildFindOneDocument( + 'FunctionGraphObject', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', + document, + variables, + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphObject', + 'createFunctionGraphObject', + 'functionGraphObject', + args.select, + args.data, + 'CreateFunctionGraphObjectInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'createFunctionGraphObject', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphObject', + 'updateFunctionGraphObject', + 'functionGraphObject', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphObjectInput', + 'id', + 'functionGraphObjectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'updateFunctionGraphObject', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphObject', + 'deleteFunctionGraphObject', + 'functionGraphObject', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphObjectInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'deleteFunctionGraphObject', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphRef.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphRef.ts new file mode 100644 index 0000000000..22d8769625 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphRef.ts @@ -0,0 +1,250 @@ +/** + * FunctionGraphRef model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphRef, + FunctionGraphRefWithRelations, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, + CreateFunctionGraphRefInput, + UpdateFunctionGraphRefInput, + FunctionGraphRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphRefModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRefs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRefs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRef: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', + document, + variables, + transform: (data: { + functionGraphRefs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRef: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', + document, + variables, + transform: (data: { + functionGraphRefs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphRef', + 'createFunctionGraphRef', + 'functionGraphRef', + args.select, + args.data, + 'CreateFunctionGraphRefInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'createFunctionGraphRef', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphRef', + 'updateFunctionGraphRef', + 'functionGraphRef', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphRefInput', + 'id', + 'functionGraphRefPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'updateFunctionGraphRef', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphRef', + 'deleteFunctionGraphRef', + 'functionGraphRef', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphRefInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'deleteFunctionGraphRef', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionGraphStore.ts b/sdk/constructive-react/src/compute/orm/models/functionGraphStore.ts new file mode 100644 index 0000000000..6d1f384449 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionGraphStore.ts @@ -0,0 +1,245 @@ +/** + * FunctionGraphStore model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphStore, + FunctionGraphStoreWithRelations, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, + CreateFunctionGraphStoreInput, + UpdateFunctionGraphStoreInput, + FunctionGraphStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphStoreModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStores: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStores', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStore: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', + document, + variables, + transform: (data: { + functionGraphStores?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStore: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', + document, + variables, + transform: (data: { + functionGraphStores?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphStore', + 'createFunctionGraphStore', + 'functionGraphStore', + args.select, + args.data, + 'CreateFunctionGraphStoreInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'createFunctionGraphStore', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphStore', + 'updateFunctionGraphStore', + 'functionGraphStore', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphStoreInput', + 'id', + 'functionGraphStorePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'updateFunctionGraphStore', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphStore', + 'deleteFunctionGraphStore', + 'functionGraphStore', + { + id: args.where.id, + }, + 'DeleteFunctionGraphStoreInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'deleteFunctionGraphStore', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/functionInvocation.ts b/sdk/constructive-react/src/compute/orm/models/functionInvocation.ts new file mode 100644 index 0000000000..3589bf5a1d --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/functionInvocation.ts @@ -0,0 +1,250 @@ +/** + * FunctionInvocation model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionInvocation, + FunctionInvocationWithRelations, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, + CreateFunctionInvocationInput, + UpdateFunctionInvocationInput, + FunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionInvocationModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocations: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocations', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', + document, + variables, + transform: (data: { + functionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', + document, + variables, + transform: (data: { + functionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionInvocation', + 'createFunctionInvocation', + 'functionInvocation', + args.select, + args.data, + 'CreateFunctionInvocationInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'createFunctionInvocation', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocation', + 'updateFunctionInvocation', + 'functionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationInput', + 'id', + 'functionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'updateFunctionInvocation', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocation', + 'deleteFunctionInvocation', + 'functionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'deleteFunctionInvocation', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/getAllRecord.ts b/sdk/constructive-react/src/compute/orm/models/getAllRecord.ts new file mode 100644 index 0000000000..39a82fbbba --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/getAllRecord.ts @@ -0,0 +1,134 @@ +/** + * GetAllRecord model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GetAllRecord, + GetAllRecordWithRelations, + GetAllRecordSelect, + GetAllRecordFilter, + GetAllRecordsOrderBy, + CreateGetAllRecordInput, + UpdateGetAllRecordInput, + GetAllRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class GetAllRecordModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + getAll: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'GetAllRecord', + 'getAll', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GetAllRecordFilter', + 'GetAllRecordsOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GetAllRecord', + fieldName: 'getAll', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + getAllRecord: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'GetAllRecord', + 'getAll', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllRecordFilter', + 'GetAllRecordsOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GetAllRecord', + fieldName: 'getAllRecord', + document, + variables, + transform: (data: { + getAll?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + getAllRecord: data.getAll?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createGetAllRecord: { + getAllRecord: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'GetAllRecord', + 'createGetAllRecord', + 'getAllRecord', + args.select, + args.data, + 'CreateGetAllRecordInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GetAllRecord', + fieldName: 'createGetAllRecord', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/index.ts b/sdk/constructive-react/src/compute/orm/models/index.ts new file mode 100644 index 0000000000..51e9b9f05d --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/index.ts @@ -0,0 +1,23 @@ +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export { GetAllRecordModel } from './getAllRecord'; +export { FunctionApiBindingModel } from './functionApiBinding'; +export { FunctionDeploymentModel } from './functionDeployment'; +export { FunctionGraphRefModel } from './functionGraphRef'; +export { FunctionGraphStoreModel } from './functionGraphStore'; +export { FunctionGraphObjectModel } from './functionGraphObject'; +export { FunctionDeploymentEventModel } from './functionDeploymentEvent'; +export { OrgFunctionExecutionLogModel } from './orgFunctionExecutionLog'; +export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutput'; +export { FunctionGraphCommitModel } from './functionGraphCommit'; +export { SecretDefinitionModel } from './secretDefinition'; +export { FunctionExecutionLogModel } from './functionExecutionLog'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; +export { FunctionGraphModel } from './functionGraph'; +export { OrgFunctionInvocationModel } from './orgFunctionInvocation'; +export { FunctionInvocationModel } from './functionInvocation'; +export { FunctionGraphExecutionModel } from './functionGraphExecution'; +export { FunctionDefinitionModel } from './functionDefinition'; diff --git a/sdk/constructive-react/src/compute/orm/models/orgFunctionExecutionLog.ts b/sdk/constructive-react/src/compute/orm/models/orgFunctionExecutionLog.ts new file mode 100644 index 0000000000..95b37a939d --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/orgFunctionExecutionLog.ts @@ -0,0 +1,252 @@ +/** + * OrgFunctionExecutionLog model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + OrgFunctionExecutionLog, + OrgFunctionExecutionLogWithRelations, + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy, + CreateOrgFunctionExecutionLogInput, + UpdateOrgFunctionExecutionLogInput, + OrgFunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgFunctionExecutionLogModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLogs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLog', + document, + variables, + transform: (data: { + orgFunctionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionExecutionLog: data.orgFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLog', + document, + variables, + transform: (data: { + orgFunctionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionExecutionLog: data.orgFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgFunctionExecutionLog', + 'createOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + args.select, + args.data, + 'CreateOrgFunctionExecutionLogInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'createOrgFunctionExecutionLog', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgFunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'OrgFunctionExecutionLog', + 'updateOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateOrgFunctionExecutionLogInput', + 'id', + 'orgFunctionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'updateOrgFunctionExecutionLog', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'OrgFunctionExecutionLog', + 'deleteOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'deleteOrgFunctionExecutionLog', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/orgFunctionInvocation.ts b/sdk/constructive-react/src/compute/orm/models/orgFunctionInvocation.ts new file mode 100644 index 0000000000..3f3eaab557 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/orgFunctionInvocation.ts @@ -0,0 +1,252 @@ +/** + * OrgFunctionInvocation model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + OrgFunctionInvocation, + OrgFunctionInvocationWithRelations, + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy, + CreateOrgFunctionInvocationInput, + UpdateOrgFunctionInvocationInput, + OrgFunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgFunctionInvocationModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocations: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocations', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocation', + document, + variables, + transform: (data: { + orgFunctionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionInvocation: data.orgFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocation', + document, + variables, + transform: (data: { + orgFunctionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionInvocation: data.orgFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgFunctionInvocation', + 'createOrgFunctionInvocation', + 'orgFunctionInvocation', + args.select, + args.data, + 'CreateOrgFunctionInvocationInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'createOrgFunctionInvocation', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgFunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'OrgFunctionInvocation', + 'updateOrgFunctionInvocation', + 'orgFunctionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateOrgFunctionInvocationInput', + 'id', + 'orgFunctionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'updateOrgFunctionInvocation', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'OrgFunctionInvocation', + 'deleteOrgFunctionInvocation', + 'orgFunctionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgFunctionInvocationInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'deleteOrgFunctionInvocation', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/models/secretDefinition.ts b/sdk/constructive-react/src/compute/orm/models/secretDefinition.ts new file mode 100644 index 0000000000..09b9a0b956 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/models/secretDefinition.ts @@ -0,0 +1,245 @@ +/** + * SecretDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + SecretDefinition, + SecretDefinitionWithRelations, + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy, + CreateSecretDefinitionInput, + UpdateSecretDefinitionInput, + SecretDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class SecretDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinitions: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinition', + document, + variables, + transform: (data: { + secretDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + secretDefinition: data.secretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinition', + document, + variables, + transform: (data: { + secretDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + secretDefinition: data.secretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'SecretDefinition', + 'createSecretDefinition', + 'secretDefinition', + args.select, + args.data, + 'CreateSecretDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'createSecretDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + SecretDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'SecretDefinition', + 'updateSecretDefinition', + 'secretDefinition', + args.select, + args.where.id, + args.data, + 'UpdateSecretDefinitionInput', + 'id', + 'secretDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'updateSecretDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'SecretDefinition', + 'deleteSecretDefinition', + 'secretDefinition', + { + id: args.where.id, + }, + 'DeleteSecretDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'deleteSecretDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/compute/orm/mutation/index.ts b/sdk/constructive-react/src/compute/orm/mutation/index.ts new file mode 100644 index 0000000000..b4abf9132b --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/mutation/index.ts @@ -0,0 +1,512 @@ +/** + * Custom mutation operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ValidateFunctionGraphInput, + InitEmptyRepoInput, + SetDataAtPathInput, + ImportDefinitionsInput, + CopyGraphInput, + SaveGraphInput, + AddEdgeAndSaveInput, + AddNodeAndSaveInput, + AddEdgeInput, + AddNodeInput, + ImportGraphJsonInput, + InsertNodeAtPathInput, + StartExecutionInput, + ProvisionBucketInput, + ValidateFunctionGraphPayload, + InitEmptyRepoPayload, + SetDataAtPathPayload, + ImportDefinitionsPayload, + CopyGraphPayload, + SaveGraphPayload, + AddEdgeAndSavePayload, + AddNodeAndSavePayload, + AddEdgePayload, + AddNodePayload, + ImportGraphJsonPayload, + InsertNodeAtPathPayload, + StartExecutionPayload, + ProvisionBucketPayload, + ValidateFunctionGraphPayloadSelect, + InitEmptyRepoPayloadSelect, + SetDataAtPathPayloadSelect, + ImportDefinitionsPayloadSelect, + CopyGraphPayloadSelect, + SaveGraphPayloadSelect, + AddEdgeAndSavePayloadSelect, + AddNodeAndSavePayloadSelect, + AddEdgePayloadSelect, + AddNodePayloadSelect, + ImportGraphJsonPayloadSelect, + InsertNodeAtPathPayloadSelect, + StartExecutionPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export interface ValidateFunctionGraphVariables { + input: ValidateFunctionGraphInput; +} +export interface InitEmptyRepoVariables { + input: InitEmptyRepoInput; +} +export interface SetDataAtPathVariables { + input: SetDataAtPathInput; +} +export interface ImportDefinitionsVariables { + input: ImportDefinitionsInput; +} +export interface CopyGraphVariables { + input: CopyGraphInput; +} +export interface SaveGraphVariables { + input: SaveGraphInput; +} +export interface AddEdgeAndSaveVariables { + input: AddEdgeAndSaveInput; +} +export interface AddNodeAndSaveVariables { + input: AddNodeAndSaveInput; +} +export interface AddEdgeVariables { + input: AddEdgeInput; +} +export interface AddNodeVariables { + input: AddNodeInput; +} +export interface ImportGraphJsonVariables { + input: ImportGraphJsonInput; +} +export interface InsertNodeAtPathVariables { + input: InsertNodeAtPathInput; +} +export interface StartExecutionVariables { + input: StartExecutionInput; +} +/** + * Variables for provisionBucket + * Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + */ +export interface ProvisionBucketVariables { + input: ProvisionBucketInput; +} +export function createMutationOperations(client: OrmClient) { + return { + validateFunctionGraph: ( + args: ValidateFunctionGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + validateFunctionGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ValidateFunctionGraph', + fieldName: 'validateFunctionGraph', + ...buildCustomDocument( + 'mutation', + 'ValidateFunctionGraph', + 'validateFunctionGraph', + options.select, + args, + [ + { + name: 'input', + type: 'ValidateFunctionGraphInput!', + }, + ], + connectionFieldsMap, + 'ValidateFunctionGraphPayload' + ), + }), + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), + importDefinitions: ( + args: ImportDefinitionsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importDefinitions: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportDefinitions', + fieldName: 'importDefinitions', + ...buildCustomDocument( + 'mutation', + 'ImportDefinitions', + 'importDefinitions', + options.select, + args, + [ + { + name: 'input', + type: 'ImportDefinitionsInput!', + }, + ], + connectionFieldsMap, + 'ImportDefinitionsPayload' + ), + }), + copyGraph: ( + args: CopyGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyGraph', + fieldName: 'copyGraph', + ...buildCustomDocument( + 'mutation', + 'CopyGraph', + 'copyGraph', + options.select, + args, + [ + { + name: 'input', + type: 'CopyGraphInput!', + }, + ], + connectionFieldsMap, + 'CopyGraphPayload' + ), + }), + saveGraph: ( + args: SaveGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + saveGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SaveGraph', + fieldName: 'saveGraph', + ...buildCustomDocument( + 'mutation', + 'SaveGraph', + 'saveGraph', + options.select, + args, + [ + { + name: 'input', + type: 'SaveGraphInput!', + }, + ], + connectionFieldsMap, + 'SaveGraphPayload' + ), + }), + addEdgeAndSave: ( + args: AddEdgeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdgeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdgeAndSave', + fieldName: 'addEdgeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddEdgeAndSave', + 'addEdgeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddEdgeAndSavePayload' + ), + }), + addNodeAndSave: ( + args: AddNodeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNodeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNodeAndSave', + fieldName: 'addNodeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddNodeAndSave', + 'addNodeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddNodeAndSavePayload' + ), + }), + addEdge: ( + args: AddEdgeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdge: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdge', + fieldName: 'addEdge', + ...buildCustomDocument( + 'mutation', + 'AddEdge', + 'addEdge', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeInput!', + }, + ], + connectionFieldsMap, + 'AddEdgePayload' + ), + }), + addNode: ( + args: AddNodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNode', + fieldName: 'addNode', + ...buildCustomDocument( + 'mutation', + 'AddNode', + 'addNode', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeInput!', + }, + ], + connectionFieldsMap, + 'AddNodePayload' + ), + }), + importGraphJson: ( + args: ImportGraphJsonVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importGraphJson: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportGraphJson', + fieldName: 'importGraphJson', + ...buildCustomDocument( + 'mutation', + 'ImportGraphJson', + 'importGraphJson', + options.select, + args, + [ + { + name: 'input', + type: 'ImportGraphJsonInput!', + }, + ], + connectionFieldsMap, + 'ImportGraphJsonPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + startExecution: ( + args: StartExecutionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + startExecution: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'StartExecution', + fieldName: 'startExecution', + ...buildCustomDocument( + 'mutation', + 'StartExecution', + 'startExecution', + options.select, + args, + [ + { + name: 'input', + type: 'StartExecutionInput!', + }, + ], + connectionFieldsMap, + 'StartExecutionPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + }; +} diff --git a/sdk/constructive-react/src/compute/orm/query-builder.ts b/sdk/constructive-react/src/compute/orm/query-builder.ts new file mode 100644 index 0000000000..fd785bbae6 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/query-builder.ts @@ -0,0 +1,1047 @@ +/** + * Query Builder - Builds and executes GraphQL operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { parseType, print } from '@constructive-io/graphql-query/runtime'; +import * as t from 'gql-ast'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; + +import { GraphQLRequestError, OrmClient, QueryResult } from './client'; + +export interface QueryBuilderConfig { + client: OrmClient; + operation: 'query' | 'mutation'; + operationName: string; + fieldName: string; + document: string; + variables?: Record; + transform?: (data: any) => TResult; +} + +export class QueryBuilder { + private config: QueryBuilderConfig; + + constructor(config: QueryBuilderConfig) { + this.config = config; + } + + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + async execute(): Promise> { + const rawResult = await this.config.client.execute( + this.config.document, + this.config.variables + ); + if (!rawResult.ok) { + return rawResult; + } + if (!this.config.transform) { + return rawResult as unknown as QueryResult; + } + return { + ok: true, + data: this.config.transform(rawResult.data), + errors: undefined, + }; + } + + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + async unwrap(): Promise { + const result = await this.execute(); + if (!result.ok) { + throw new GraphQLRequestError(result.errors, result.data); + } + return result.data; + } + + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + async unwrapOr(defaultValue: D): Promise { + const result = await this.execute(); + if (!result.ok) { + return defaultValue; + } + return result.data; + } + + /** + * Execute and unwrap, calling onError callback on failure + */ + async unwrapOrElse( + onError: (errors: import('./client').GraphQLError[]) => D + ): Promise { + const result = await this.execute(); + if (!result.ok) { + return onError(result.errors); + } + return result.data; + } + + toGraphQL(): string { + return this.config.document; + } + + getVariables(): Record | undefined { + return this.config.variables; + } +} + +const OP_QUERY = 'query' as unknown as import('graphql').OperationTypeNode; +const OP_MUTATION = 'mutation' as unknown as import('graphql').OperationTypeNode; +const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; + +// ============================================================================ +// Selection Builders +// ============================================================================ + +export function buildSelections( + select: Record | undefined, + connectionFieldsMap?: Record>, + entityType?: string +): FieldNode[] { + if (!select) { + return []; + } + + const fields: FieldNode[] = []; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; + + for (const [key, value] of Object.entries(select)) { + if (value === false || value === undefined) { + continue; + } + + if (value === true) { + fields.push(t.field({ name: key })); + continue; + } + + if (typeof value === 'object' && value !== null) { + const nested = value as { + select?: Record; + args?: Record; + first?: number; + filter?: Record; + orderBy?: string[]; + connection?: boolean; + }; + + // Field with arguments (e.g. requestUploadUrl on bucket types) + if (nested.args && typeof nested.args === 'object') { + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) + ); + const nestedSelect = nested.select; + if (nestedSelect && typeof nestedSelect === 'object') { + const subSelections = Object.entries(nestedSelect) + .filter(([, v]) => v) + .map(([name]) => t.field({ name })); + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: subSelections.length + ? t.selectionSet({ selections: subSelections }) + : undefined, + }) + ); + } else { + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + }) + ); + } + continue; + } + + if (!nested.select || typeof nested.select !== 'object') { + throw new Error( + `Invalid selection for field "${key}": nested selections must include a "select" object.` + ); + } + + const relatedEntityType = entityConnections?.[key]; + const nestedSelections = buildSelections( + nested.select, + connectionFieldsMap, + relatedEntityType + ); + const isConnection = + nested.connection === true || + nested.first !== undefined || + nested.filter !== undefined || + relatedEntityType !== undefined; + const args = buildArgs([ + buildOptionalArg('first', nested.first), + nested.filter + ? t.argument({ + name: 'filter', + value: buildValueAst(nested.filter), + }) + : null, + buildEnumListArg('orderBy', nested.orderBy), + ]); + + if (isConnection) { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(nestedSelections), + }), + }) + ); + } else { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ selections: nestedSelections }), + }) + ); + } + } + } + + return fields; +} + +// ============================================================================ +// Document Builders +// ============================================================================ + +export function buildFindManyDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { + where?: TWhere; + orderBy?: string[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; + }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'first', typeName: 'Int', value: args.first }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'last', typeName: 'Int', value: args.last }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'after', typeName: 'Cursor', value: args.after }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'before', typeName: 'Cursor', value: args.before }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'offset', typeName: 'Int', value: args.offset }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs.length ? queryArgs : undefined, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(selections), + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildFindFirstDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { where?: TWhere; orderBy?: string[] }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + // Always add first: 1 for findFirst + addVariable( + { varName: 'first', typeName: 'Int', value: 1 }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildCreateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [entityField]: data, + }, + }, + }; +} + +export function buildUpdateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + patchFieldName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + id: where.id, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildUpdateByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + id: string | number, + data: TData, + inputTypeName: string, + idFieldName: string, + patchFieldName: string, + connectionFieldsMap?: Record>, + extraKeys?: Record +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [idFieldName]: id, + ...extraKeys, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildFindOneDocument( + operationName: string, + queryField: string, + id: string | number, + select: TSelect, + idArgName: string, + idTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = [ + t.variableDefinition({ + variable: t.variable({ name: idArgName }), + type: parseType(idTypeName), + }), + ]; + + const queryArgs: ArgumentNode[] = [ + t.argument({ + name: idArgName, + value: t.variable({ name: idArgName }), + }), + ]; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: { [idArgName]: id }, + }; +} + +export function buildDeleteDocument( + operationName: string, + mutationField: string, + entityField: string, + where: TWhere, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ + selections: entitySelections, + }), + }), + ], + }), + variables: { + input: { + id: where.id, + }, + }, + }; +} + +export function buildDeleteByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + keys: Record, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections: entitySelections }), + }), + ], + }), + variables: { + input: keys, + }, + }; +} + +export function buildJunctionRemoveDocument( + operationName: string, + mutationField: string, + keys: Record, + inputTypeName: string +): { document: string; variables: Record } { + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [t.field({ name: 'clientMutationId' })], + }), + variables: { + input: keys, + }, + }; +} + +export function buildCustomDocument( + operationType: 'query' | 'mutation', + operationName: string, + fieldName: string, + select: TSelect, + args: TArgs, + variableDefinitions: Array<{ name: string; type: string }>, + connectionFieldsMap?: Record>, + entityType?: string +): { document: string; variables: Record } { + let actualSelect: TSelect = select; + let isConnection = false; + + if (isCustomSelectionWrapper(select)) { + actualSelect = select.select as TSelect; + isConnection = select.connection === true; + } + + const selections = actualSelect + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) + : []; + + const variableDefs = variableDefinitions.map((definition) => + t.variableDefinition({ + variable: t.variable({ name: definition.name }), + type: parseType(definition.type), + }) + ); + const fieldArgs = variableDefinitions.map((definition) => + t.argument({ + name: definition.name, + value: t.variable({ name: definition.name }), + }) + ); + + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY, + name: operationName, + variableDefinitions: variableDefs.length ? variableDefs : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: fieldName, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: fieldSelections.length + ? t.selectionSet({ selections: fieldSelections }) + : undefined, + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: (args ?? {}) as Record, + }; +} + +function isCustomSelectionWrapper( + value: unknown +): value is { select: Record; connection?: boolean } { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + + const record = value as Record; + const keys = Object.keys(record); + + if (!keys.includes('select') || !keys.includes('connection')) { + return false; + } + + if (keys.some((key) => key !== 'select' && key !== 'connection')) { + return false; + } + + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); +} + +// ============================================================================ +// Helper Functions +// ============================================================================ + +function buildArgs(args: Array): ArgumentNode[] { + return args.filter((arg): arg is ArgumentNode => arg !== null); +} + +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { + if (value === undefined) { + return null; + } + const valueNode = + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); + return t.argument({ name, value: valueNode }); +} + +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { + if (!values || values.length === 0) { + return null; + } + return t.argument({ + name, + value: t.listValue({ + values: values.map((value) => buildEnumValue(value)), + }), + }); +} + +function buildEnumValue(value: string): EnumValueNode { + return { + kind: ENUM_VALUE_KIND, + value, + }; +} + +function buildPageInfoSelections(): FieldNode[] { + return [ + t.field({ name: 'hasNextPage' }), + t.field({ name: 'hasPreviousPage' }), + t.field({ name: 'startCursor' }), + t.field({ name: 'endCursor' }), + ]; +} + +function buildConnectionSelections(nodeSelections: FieldNode[]): FieldNode[] { + return [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections: nodeSelections }), + }), + t.field({ name: 'totalCount' }), + t.field({ + name: 'pageInfo', + selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }), + }), + ]; +} + +interface VariableSpec { + varName: string; + argName?: string; + typeName?: string; + value: unknown; +} + +interface InputMutationConfig { + operationName: string; + mutationField: string; + inputTypeName: string; + resultSelections: FieldNode[]; +} + +function buildInputMutationDocument(config: InputMutationConfig): string { + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_MUTATION, + name: config.operationName + 'Mutation', + variableDefinitions: [ + t.variableDefinition({ + variable: t.variable({ name: 'input' }), + type: parseType(config.inputTypeName + '!'), + }), + ], + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: config.mutationField, + args: [ + t.argument({ + name: 'input', + value: t.variable({ name: 'input' }), + }), + ], + selectionSet: t.selectionSet({ + selections: config.resultSelections, + }), + }), + ], + }), + }), + ], + }); + return print(document); +} + +function addVariable( + spec: VariableSpec, + definitions: VariableDefinitionNode[], + args: ArgumentNode[], + variables: Record +): void { + if (spec.value === undefined || !spec.typeName) return; + + definitions.push( + t.variableDefinition({ + variable: t.variable({ name: spec.varName }), + type: parseType(spec.typeName), + }) + ); + args.push( + t.argument({ + name: spec.argName ?? spec.varName, + value: t.variable({ name: spec.varName }), + }) + ); + variables[spec.varName] = spec.value; +} + +function buildValueAst( + value: unknown +): + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | EnumValueNode { + if (value === null) { + return t.nullValue(); + } + + if (typeof value === 'boolean') { + return t.booleanValue({ value }); + } + + if (typeof value === 'number') { + return Number.isInteger(value) + ? t.intValue({ value: value.toString() }) + : t.floatValue({ value: value.toString() }); + } + + if (typeof value === 'string') { + return t.stringValue({ value }); + } + + if (Array.isArray(value)) { + return t.listValue({ + values: value.map((item) => buildValueAst(item)), + }); + } + + if (typeof value === 'object' && value !== null) { + const obj = value as Record; + return t.objectValue({ + fields: Object.entries(obj).map(([key, val]) => + t.objectField({ + name: key, + value: buildValueAst(val), + }) + ), + }); + } + + throw new Error('Unsupported value type: ' + typeof value); +} + +// ============================================================================ +// Bulk Mutation Document Builders +// ============================================================================ + +export function buildBulkInsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict?: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + ...(onConflict ? { onConflict } : {}), + }, + }, + }; +} + +export function buildBulkUpsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + onConflict, + }, + }, + }; +} + +export function buildBulkUpdateDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + patch: data, + }, + }, + }; +} + +export function buildBulkDeleteDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + }, + }, + }; +} diff --git a/sdk/constructive-react/src/compute/orm/query/index.ts b/sdk/constructive-react/src/compute/orm/query/index.ts new file mode 100644 index 0000000000..505264ae62 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/query/index.ts @@ -0,0 +1,45 @@ +/** + * Custom query operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; +export interface ReadFunctionGraphVariables { + graphId?: string; +} +export function createQueryOperations(client: OrmClient) { + return { + readFunctionGraph: ( + args: ReadFunctionGraphVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + readFunctionGraph: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ReadFunctionGraph', + fieldName: 'readFunctionGraph', + ...buildCustomDocument( + 'query', + 'ReadFunctionGraph', + 'readFunctionGraph', + options?.select, + args, + [ + { + name: 'graphId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + }; +} diff --git a/sdk/constructive-react/src/compute/orm/realtime.ts b/sdk/constructive-react/src/compute/orm/realtime.ts new file mode 100644 index 0000000000..214eb56203 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/realtime.ts @@ -0,0 +1,244 @@ +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// Minimal type shims so this module compiles without graphql-ws +// installed. Consumers supply a WsClient via RealtimeConfig; +// the SDK itself never imports or requires graphql-ws. + +interface WsGraphQLError { + readonly message: string; + readonly [key: string]: unknown; +} + +interface WsExecutionResult> { + data?: TData | null; + errors?: readonly WsGraphQLError[]; + extensions?: Record; +} + +interface WsSink { + next(value: T): void; + error(error: unknown): void; + complete(): void; +} + +/** + * Minimal interface matching the graphql-ws Client. + * Consumers pass a concrete instance via RealtimeConfig.client. + */ +export interface WsClient { + subscribe>( + payload: { query: string; variables?: Record }, + sink: WsSink> + ): () => void; + dispose(): void; +} + +// ============================================================================ +// Types +// ============================================================================ + +/** The DML operation that triggered the subscription event */ +export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; + +/** Connection state of the WebSocket */ +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; + +/** Listener for connection state changes */ +export type ConnectionStateListener = (state: ConnectionState) => void; + +/** Function returned by subscribe() to cancel the subscription */ +export type Unsubscribe = () => void; + +/** + * A realtime subscription event delivered to the client. + * + * @typeParam T - The row type of the subscribed table + */ +export interface SubscriptionEvent { + /** The DML operation that triggered this event */ + operation: SubscriptionOperation; + /** The current row data (null for DELETE if row is no longer visible) */ + data: T | null; + /** Previous field values (populated on UPDATE when available) */ + previousValues?: Partial; + /** Server-side timestamp of when the change occurred */ + timestamp: string; +} + +/** + * Options for creating a subscription. + * + * @typeParam T - The row type of the subscribed table + * @typeParam TFilter - The filter type for the table + */ +export interface SubscribeOptions> { + /** Server-side filter to limit which events are delivered */ + filter?: TFilter; + /** Called when a subscription event is received */ + onEvent: (event: SubscriptionEvent) => void; + /** Called when the subscription encounters an error */ + onError?: (error: Error) => void; + /** Called when the subscription completes (server-initiated close) */ + onComplete?: () => void; +} + +/** + * Metadata about a subscription field, used internally to map + * table names to GraphQL subscription field names and types. + */ +export interface SubscriptionFieldMeta { + /** The GraphQL subscription field name (e.g., 'onContactChanged') */ + fieldName: string; + /** The table name in the source schema (e.g., 'contact') */ + tableName: string; + /** The data field name inside the subscription payload (e.g., 'contact') */ + dataFieldName: string; +} + +/** + * Configuration for the realtime (WebSocket) connection. + * Pass this as the `realtime` option in OrmClientConfig. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * + * const client = createOrmClient({ + * endpoint: 'https://api.example.com/graphql', + * realtime: { + * client: createClient({ url: 'wss://api.example.com/graphql' }), + * }, + * }); + * ``` + */ +export interface RealtimeConfig { + /** + * A graphql-ws Client instance (or any object satisfying WsClient). + * The consumer creates this themselves, giving full control over + * connection options, auth, and transport. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * const wsClient = createClient({ url: 'wss://...' }); + * ``` + */ + client: WsClient; +} + +// ============================================================================ +// RealtimeManager +// ============================================================================ + +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +export class RealtimeManager { + private wsClient: WsClient; + private connectionState: ConnectionState = 'disconnected'; + private stateListeners: Set = new Set(); + private activeSubscriptions = 0; + + constructor(config: RealtimeConfig) { + this.wsClient = config.client; + } + + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + this.activeSubscriptions++; + let disposed = false; + + const cleanup = this.wsClient.subscribe>( + { query: document, variables }, + { + next: (result) => { + if (disposed) return; + if (result.errors) { + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); + return; + } + + const payload = result.data?.[meta.fieldName] as + | { event?: string; [key: string]: unknown } + | undefined; + + if (!payload) return; + + const event: SubscriptionEvent = { + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', + data: (payload[meta.dataFieldName] as T) ?? null, + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), + }; + options.onEvent(event); + }, + error: (err) => { + if (disposed) return; + options.onError?.(err instanceof Error ? err : new Error(String(err))); + }, + complete: () => { + if (disposed) return; + options.onComplete?.(); + }, + } + ); + + return () => { + if (disposed) return; + disposed = true; + this.activeSubscriptions--; + cleanup(); + }; + } + + /** Register a listener for connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + this.stateListeners.add(listener); + return () => { + this.stateListeners.delete(listener); + }; + } + + /** Get current connection state */ + getConnectionState(): ConnectionState { + return this.connectionState; + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.activeSubscriptions; + } + + /** Dispose the manager and close the WebSocket connection */ + dispose(): void { + this.wsClient.dispose(); + this.stateListeners.clear(); + this.activeSubscriptions = 0; + this.setConnectionState('disconnected'); + } + + private setConnectionState(state: ConnectionState): void { + if (this.connectionState === state) return; + this.connectionState = state; + for (const listener of this.stateListeners) { + listener(state); + } + } +} diff --git a/sdk/constructive-react/src/compute/orm/select-types.ts b/sdk/constructive-react/src/compute/orm/select-types.ts new file mode 100644 index 0000000000..4b39d7e820 --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/select-types.ts @@ -0,0 +1,169 @@ +/** + * Type utilities for select inference + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} + +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} + +export interface FindManyArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +export interface FindFirstArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; +} + +export interface CreateArgs { + data: TData; + select?: TSelect; +} + +export interface UpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export type FindOneArgs = { + select?: TSelect; +} & Record; + +export interface DeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkInsertArgs { + data: TData[]; + select?: TSelect; + onConflict?: TOnConflict; +} + +export interface BulkUpsertArgs { + data: TData[]; + select?: TSelect; + onConflict: TOnConflict; +} + +export interface BulkUpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export interface BulkDeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkMutationResult { + affectedCount: number; + returning: T[]; +} + +type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +type DecrementDepth = { + 0: 0; + 1: 0; + 2: 1; + 3: 2; + 4: 3; + 5: 4; + 6: 5; + 7: 6; + 8: 7; + 9: 8; + 10: 9; +}; + +/** + * Recursively validates select objects, rejecting unknown keys. + * + * NOTE: Depth is intentionally capped to avoid circular-instantiation issues + * in very large cyclic schemas. + */ +export type DeepExact = Depth extends 0 + ? T extends Shape + ? T + : never + : T extends Shape + ? Exclude extends never + ? { + [K in keyof T]: K extends keyof Shape + ? T[K] extends { select: infer NS } + ? Extract extends { + select?: infer ShapeNS; + } + ? DeepExact< + Omit & { + select: DeepExact, DecrementDepth[Depth]>; + }, + Extract, + DecrementDepth[Depth] + > + : never + : T[K] + : never; + } + : never + : never; + +/** + * Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`. + * Use this as an intersection in overloads: + * `{ select: S } & StrictSelect`. + */ +export type StrictSelect = S extends DeepExact ? {} : never; + +/** + * Hook-optimized strict select variant. + * + * Uses a shallower recursion depth to keep editor autocomplete responsive + * in large schemas while still validating common nested-select mistakes. + */ +export type HookStrictSelect = S extends DeepExact ? {} : never; + +/** + * Infer result type from select configuration + */ +export type InferSelectResult = TSelect extends undefined + ? TEntity + : { + [K in keyof TSelect as TSelect[K] extends false | undefined + ? never + : K]: TSelect[K] extends true + ? K extends keyof TEntity + ? TEntity[K] + : never + : TSelect[K] extends { select: infer NestedSelect } + ? K extends keyof TEntity + ? NonNullable extends ConnectionResult + ? ConnectionResult> + : + | InferSelectResult, NestedSelect> + | (null extends TEntity[K] ? null : never) + : never + : K extends keyof TEntity + ? TEntity[K] + : never; + }; diff --git a/sdk/constructive-react/src/compute/orm/types.ts b/sdk/constructive-react/src/compute/orm/types.ts new file mode 100644 index 0000000000..7c1120bcdf --- /dev/null +++ b/sdk/constructive-react/src/compute/orm/types.ts @@ -0,0 +1,8 @@ +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// Re-export all types from input-types +export * from './input-types'; diff --git a/sdk/constructive-react/src/compute/schema-types.ts b/sdk/constructive-react/src/compute/schema-types.ts new file mode 100644 index 0000000000..d200e93ff1 --- /dev/null +++ b/sdk/constructive-react/src/compute/schema-types.ts @@ -0,0 +1,3245 @@ +/** + * GraphQL schema types for custom operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import type { + FunctionApiBinding, + FunctionDefinition, + FunctionDeployment, + FunctionDeploymentEvent, + FunctionExecutionLog, + FunctionGraph, + FunctionGraphCommit, + FunctionGraphExecution, + FunctionGraphExecutionNodeState, + FunctionGraphExecutionOutput, + FunctionGraphObject, + FunctionGraphRef, + FunctionGraphStore, + FunctionInvocation, + GetAllRecord, + OrgFunctionExecutionLog, + OrgFunctionInvocation, + SecretDefinition, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; +export type Base64EncodedBinary = unknown; +/** Methods to use when ordering `FunctionApiBinding`. */ +export type FunctionApiBindingOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC'; +/** Methods to use when ordering `FunctionDeployment`. */ +export type FunctionDeploymentOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +/** Methods to use when ordering `FunctionGraphRef`. */ +export type FunctionGraphRefOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC'; +/** Methods to use when ordering `FunctionGraphStore`. */ +export type FunctionGraphStoreOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +/** Methods to use when ordering `FunctionGraphObject`. */ +export type FunctionGraphObjectOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +/** Methods to use when ordering `FunctionDeploymentEvent`. */ +export type FunctionDeploymentEventOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +/** Methods to use when ordering `OrgFunctionExecutionLog`. */ +export type OrgFunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC'; +/** Methods to use when ordering `FunctionGraphExecutionOutput`. */ +export type FunctionGraphExecutionOutputOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'DATA_ASC' + | 'DATA_DESC'; +/** Methods to use when ordering `FunctionGraphCommit`. */ +export type FunctionGraphCommitOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC'; +/** Methods to use when ordering `SecretDefinition`. */ +export type SecretDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +/** Methods to use when ordering `FunctionExecutionLog`. */ +export type FunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +/** Methods to use when ordering `FunctionGraphExecutionNodeState`. */ +export type FunctionGraphExecutionNodeStateOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC'; +/** Methods to use when ordering `FunctionGraph`. */ +export type FunctionGraphOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +/** Methods to use when ordering `OrgFunctionInvocation`. */ +export type OrgFunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +/** Methods to use when ordering `FunctionInvocation`. */ +export type FunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +/** Methods to use when ordering `FunctionGraphExecution`. */ +export type FunctionGraphExecutionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC'; +/** Methods to use when ordering `FunctionDefinition`. */ +export type FunctionDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_INVOCABLE_ASC' + | 'IS_INVOCABLE_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC'; +/** A filter to be used against `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionApiBindingFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `apiId` field. */ + apiId?: UUIDFilter; + /** Filter by the object’s `alias` field. */ + alias?: StringFilter; + /** Filter by the object’s `config` field. */ + config?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionApiBindingFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionApiBindingFilter[]; + /** Negates the expression. */ + not?: FunctionApiBindingFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against `FunctionDefinition` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `runtime` field. */ + runtime?: StringFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `requiredBuckets` field. */ + requiredBuckets?: StringListFilter; + /** Filter by the object’s `requiredModels` field. */ + requiredModels?: StringListFilter; + /** Filter by the object’s `inputs` field. */ + inputs?: JSONFilter; + /** Filter by the object’s `outputs` field. */ + outputs?: JSONFilter; + /** Filter by the object’s `props` field. */ + props?: JSONFilter; + /** Filter by the object’s `volatile` field. */ + volatile?: BooleanFilter; + /** Filter by the object’s `icon` field. */ + icon?: StringFilter; + /** Filter by the object’s `category` field. */ + category?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: FunctionDefinitionFilter; + /** Filter by the object’s `functionApiBindings` relation. */ + functionApiBindings?: FunctionDefinitionToManyFunctionApiBindingFilter; + /** `functionApiBindings` exist. */ + functionApiBindingsExist?: boolean; + /** Filter by the object’s `functionDeployments` relation. */ + functionDeployments?: FunctionDefinitionToManyFunctionDeploymentFilter; + /** `functionDeployments` exist. */ + functionDeploymentsExist?: boolean; +} +/** A filter to be used against many `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionApiBindingFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionApiBindingFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionApiBindingFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionApiBindingFilter; +} +/** A filter to be used against many `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionDeploymentFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionDeploymentFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionDeploymentFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionDeploymentFilter; +} +/** A filter to be used against `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDeploymentFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `serviceName` field. */ + serviceName?: StringFilter; + /** Filter by the object’s `revision` field. */ + revision?: IntFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `lastError` field. */ + lastError?: StringFilter; + /** Filter by the object’s `lastErrorAt` field. */ + lastErrorAt?: DatetimeFilter; + /** Filter by the object’s `errorCount` field. */ + errorCount?: IntFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against `FunctionGraphRef` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphRefFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `commitId` field. */ + commitId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphRefFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphRefFilter[]; + /** Negates the expression. */ + not?: FunctionGraphRefFilter; +} +/** A filter to be used against `FunctionGraphStore` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphStoreFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphStoreFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphStoreFilter[]; + /** Negates the expression. */ + not?: FunctionGraphStoreFilter; +} +/** A filter to be used against `FunctionGraphObject` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphObjectFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `kids` field. */ + kids?: UUIDListFilter; + /** Filter by the object’s `ktree` field. */ + ktree?: StringListFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphObjectFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphObjectFilter[]; + /** Negates the expression. */ + not?: FunctionGraphObjectFilter; +} +/** A filter to be used against `FunctionDeploymentEvent` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDeploymentEventFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `deploymentId` field. */ + deploymentId?: UUIDFilter; + /** Filter by the object’s `eventType` field. */ + eventType?: StringFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentEventFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentEventFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentEventFilter; +} +/** A filter to be used against `OrgFunctionExecutionLog` object types. All fields are combined with a logical ‘and.’ */ +export interface OrgFunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: OrgFunctionExecutionLogFilter; +} +/** A filter to be used against `FunctionGraphExecutionOutput` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphExecutionOutputFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: Base64EncodedBinaryFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionOutputFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionOutputFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionOutputFilter; +} +/** A filter to be used against Base64EncodedBinary fields. All fields are combined with a logical ‘and.’ */ +export interface Base64EncodedBinaryFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: Base64EncodedBinary; + /** Not equal to the specified value. */ + notEqualTo?: Base64EncodedBinary; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: Base64EncodedBinary; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: Base64EncodedBinary; + /** Included in the specified list. */ + in?: Base64EncodedBinary[]; + /** Not included in the specified list. */ + notIn?: Base64EncodedBinary[]; +} +/** A filter to be used against `FunctionGraphCommit` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphCommitFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `parentIds` field. */ + parentIds?: UUIDListFilter; + /** Filter by the object’s `authorId` field. */ + authorId?: UUIDFilter; + /** Filter by the object’s `committerId` field. */ + committerId?: UUIDFilter; + /** Filter by the object’s `treeId` field. */ + treeId?: UUIDFilter; + /** Filter by the object’s `date` field. */ + date?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphCommitFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphCommitFilter[]; + /** Negates the expression. */ + not?: FunctionGraphCommitFilter; +} +/** A filter to be used against `SecretDefinition` object types. All fields are combined with a logical ‘and.’ */ +export interface SecretDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: SecretDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: SecretDefinitionFilter[]; + /** Negates the expression. */ + not?: SecretDefinitionFilter; +} +/** A filter to be used against `FunctionExecutionLog` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: FunctionExecutionLogFilter; +} +/** A filter to be used against `FunctionGraphExecutionNodeState` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphExecutionNodeStateFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `executionId` field. */ + executionId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `nodeName` field. */ + nodeName?: StringFilter; + /** Filter by the object’s `nodePath` field. */ + nodePath?: StringListFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Filter by the object’s `outputId` field. */ + outputId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionNodeStateFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionNodeStateFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionNodeStateFilter; +} +/** A filter to be used against `FunctionGraph` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `context` field. */ + context?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `isValid` field. */ + isValid?: BooleanFilter; + /** Filter by the object’s `validationErrors` field. */ + validationErrors?: JSONFilter; + /** Filter by the object’s `createdBy` field. */ + createdBy?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphFilter[]; + /** Negates the expression. */ + not?: FunctionGraphFilter; +} +/** A filter to be used against `OrgFunctionInvocation` object types. All fields are combined with a logical ‘and.’ */ +export interface OrgFunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionInvocationFilter[]; + /** Negates the expression. */ + not?: OrgFunctionInvocationFilter; +} +/** A filter to be used against `FunctionInvocation` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionInvocationFilter[]; + /** Negates the expression. */ + not?: FunctionInvocationFilter; +} +/** A filter to be used against `FunctionGraphExecution` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionGraphExecutionFilter { + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `graphId` field. */ + graphId?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `outputNode` field. */ + outputNode?: StringFilter; + /** Filter by the object’s `outputPort` field. */ + outputPort?: StringFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `inputPayload` field. */ + inputPayload?: JSONFilter; + /** Filter by the object’s `outputPayload` field. */ + outputPayload?: JSONFilter; + /** Filter by the object’s `nodeOutputs` field. */ + nodeOutputs?: JSONFilter; + /** Filter by the object’s `executionPlan` field. */ + executionPlan?: JSONFilter; + /** Filter by the object’s `currentWave` field. */ + currentWave?: IntFilter; + /** Filter by the object’s `parentExecutionId` field. */ + parentExecutionId?: UUIDFilter; + /** Filter by the object’s `parentNodeName` field. */ + parentNodeName?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `tickCount` field. */ + tickCount?: IntFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `maxTicks` field. */ + maxTicks?: IntFilter; + /** Filter by the object’s `maxPendingJobs` field. */ + maxPendingJobs?: IntFilter; + /** Filter by the object’s `timeoutAt` field. */ + timeoutAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionFilter; + /** Filter by the object’s `graph` relation. */ + graph?: FunctionGraphFilter; +} +export interface ValidateFunctionGraphInput { + clientMutationId?: string; + graphId?: string; +} +export interface InitEmptyRepoInput { + clientMutationId?: string; + sId?: string; + storeId?: string; +} +export interface SetDataAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: unknown; +} +export interface ImportDefinitionsInput { + clientMutationId?: string; + graphId?: string; + sourceScopeId?: string; + sourceCommitId?: string; + contexts?: string[]; +} +export interface CopyGraphInput { + clientMutationId?: string; + databaseId?: string; + graphId?: string; + name?: string; +} +export interface SaveGraphInput { + clientMutationId?: string; + graphId?: string; + rootHash?: string; + message?: string; +} +export interface AddEdgeAndSaveInput { + clientMutationId?: string; + graphId?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + message?: string; +} +export interface AddNodeAndSaveInput { + clientMutationId?: string; + graphId?: string; + nodeName?: string; + nodeType?: string; + props?: unknown; + meta?: unknown; + message?: string; +} +export interface CreateFunctionGraphInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + context?: string; + description?: string; + entityId?: string; + createdBy?: string; + definitionsCommitId?: string; +} +export interface AddEdgeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + context?: string; + graphName?: string; +} +export interface AddNodeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + nodeName?: string; + nodeType?: string; + context?: string; + graphName?: string; + props?: unknown; + meta?: unknown; +} +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: unknown; + context?: string; + description?: string; + entityId?: string; + createdBy?: string; + definitionsCommitId?: string; +} +export interface InsertNodeAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: unknown; + kids?: string[]; + ktree?: string[]; +} +export interface StartExecutionInput { + clientMutationId?: string; + graphId?: string; + inputPayload?: unknown; + outputNode?: string; + outputPort?: string; + maxTicks?: number; + maxPendingJobs?: number; + timeoutInterval?: IntervalInput; + parentExecutionId?: string; + parentNodeName?: string; +} +/** An interval of time that has passed where the smallest distinct unit is a second. */ +export interface IntervalInput { + /** + * A quantity of seconds. This is the only non-integer field, as all the other + * fields will dump their overflow into a smaller unit of time. Intervals don’t + * have a smaller unit than seconds. + */ + seconds?: number; + /** A quantity of minutes. */ + minutes?: number; + /** A quantity of hours. */ + hours?: number; + /** A quantity of days. */ + days?: number; + /** A quantity of months. */ + months?: number; + /** A quantity of years. */ + years?: number; +} +export interface CreateFunctionApiBindingInput { + clientMutationId?: string; + /** The `FunctionApiBinding` to be created by this mutation. */ + functionApiBinding: FunctionApiBindingInput; +} +/** An input for mutations affecting `FunctionApiBinding` */ +export interface FunctionApiBindingInput { + id?: string; + /** Function definition this binding belongs to */ + functionDefinitionId: string; + /** API endpoint this function is bound to */ + apiId: string; + /** Binding alias (e.g. default, staging, production) */ + alias?: string; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: unknown; +} +export interface CreateFunctionGraphRefInput { + clientMutationId?: string; + /** The `FunctionGraphRef` to be created by this mutation. */ + functionGraphRef: FunctionGraphRefInput; +} +/** An input for mutations affecting `FunctionGraphRef` */ +export interface FunctionGraphRefInput { + /** Unique ref identifier */ + id?: string; + /** Ref name (e.g. HEAD, main) */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this ref belongs to */ + storeId: string; + /** Commit this ref points to */ + commitId?: string; +} +export interface CreateFunctionGraphStoreInput { + clientMutationId?: string; + /** The `FunctionGraphStore` to be created by this mutation. */ + functionGraphStore: FunctionGraphStoreInput; +} +/** An input for mutations affecting `FunctionGraphStore` */ +export interface FunctionGraphStoreInput { + /** Unique store identifier */ + id?: string; + /** Human-readable store name */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Current root object hash of this store */ + hash?: string; + /** Timestamp of store creation */ + createdAt?: string; +} +export interface CreateFunctionGraphObjectInput { + clientMutationId?: string; + /** The `FunctionGraphObject` to be created by this mutation. */ + functionGraphObject: FunctionGraphObjectInput; +} +/** An input for mutations affecting `FunctionGraphObject` */ +export interface FunctionGraphObjectInput { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Ordered array of child object IDs */ + kids?: string[]; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[]; + /** Payload data for this object node */ + data?: unknown; + /** Timestamp of object creation */ + createdAt?: string; +} +export interface CreateFunctionDeploymentEventInput { + clientMutationId?: string; + /** The `FunctionDeploymentEvent` to be created by this mutation. */ + functionDeploymentEvent: FunctionDeploymentEventInput; +} +/** An input for mutations affecting `FunctionDeploymentEvent` */ +export interface FunctionDeploymentEventInput { + /** Event timestamp (partition key) */ + createdAt?: string; + /** Unique event identifier */ + id?: string; + /** Deployment this event belongs to */ + deploymentId: string; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType: string; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string; + /** Human-readable description of the event */ + message?: string; + /** Structured context (old/new values, error details, etc.) */ + metadata?: unknown; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +export interface CreateOrgFunctionExecutionLogInput { + clientMutationId?: string; + /** The `OrgFunctionExecutionLog` to be created by this mutation. */ + orgFunctionExecutionLog: OrgFunctionExecutionLogInput; +} +/** An input for mutations affecting `OrgFunctionExecutionLog` */ +export interface OrgFunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: unknown; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; +} +export interface CreateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + /** The `FunctionGraphExecutionOutput` to be created by this mutation. */ + functionGraphExecutionOutput: FunctionGraphExecutionOutputInput; +} +/** An input for mutations affecting `FunctionGraphExecutionOutput` */ +export interface FunctionGraphExecutionOutputInput { + /** Timestamp of output creation */ + createdAt?: string; + /** Unique execution output identifier */ + id?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash: Base64EncodedBinary; + /** The actual output payload from a completed node */ + data: unknown; +} +export interface CreateFunctionGraphCommitInput { + clientMutationId?: string; + /** The `FunctionGraphCommit` to be created by this mutation. */ + functionGraphCommit: FunctionGraphCommitInput; +} +/** An input for mutations affecting `FunctionGraphCommit` */ +export interface FunctionGraphCommitInput { + /** Unique commit identifier */ + id?: string; + /** Optional commit message */ + message?: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this commit belongs to */ + storeId: string; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[]; + /** User who authored the changes */ + authorId?: string; + /** User who committed (may differ from author) */ + committerId?: string; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string; + /** Commit timestamp */ + date?: string; +} +export interface CreateSecretDefinitionInput { + clientMutationId?: string; + /** The `SecretDefinition` to be created by this mutation. */ + secretDefinition: SecretDefinitionInput; +} +/** An input for mutations affecting `SecretDefinition` */ +export interface SecretDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Secret name (must match app_secrets.name for resolution) */ + name: string; + /** Human-readable description of what this secret is used for */ + description?: string; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: unknown; + /** Freeform metadata annotations for secret definitions */ + annotations?: unknown; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +export interface CreateFunctionExecutionLogInput { + clientMutationId?: string; + /** The `FunctionExecutionLog` to be created by this mutation. */ + functionExecutionLog: FunctionExecutionLogInput; +} +/** An input for mutations affecting `FunctionExecutionLog` */ +export interface FunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: unknown; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +export interface CreateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + /** The `FunctionGraphExecutionNodeState` to be created by this mutation. */ + functionGraphExecutionNodeState: FunctionGraphExecutionNodeStateInput; +} +/** An input for mutations affecting `FunctionGraphExecutionNodeState` */ +export interface FunctionGraphExecutionNodeStateInput { + /** Timestamp of node state creation (partition key) */ + createdAt?: string; + /** Unique node state identifier */ + id?: string; + /** FK to the parent graph execution */ + executionId: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName: string; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[]; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string; + /** Timestamp when the node began executing */ + startedAt?: string; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string; +} +export interface CreateOrgFunctionInvocationInput { + clientMutationId?: string; + /** The `OrgFunctionInvocation` to be created by this mutation. */ + orgFunctionInvocation: OrgFunctionInvocationInput; +} +/** An input for mutations affecting `OrgFunctionInvocation` */ +export interface OrgFunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: unknown; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: unknown; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +export interface CreateFunctionInvocationInput { + clientMutationId?: string; + /** The `FunctionInvocation` to be created by this mutation. */ + functionInvocation: FunctionInvocationInput; +} +/** An input for mutations affecting `FunctionInvocation` */ +export interface FunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: unknown; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: unknown; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +export interface CreateFunctionDeploymentInput { + clientMutationId?: string; + /** The `FunctionDeployment` to be created by this mutation. */ + functionDeployment: FunctionDeploymentInput; +} +/** An input for mutations affecting `FunctionDeployment` */ +export interface FunctionDeploymentInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function definition being deployed to this namespace */ + functionDefinitionId: string; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId: string; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number; + /** Container image override (NULL = inherit from function definition) */ + image?: string; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: unknown; + /** Most recent provisioning or runtime error message */ + lastError?: string; + /** Timestamp of the most recent error */ + lastErrorAt?: string; + /** Cumulative error count for this deployment */ + errorCount?: number; + /** Key/value pairs for selecting and filtering deployments */ + labels?: unknown; + /** Freeform metadata for tooling and operational notes */ + annotations?: unknown; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +export interface CreateFunctionGraphExecutionInput { + clientMutationId?: string; + /** The `FunctionGraphExecution` to be created by this mutation. */ + functionGraphExecution: FunctionGraphExecutionInput; +} +/** An input for mutations affecting `FunctionGraphExecution` */ +export interface FunctionGraphExecutionInput { + /** Execution start timestamp */ + startedAt?: string; + /** Unique execution identifier */ + id?: string; + /** FK to the graph definition being executed */ + graphId: string; + /** Parent function_invocations row (for metering) */ + invocationId?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Entity context (org/team) for scoped billing */ + entityId?: string; + /** Target output boundary node name to resolve */ + outputNode: string; + /** Target output port name (default: value) */ + outputPort?: string; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Initial inputs provided at invocation time */ + inputPayload?: unknown; + /** Final result extracted from terminal output node */ + outputPayload?: unknown; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: unknown; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: unknown; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string; + /** Number of evaluate_step ticks executed */ + tickCount?: number; + /** Execution completion timestamp */ + completedAt?: string; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; +} +export interface CreateFunctionDefinitionInput { + clientMutationId?: string; + /** The `FunctionDefinition` to be created by this mutation. */ + functionDefinition: FunctionDefinitionInput; +} +/** An input for mutations affecting `FunctionDefinition` */ +export interface FunctionDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope: string; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name: string; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier: string; + /** Human-readable description of what this function does */ + description?: string; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number; + /** Job priority (lower = higher priority) */ + priority?: number; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number; + /** Knative request timeout in seconds */ + timeoutSeconds?: number; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: unknown; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirementInput[]; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirementInput[]; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[]; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[]; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: unknown; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: unknown; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: unknown; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string; +} +/** An input for mutations affecting `FunctionRequirement` */ +export interface FunctionRequirementInput { + name?: string; + required?: boolean; +} +export interface UpdateFunctionApiBindingInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `FunctionApiBinding` being updated. */ + functionApiBindingPatch: FunctionApiBindingPatch; +} +/** Represents an update to a `FunctionApiBinding`. Fields that are set will be updated. */ +export interface FunctionApiBindingPatch { + id?: string; + /** Function definition this binding belongs to */ + functionDefinitionId?: string; + /** API endpoint this function is bound to */ + apiId?: string; + /** Binding alias (e.g. default, staging, production) */ + alias?: string; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: unknown; +} +export interface UpdateFunctionGraphRefInput { + clientMutationId?: string; + /** Unique ref identifier */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** An object where the defined keys will be set on the `FunctionGraphRef` being updated. */ + functionGraphRefPatch: FunctionGraphRefPatch; +} +/** Represents an update to a `FunctionGraphRef`. Fields that are set will be updated. */ +export interface FunctionGraphRefPatch { + /** Unique ref identifier */ + id?: string; + /** Ref name (e.g. HEAD, main) */ + name?: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string; + /** Store this ref belongs to */ + storeId?: string; + /** Commit this ref points to */ + commitId?: string; +} +export interface UpdateFunctionGraphStoreInput { + clientMutationId?: string; + /** Unique store identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionGraphStore` being updated. */ + functionGraphStorePatch: FunctionGraphStorePatch; +} +/** Represents an update to a `FunctionGraphStore`. Fields that are set will be updated. */ +export interface FunctionGraphStorePatch { + /** Unique store identifier */ + id?: string; + /** Human-readable store name */ + name?: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string; + /** Current root object hash of this store */ + hash?: string; + /** Timestamp of store creation */ + createdAt?: string; +} +export interface UpdateFunctionGraphObjectInput { + clientMutationId?: string; + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** An object where the defined keys will be set on the `FunctionGraphObject` being updated. */ + functionGraphObjectPatch: FunctionGraphObjectPatch; +} +/** Represents an update to a `FunctionGraphObject`. Fields that are set will be updated. */ +export interface FunctionGraphObjectPatch { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id?: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string; + /** Ordered array of child object IDs */ + kids?: string[]; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[]; + /** Payload data for this object node */ + data?: unknown; + /** Timestamp of object creation */ + createdAt?: string; +} +export interface UpdateFunctionDeploymentEventInput { + clientMutationId?: string; + /** Event timestamp (partition key) */ + createdAt: string; + /** Unique event identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionDeploymentEvent` being updated. */ + functionDeploymentEventPatch: FunctionDeploymentEventPatch; +} +/** Represents an update to a `FunctionDeploymentEvent`. Fields that are set will be updated. */ +export interface FunctionDeploymentEventPatch { + /** Event timestamp (partition key) */ + createdAt?: string; + /** Unique event identifier */ + id?: string; + /** Deployment this event belongs to */ + deploymentId?: string; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType?: string; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string; + /** Human-readable description of the event */ + message?: string; + /** Structured context (old/new values, error details, etc.) */ + metadata?: unknown; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string; +} +export interface UpdateOrgFunctionExecutionLogInput { + clientMutationId?: string; + /** Log entry timestamp (partition key) */ + createdAt: string; + /** Unique log entry identifier */ + id: string; + /** An object where the defined keys will be set on the `OrgFunctionExecutionLog` being updated. */ + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; +} +/** Represents an update to a `OrgFunctionExecutionLog`. Fields that are set will be updated. */ +export interface OrgFunctionExecutionLogPatch { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message?: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: unknown; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; +} +export interface UpdateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + /** Timestamp of output creation */ + createdAt: string; + /** Unique execution output identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionGraphExecutionOutput` being updated. */ + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; +} +/** Represents an update to a `FunctionGraphExecutionOutput`. Fields that are set will be updated. */ +export interface FunctionGraphExecutionOutputPatch { + /** Timestamp of output creation */ + createdAt?: string; + /** Unique execution output identifier */ + id?: string; + /** Scope for multi-tenant isolation */ + databaseId?: string; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash?: Base64EncodedBinary; + /** The actual output payload from a completed node */ + data?: unknown; +} +export interface UpdateFunctionGraphCommitInput { + clientMutationId?: string; + /** Unique commit identifier */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** An object where the defined keys will be set on the `FunctionGraphCommit` being updated. */ + functionGraphCommitPatch: FunctionGraphCommitPatch; +} +/** Represents an update to a `FunctionGraphCommit`. Fields that are set will be updated. */ +export interface FunctionGraphCommitPatch { + /** Unique commit identifier */ + id?: string; + /** Optional commit message */ + message?: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string; + /** Store this commit belongs to */ + storeId?: string; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[]; + /** User who authored the changes */ + authorId?: string; + /** User who committed (may differ from author) */ + committerId?: string; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string; + /** Commit timestamp */ + date?: string; +} +export interface UpdateSecretDefinitionInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `SecretDefinition` being updated. */ + secretDefinitionPatch: SecretDefinitionPatch; +} +/** Represents an update to a `SecretDefinition`. Fields that are set will be updated. */ +export interface SecretDefinitionPatch { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Secret name (must match app_secrets.name for resolution) */ + name?: string; + /** Human-readable description of what this secret is used for */ + description?: string; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: unknown; + /** Freeform metadata annotations for secret definitions */ + annotations?: unknown; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string; +} +export interface UpdateFunctionExecutionLogInput { + clientMutationId?: string; + /** Log entry timestamp (partition key) */ + createdAt: string; + /** Unique log entry identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionExecutionLog` being updated. */ + functionExecutionLogPatch: FunctionExecutionLogPatch; +} +/** Represents an update to a `FunctionExecutionLog`. Fields that are set will be updated. */ +export interface FunctionExecutionLogPatch { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message?: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: unknown; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string; +} +export interface UpdateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + /** Timestamp of node state creation (partition key) */ + createdAt: string; + /** Unique node state identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionGraphExecutionNodeState` being updated. */ + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; +} +/** Represents an update to a `FunctionGraphExecutionNodeState`. Fields that are set will be updated. */ +export interface FunctionGraphExecutionNodeStatePatch { + /** Timestamp of node state creation (partition key) */ + createdAt?: string; + /** Unique node state identifier */ + id?: string; + /** FK to the parent graph execution */ + executionId?: string; + /** Scope for multi-tenant isolation */ + databaseId?: string; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName?: string; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[]; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string; + /** Timestamp when the node began executing */ + startedAt?: string; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string; +} +export interface UpdateFunctionGraphInput { + clientMutationId?: string; + /** Unique graph identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionGraph` being updated. */ + functionGraphPatch: FunctionGraphPatch; +} +/** Represents an update to a `FunctionGraph`. Fields that are set will be updated. */ +export interface FunctionGraphPatch { + /** Unique graph identifier */ + id?: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string; + /** Graph store (Merkle store) holding the graph definition */ + storeId?: string; + /** Entity context (org/team) for scoped billing */ + entityId?: string; + /** Evaluator/runtime context (function, js, sql, system) */ + context?: string; + /** Graph name (unique per database) */ + name?: string; + /** Human-readable description of the graph */ + description?: string; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string; + /** Whether graph passes structural validation */ + isValid?: boolean; + /** Array of validation error objects when is_valid = false */ + validationErrors?: unknown; + /** Actor who created this graph */ + createdBy?: string; + /** Timestamp of graph creation */ + createdAt?: string; + /** Timestamp of last modification */ + updatedAt?: string; +} +export interface UpdateOrgFunctionInvocationInput { + clientMutationId?: string; + /** Invocation creation timestamp (partition key) */ + createdAt: string; + /** Unique invocation identifier */ + id: string; + /** An object where the defined keys will be set on the `OrgFunctionInvocation` being updated. */ + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; +} +/** Represents an update to a `OrgFunctionInvocation`. Fields that are set will be updated. */ +export interface OrgFunctionInvocationPatch { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string; + /** Function input payload */ + payload?: unknown; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: unknown; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +export interface UpdateFunctionInvocationInput { + clientMutationId?: string; + /** Invocation creation timestamp (partition key) */ + createdAt: string; + /** Unique invocation identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionInvocation` being updated. */ + functionInvocationPatch: FunctionInvocationPatch; +} +/** Represents an update to a `FunctionInvocation`. Fields that are set will be updated. */ +export interface FunctionInvocationPatch { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string; + /** Function input payload */ + payload?: unknown; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: unknown; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +export interface UpdateFunctionDeploymentInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `FunctionDeployment` being updated. */ + functionDeploymentPatch: FunctionDeploymentPatch; +} +/** Represents an update to a `FunctionDeployment`. Fields that are set will be updated. */ +export interface FunctionDeploymentPatch { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function definition being deployed to this namespace */ + functionDefinitionId?: string; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId?: string; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number; + /** Container image override (NULL = inherit from function definition) */ + image?: string; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: unknown; + /** Most recent provisioning or runtime error message */ + lastError?: string; + /** Timestamp of the most recent error */ + lastErrorAt?: string; + /** Cumulative error count for this deployment */ + errorCount?: number; + /** Key/value pairs for selecting and filtering deployments */ + labels?: unknown; + /** Freeform metadata for tooling and operational notes */ + annotations?: unknown; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string; +} +export interface UpdateFunctionGraphExecutionInput { + clientMutationId?: string; + /** Execution start timestamp */ + startedAt: string; + /** Unique execution identifier */ + id: string; + /** An object where the defined keys will be set on the `FunctionGraphExecution` being updated. */ + functionGraphExecutionPatch: FunctionGraphExecutionPatch; +} +/** Represents an update to a `FunctionGraphExecution`. Fields that are set will be updated. */ +export interface FunctionGraphExecutionPatch { + /** Execution start timestamp */ + startedAt?: string; + /** Unique execution identifier */ + id?: string; + /** FK to the graph definition being executed */ + graphId?: string; + /** Parent function_invocations row (for metering) */ + invocationId?: string; + /** Scope for multi-tenant isolation */ + databaseId?: string; + /** Entity context (org/team) for scoped billing */ + entityId?: string; + /** Target output boundary node name to resolve */ + outputNode?: string; + /** Target output port name (default: value) */ + outputPort?: string; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Initial inputs provided at invocation time */ + inputPayload?: unknown; + /** Final result extracted from terminal output node */ + outputPayload?: unknown; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: unknown; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: unknown; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string; + /** Number of evaluate_step ticks executed */ + tickCount?: number; + /** Execution completion timestamp */ + completedAt?: string; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; +} +export interface UpdateFunctionDefinitionInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `FunctionDefinition` being updated. */ + functionDefinitionPatch: FunctionDefinitionPatch; +} +/** Represents an update to a `FunctionDefinition`. Fields that are set will be updated. */ +export interface FunctionDefinitionPatch { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope?: string; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name?: string; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier?: string; + /** Human-readable description of what this function does */ + description?: string; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number; + /** Job priority (lower = higher priority) */ + priority?: number; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number; + /** Knative request timeout in seconds */ + timeoutSeconds?: number; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: unknown; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirementInput[]; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirementInput[]; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[]; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[]; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: unknown; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: unknown; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: unknown; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string; +} +export interface DeleteFunctionApiBindingInput { + clientMutationId?: string; + id: string; +} +export interface DeleteFunctionGraphRefInput { + clientMutationId?: string; + /** Unique ref identifier */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; +} +export interface DeleteFunctionGraphStoreInput { + clientMutationId?: string; + /** Unique store identifier */ + id: string; +} +export interface DeleteFunctionGraphObjectInput { + clientMutationId?: string; + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; +} +export interface DeleteFunctionDeploymentEventInput { + clientMutationId?: string; + /** Event timestamp (partition key) */ + createdAt: string; + /** Unique event identifier */ + id: string; +} +export interface DeleteOrgFunctionExecutionLogInput { + clientMutationId?: string; + /** Log entry timestamp (partition key) */ + createdAt: string; + /** Unique log entry identifier */ + id: string; +} +export interface DeleteFunctionGraphExecutionOutputInput { + clientMutationId?: string; + /** Timestamp of output creation */ + createdAt: string; + /** Unique execution output identifier */ + id: string; +} +export interface DeleteFunctionGraphCommitInput { + clientMutationId?: string; + /** Unique commit identifier */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; +} +export interface DeleteSecretDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface DeleteFunctionExecutionLogInput { + clientMutationId?: string; + /** Log entry timestamp (partition key) */ + createdAt: string; + /** Unique log entry identifier */ + id: string; +} +export interface DeleteFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + /** Timestamp of node state creation (partition key) */ + createdAt: string; + /** Unique node state identifier */ + id: string; +} +export interface DeleteFunctionGraphInput { + clientMutationId?: string; + /** Unique graph identifier */ + id: string; +} +export interface DeleteOrgFunctionInvocationInput { + clientMutationId?: string; + /** Invocation creation timestamp (partition key) */ + createdAt: string; + /** Unique invocation identifier */ + id: string; +} +export interface DeleteFunctionInvocationInput { + clientMutationId?: string; + /** Invocation creation timestamp (partition key) */ + createdAt: string; + /** Unique invocation identifier */ + id: string; +} +export interface DeleteFunctionDeploymentInput { + clientMutationId?: string; + id: string; +} +export interface DeleteFunctionGraphExecutionInput { + clientMutationId?: string; + /** Execution start timestamp */ + startedAt: string; + /** Unique execution identifier */ + id: string; +} +export interface DeleteFunctionDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** A connection to a list of `GetAllRecord` values. */ +export interface GetAllConnection { + nodes: GetAllRecord[]; + edges: GetAllEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionApiBinding` values. */ +export interface FunctionApiBindingConnection { + nodes: FunctionApiBinding[]; + edges: FunctionApiBindingEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraphRef` values. */ +export interface FunctionGraphRefConnection { + nodes: FunctionGraphRef[]; + edges: FunctionGraphRefEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraphStore` values. */ +export interface FunctionGraphStoreConnection { + nodes: FunctionGraphStore[]; + edges: FunctionGraphStoreEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraphObject` values. */ +export interface FunctionGraphObjectConnection { + nodes: FunctionGraphObject[]; + edges: FunctionGraphObjectEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionDeploymentEvent` values. */ +export interface FunctionDeploymentEventConnection { + nodes: FunctionDeploymentEvent[]; + edges: FunctionDeploymentEventEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `OrgFunctionExecutionLog` values. */ +export interface OrgFunctionExecutionLogConnection { + nodes: OrgFunctionExecutionLog[]; + edges: OrgFunctionExecutionLogEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraphExecutionOutput` values. */ +export interface FunctionGraphExecutionOutputConnection { + nodes: FunctionGraphExecutionOutput[]; + edges: FunctionGraphExecutionOutputEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraphCommit` values. */ +export interface FunctionGraphCommitConnection { + nodes: FunctionGraphCommit[]; + edges: FunctionGraphCommitEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `SecretDefinition` values. */ +export interface SecretDefinitionConnection { + nodes: SecretDefinition[]; + edges: SecretDefinitionEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionExecutionLog` values. */ +export interface FunctionExecutionLogConnection { + nodes: FunctionExecutionLog[]; + edges: FunctionExecutionLogEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraphExecutionNodeState` values. */ +export interface FunctionGraphExecutionNodeStateConnection { + nodes: FunctionGraphExecutionNodeState[]; + edges: FunctionGraphExecutionNodeStateEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraph` values. */ +export interface FunctionGraphConnection { + nodes: FunctionGraph[]; + edges: FunctionGraphEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `OrgFunctionInvocation` values. */ +export interface OrgFunctionInvocationConnection { + nodes: OrgFunctionInvocation[]; + edges: OrgFunctionInvocationEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionInvocation` values. */ +export interface FunctionInvocationConnection { + nodes: FunctionInvocation[]; + edges: FunctionInvocationEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionDeployment` values. */ +export interface FunctionDeploymentConnection { + nodes: FunctionDeployment[]; + edges: FunctionDeploymentEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionGraphExecution` values. */ +export interface FunctionGraphExecutionConnection { + nodes: FunctionGraphExecution[]; + edges: FunctionGraphExecutionEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `FunctionDefinition` values. */ +export interface FunctionDefinitionConnection { + nodes: FunctionDefinition[]; + edges: FunctionDefinitionEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** Root meta schema type */ +export interface MetaSchema { + tables: MetaTable[]; +} +export interface ValidateFunctionGraphPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export interface InitEmptyRepoPayload { + clientMutationId?: string | null; +} +export interface SetDataAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface ImportDefinitionsPayload { + clientMutationId?: string | null; +} +export interface CopyGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface SaveGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface AddEdgeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface AddNodeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface CreateFunctionGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface AddEdgePayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface AddNodePayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface ImportGraphJsonPayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface InsertNodeAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface StartExecutionPayload { + clientMutationId?: string | null; + result?: string | null; +} +export interface CreateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was created by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export interface CreateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was created by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export interface CreateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was created by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export interface CreateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was created by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export interface CreateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was created by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export interface CreateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was created by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export interface CreateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was created by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export interface CreateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was created by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export interface CreateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was created by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export interface CreateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was created by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export interface CreateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was created by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export interface CreateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was created by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export interface CreateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was created by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export interface CreateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was created by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export interface CreateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was created by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export interface CreateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was created by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export interface UpdateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was updated by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export interface UpdateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was updated by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export interface UpdateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was updated by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export interface UpdateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was updated by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export interface UpdateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was updated by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export interface UpdateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was updated by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export interface UpdateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was updated by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export interface UpdateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was updated by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export interface UpdateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was updated by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export interface UpdateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was updated by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export interface UpdateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was updated by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export interface UpdateFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was updated by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export interface UpdateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was updated by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export interface UpdateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was updated by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export interface UpdateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was updated by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export interface UpdateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was updated by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export interface UpdateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was updated by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export interface DeleteFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was deleted by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export interface DeleteFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was deleted by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export interface DeleteFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was deleted by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export interface DeleteFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was deleted by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export interface DeleteFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was deleted by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export interface DeleteOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was deleted by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export interface DeleteFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was deleted by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export interface DeleteFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was deleted by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export interface DeleteSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was deleted by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export interface DeleteFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was deleted by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export interface DeleteFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was deleted by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export interface DeleteFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was deleted by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export interface DeleteOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was deleted by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export interface DeleteFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was deleted by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export interface DeleteFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was deleted by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export interface DeleteFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was deleted by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export interface DeleteFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was deleted by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +/** A `GetAllRecord` edge in the connection. */ +export interface GetAllEdge { + cursor?: string | null; + /** The `GetAllRecord` at the end of the edge. */ + node?: GetAllRecord | null; +} +/** Information about pagination in a connection. */ +export interface PageInfo { + /** When paginating forwards, are there more items? */ + hasNextPage: boolean; + /** When paginating backwards, are there more items? */ + hasPreviousPage: boolean; + /** When paginating backwards, the cursor to continue. */ + startCursor?: string | null; + /** When paginating forwards, the cursor to continue. */ + endCursor?: string | null; +} +/** A `FunctionApiBinding` edge in the connection. */ +export interface FunctionApiBindingEdge { + cursor?: string | null; + /** The `FunctionApiBinding` at the end of the edge. */ + node?: FunctionApiBinding | null; +} +/** A `FunctionGraphRef` edge in the connection. */ +export interface FunctionGraphRefEdge { + cursor?: string | null; + /** The `FunctionGraphRef` at the end of the edge. */ + node?: FunctionGraphRef | null; +} +/** A `FunctionGraphStore` edge in the connection. */ +export interface FunctionGraphStoreEdge { + cursor?: string | null; + /** The `FunctionGraphStore` at the end of the edge. */ + node?: FunctionGraphStore | null; +} +/** A `FunctionGraphObject` edge in the connection. */ +export interface FunctionGraphObjectEdge { + cursor?: string | null; + /** The `FunctionGraphObject` at the end of the edge. */ + node?: FunctionGraphObject | null; +} +/** A `FunctionDeploymentEvent` edge in the connection. */ +export interface FunctionDeploymentEventEdge { + cursor?: string | null; + /** The `FunctionDeploymentEvent` at the end of the edge. */ + node?: FunctionDeploymentEvent | null; +} +/** A `OrgFunctionExecutionLog` edge in the connection. */ +export interface OrgFunctionExecutionLogEdge { + cursor?: string | null; + /** The `OrgFunctionExecutionLog` at the end of the edge. */ + node?: OrgFunctionExecutionLog | null; +} +/** A `FunctionGraphExecutionOutput` edge in the connection. */ +export interface FunctionGraphExecutionOutputEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionOutput` at the end of the edge. */ + node?: FunctionGraphExecutionOutput | null; +} +/** A `FunctionGraphCommit` edge in the connection. */ +export interface FunctionGraphCommitEdge { + cursor?: string | null; + /** The `FunctionGraphCommit` at the end of the edge. */ + node?: FunctionGraphCommit | null; +} +/** A `SecretDefinition` edge in the connection. */ +export interface SecretDefinitionEdge { + cursor?: string | null; + /** The `SecretDefinition` at the end of the edge. */ + node?: SecretDefinition | null; +} +/** A `FunctionExecutionLog` edge in the connection. */ +export interface FunctionExecutionLogEdge { + cursor?: string | null; + /** The `FunctionExecutionLog` at the end of the edge. */ + node?: FunctionExecutionLog | null; +} +/** A `FunctionGraphExecutionNodeState` edge in the connection. */ +export interface FunctionGraphExecutionNodeStateEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionNodeState` at the end of the edge. */ + node?: FunctionGraphExecutionNodeState | null; +} +/** A `FunctionGraph` edge in the connection. */ +export interface FunctionGraphEdge { + cursor?: string | null; + /** The `FunctionGraph` at the end of the edge. */ + node?: FunctionGraph | null; +} +/** A `OrgFunctionInvocation` edge in the connection. */ +export interface OrgFunctionInvocationEdge { + cursor?: string | null; + /** The `OrgFunctionInvocation` at the end of the edge. */ + node?: OrgFunctionInvocation | null; +} +/** A `FunctionInvocation` edge in the connection. */ +export interface FunctionInvocationEdge { + cursor?: string | null; + /** The `FunctionInvocation` at the end of the edge. */ + node?: FunctionInvocation | null; +} +/** A `FunctionDeployment` edge in the connection. */ +export interface FunctionDeploymentEdge { + cursor?: string | null; + /** The `FunctionDeployment` at the end of the edge. */ + node?: FunctionDeployment | null; +} +/** A `FunctionGraphExecution` edge in the connection. */ +export interface FunctionGraphExecutionEdge { + cursor?: string | null; + /** The `FunctionGraphExecution` at the end of the edge. */ + node?: FunctionGraphExecution | null; +} +/** A `FunctionDefinition` edge in the connection. */ +export interface FunctionDefinitionEdge { + cursor?: string | null; + /** The `FunctionDefinition` at the end of the edge. */ + node?: FunctionDefinition | null; +} +/** Information about a database table */ +export interface MetaTable { + name: string; + schemaName: string; + fields: MetaField[]; + indexes: MetaIndex[]; + constraints: MetaConstraints; + foreignKeyConstraints: MetaForeignKeyConstraint[]; + primaryKeyConstraints: MetaPrimaryKeyConstraint[]; + uniqueConstraints: MetaUniqueConstraint[]; + relations: MetaRelations; + inflection: MetaInflection; + query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; +} +/** Information about a table field/column */ +export interface MetaField { + name: string; + type: MetaType; + isNotNull: boolean; + hasDefault: boolean; + isPrimaryKey: boolean; + isForeignKey: boolean; + description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; +} +/** Information about a database index */ +export interface MetaIndex { + name: string; + isUnique: boolean; + isPrimary: boolean; + columns: string[]; + fields?: MetaField[] | null; +} +/** Table constraints */ +export interface MetaConstraints { + primaryKey?: MetaPrimaryKeyConstraint | null; + unique: MetaUniqueConstraint[]; + foreignKey: MetaForeignKeyConstraint[]; +} +/** Information about a foreign key constraint */ +export interface MetaForeignKeyConstraint { + name: string; + fields: MetaField[]; + referencedTable: string; + referencedFields: string[]; + refFields?: MetaField[] | null; + refTable?: MetaRefTable | null; +} +/** Information about a primary key constraint */ +export interface MetaPrimaryKeyConstraint { + name: string; + fields: MetaField[]; +} +/** Information about a unique constraint */ +export interface MetaUniqueConstraint { + name: string; + fields: MetaField[]; +} +/** Table relations */ +export interface MetaRelations { + belongsTo: MetaBelongsToRelation[]; + has: MetaHasRelation[]; + hasOne: MetaHasRelation[]; + hasMany: MetaHasRelation[]; + manyToMany: MetaManyToManyRelation[]; +} +/** Table inflection names */ +export interface MetaInflection { + tableType: string; + allRows: string; + connection: string; + edge: string; + filterType?: string | null; + orderByType: string; + conditionType: string; + patchType?: string | null; + createInputType: string; + createPayloadType: string; + updatePayloadType?: string | null; + deletePayloadType: string; +} +/** Table query/mutation names */ +export interface MetaQuery { + all: string; + one?: string | null; + create?: string | null; + update?: string | null; + delete?: string | null; +} +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} +/** Information about a PostgreSQL type */ +export interface MetaType { + pgType: string; + gqlType: string; + isArray: boolean; + isNotNull?: boolean | null; + hasDefault?: boolean | null; + subtype?: string | null; +} +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} +/** Reference to a related table */ +export interface MetaRefTable { + name: string; +} +/** A belongs-to (forward FK) relation */ +export interface MetaBelongsToRelation { + fieldName?: string | null; + isUnique: boolean; + type?: string | null; + keys: MetaField[]; + references: MetaRefTable; +} +/** A has-one or has-many (reverse FK) relation */ +export interface MetaHasRelation { + fieldName?: string | null; + isUnique: boolean; + type?: string | null; + keys: MetaField[]; + referencedBy: MetaRefTable; +} +/** A many-to-many relation via junction table */ +export interface MetaManyToManyRelation { + fieldName?: string | null; + type?: string | null; + junctionTable: MetaRefTable; + junctionLeftConstraint: MetaForeignKeyConstraint; + junctionLeftKeyAttributes: MetaField[]; + junctionRightConstraint: MetaForeignKeyConstraint; + junctionRightKeyAttributes: MetaField[]; + leftKeyAttributes: MetaField[]; + rightKeyAttributes: MetaField[]; + rightTable: MetaRefTable; +} +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/compute/types.ts b/sdk/constructive-react/src/compute/types.ts new file mode 100644 index 0000000000..ba56afb0fd --- /dev/null +++ b/sdk/constructive-react/src/compute/types.ts @@ -0,0 +1,466 @@ +/** + * Entity types and filter types + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export type Base64EncodedBinary = unknown; +export type FunctionRequirement = unknown; +export interface GetAllRecord { + path: string[] | null; + data: unknown | null; +} +export interface FunctionApiBinding { + id: string | null; + functionDefinitionId: string | null; + apiId: string | null; + alias: string | null; + config: unknown | null; +} +export interface FunctionDeployment { + id: string | null; + createdAt: string | null; + updatedAt: string | null; + functionDefinitionId: string | null; + namespaceId: string | null; + status: string | null; + serviceUrl: string | null; + serviceName: string | null; + revision: number | null; + image: string | null; + concurrency: number | null; + scaleMin: number | null; + scaleMax: number | null; + timeoutSeconds: number | null; + resources: unknown | null; + lastError: string | null; + lastErrorAt: string | null; + errorCount: number | null; + labels: unknown | null; + annotations: unknown | null; + databaseId: string | null; +} +export interface FunctionGraphRef { + id: string | null; + name: string | null; + databaseId: string | null; + storeId: string | null; + commitId: string | null; +} +export interface FunctionGraphStore { + id: string | null; + name: string | null; + databaseId: string | null; + hash: string | null; + createdAt: string | null; +} +export interface FunctionGraphObject { + id: string | null; + databaseId: string | null; + kids: string[] | null; + ktree: string[] | null; + data: unknown | null; + createdAt: string | null; +} +export interface FunctionDeploymentEvent { + createdAt: string | null; + id: string | null; + deploymentId: string | null; + eventType: string | null; + actorId: string | null; + message: string | null; + metadata: unknown | null; + databaseId: string | null; +} +export interface OrgFunctionExecutionLog { + createdAt: string | null; + id: string | null; + invocationId: string | null; + taskIdentifier: string | null; + logLevel: string | null; + message: string | null; + metadata: unknown | null; + actorId: string | null; +} +export interface FunctionGraphExecutionOutput { + createdAt: string | null; + id: string | null; + databaseId: string | null; + hash: Base64EncodedBinary | null; + data: unknown | null; +} +export interface FunctionGraphCommit { + id: string | null; + message: string | null; + databaseId: string | null; + storeId: string | null; + parentIds: string[] | null; + authorId: string | null; + committerId: string | null; + treeId: string | null; + date: string | null; +} +export interface SecretDefinition { + id: string | null; + createdAt: string | null; + updatedAt: string | null; + name: string | null; + description: string | null; + isBuiltIn: boolean | null; + labels: unknown | null; + annotations: unknown | null; + databaseId: string | null; +} +export interface FunctionExecutionLog { + createdAt: string | null; + id: string | null; + invocationId: string | null; + taskIdentifier: string | null; + logLevel: string | null; + message: string | null; + metadata: unknown | null; + actorId: string | null; + databaseId: string | null; +} +export interface FunctionGraphExecutionNodeState { + createdAt: string | null; + id: string | null; + executionId: string | null; + databaseId: string | null; + nodeName: string | null; + nodePath: string[] | null; + status: string | null; + startedAt: string | null; + completedAt: string | null; + errorCode: string | null; + errorMessage: string | null; + outputId: string | null; +} +export interface FunctionGraph { + id: string | null; + databaseId: string | null; + storeId: string | null; + entityId: string | null; + context: string | null; + name: string | null; + description: string | null; + definitionsCommitId: string | null; + isValid: boolean | null; + validationErrors: unknown | null; + createdBy: string | null; + createdAt: string | null; + updatedAt: string | null; +} +export interface OrgFunctionInvocation { + createdAt: string | null; + id: string | null; + actorId: string | null; + taskIdentifier: string | null; + payload: unknown | null; + status: string | null; + result: unknown | null; + error: string | null; + durationMs: number | null; + jobId: string | null; + startedAt: string | null; + completedAt: string | null; + parentInvocationId: string | null; + graphExecutionId: string | null; +} +export interface FunctionInvocation { + createdAt: string | null; + id: string | null; + actorId: string | null; + databaseId: string | null; + taskIdentifier: string | null; + payload: unknown | null; + status: string | null; + result: unknown | null; + error: string | null; + durationMs: number | null; + jobId: string | null; + startedAt: string | null; + completedAt: string | null; + parentInvocationId: string | null; + graphExecutionId: string | null; +} +export interface FunctionGraphExecution { + startedAt: string | null; + id: string | null; + graphId: string | null; + invocationId: string | null; + databaseId: string | null; + entityId: string | null; + outputNode: string | null; + outputPort: string | null; + status: string | null; + inputPayload: unknown | null; + outputPayload: unknown | null; + nodeOutputs: unknown | null; + executionPlan: unknown | null; + currentWave: number | null; + parentExecutionId: string | null; + parentNodeName: string | null; + definitionsCommitId: string | null; + tickCount: number | null; + completedAt: string | null; + maxTicks: number | null; + maxPendingJobs: number | null; + timeoutAt: string | null; + errorCode: string | null; + errorMessage: string | null; +} +export interface FunctionDefinition { + id: string | null; + createdAt: string | null; + updatedAt: string | null; + scope: string | null; + name: string | null; + taskIdentifier: string | null; + description: string | null; + isInvocable: boolean | null; + maxAttempts: number | null; + priority: number | null; + queueName: string | null; + runtime: string | null; + image: string | null; + concurrency: number | null; + scaleMin: number | null; + scaleMax: number | null; + timeoutSeconds: number | null; + resources: unknown | null; + isBuiltIn: boolean | null; + requiredSecrets: FunctionRequirement[] | null; + requiredConfigs: FunctionRequirement[] | null; + requiredBuckets: string[] | null; + requiredModels: string[] | null; + inputs: unknown | null; + outputs: unknown | null; + props: unknown | null; + volatile: boolean | null; + icon: string | null; + category: string | null; +} +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: unknown; + containedBy?: unknown; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containedBy?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} diff --git a/sdk/constructive-react/src/config/README.md b/sdk/constructive-react/src/config/README.md new file mode 100644 index 0000000000..1048f8f6a4 --- /dev/null +++ b/sdk/constructive-react/src/config/README.md @@ -0,0 +1,54 @@ +# Generated GraphQL SDK + +

+ +

+ + + +## Overview + +- **Tables:** 2 +- **Custom queries:** 0 +- **Custom mutations:** 9 + +**Generators:** ORM, React Query + +## Modules + +### ORM Client (`./orm`) + +Prisma-like ORM client for programmatic GraphQL access. + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', +}); +``` + +See [orm/README.md](./orm/README.md) for full API reference. + +### React Query Hooks (`./hooks`) + +Type-safe React Query hooks for data fetching and mutations. + +```typescript +import { configure } from './hooks'; +import { useCarsQuery } from './hooks'; + +configure({ endpoint: 'https://api.example.com/graphql' }); +``` + +See [hooks/README.md](./hooks/README.md) for full hook reference. + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-react/src/config/hooks/README.md b/sdk/constructive-react/src/config/hooks/README.md new file mode 100644 index 0000000000..cf58c9f3b8 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/README.md @@ -0,0 +1,214 @@ +# React Query Hooks + +

+ +

+ + + +## Setup + +```typescript +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { configure } from './hooks'; + +configure({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); + +const queryClient = new QueryClient(); + +function App() { + return ( + + + + ); +} +``` + +## Hooks + +| Hook | Type | Description | +|------|------|-------------| +| `usePlatformConfigDefinitionsQuery` | Query | Registry of valid config keys — declares which config entries the platform recognizes | +| `usePlatformConfigDefinitionQuery` | Query | Registry of valid config keys — declares which config entries the platform recognizes | +| `useCreatePlatformConfigDefinitionMutation` | Mutation | Registry of valid config keys — declares which config entries the platform recognizes | +| `useUpdatePlatformConfigDefinitionMutation` | Mutation | Registry of valid config keys — declares which config entries the platform recognizes | +| `useDeletePlatformConfigDefinitionMutation` | Mutation | Registry of valid config keys — declares which config entries the platform recognizes | +| `usePlatformConfigsQuery` | Query | App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed | +| `usePlatformConfigQuery` | Query | App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed | +| `useCreatePlatformConfigMutation` | Mutation | App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed | +| `useUpdatePlatformConfigMutation` | Mutation | App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed | +| `useDeletePlatformConfigMutation` | Mutation | App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed | +| `usePlatformSecretsDelMutation` | Mutation | platformSecretsDel | +| `useOrgSecretsDelMutation` | Mutation | orgSecretsDel | +| `usePlatformSecretsRemoveArrayMutation` | Mutation | platformSecretsRemoveArray | +| `useOrgSecretsRemoveArrayMutation` | Mutation | orgSecretsRemoveArray | +| `usePlatformSecretsRotateMutation` | Mutation | platformSecretsRotate | +| `usePlatformSecretsSetMutation` | Mutation | platformSecretsSet | +| `useOrgSecretsRotateMutation` | Mutation | orgSecretsRotate | +| `useOrgSecretsSetMutation` | Mutation | orgSecretsSet | +| `useProvisionBucketMutation` | Mutation | Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. | + +## Table Hooks + +### PlatformConfigDefinition + +```typescript +// List all platformConfigDefinitions +const { data, isLoading } = usePlatformConfigDefinitionsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }, +}); + +// Get one platformConfigDefinition +const { data: item } = usePlatformConfigDefinitionQuery({ + id: '', + selection: { fields: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }, +}); + +// Create a platformConfigDefinition +const { mutate: create } = useCreatePlatformConfigDefinitionMutation({ + selection: { fields: { id: true } }, +}); +create({ name: '', description: '', defaultValue: '', isBuiltIn: '', labels: '', annotations: '' }); +``` + +### PlatformConfig + +```typescript +// List all platformConfigs +const { data, isLoading } = usePlatformConfigsQuery({ + selection: { fields: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }, +}); + +// Get one platformConfig +const { data: item } = usePlatformConfigQuery({ + id: '', + selection: { fields: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }, +}); + +// Create a platformConfig +const { mutate: create } = useCreatePlatformConfigMutation({ + selection: { fields: { id: true } }, +}); +create({ namespaceId: '', name: '', value: '', labels: '', annotations: '', description: '', expiresAt: '' }); +``` + +## Custom Operation Hooks + +### `usePlatformSecretsDelMutation` + +platformSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsDelInput (required) | + +### `useOrgSecretsDelMutation` + +orgSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsDelInput (required) | + +### `usePlatformSecretsRemoveArrayMutation` + +platformSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRemoveArrayInput (required) | + +### `useOrgSecretsRemoveArrayMutation` + +orgSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRemoveArrayInput (required) | + +### `usePlatformSecretsRotateMutation` + +platformSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRotateInput (required) | + +### `usePlatformSecretsSetMutation` + +platformSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsSetInput (required) | + +### `useOrgSecretsRotateMutation` + +orgSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRotateInput (required) | + +### `useOrgSecretsSetMutation` + +orgSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsSetInput (required) | + +### `useProvisionBucketMutation` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-react/src/config/hooks/client.ts b/sdk/constructive-react/src/config/hooks/client.ts new file mode 100644 index 0000000000..47b9aa63f4 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/client.ts @@ -0,0 +1,42 @@ +/** + * ORM client wrapper for React Query hooks + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { createClient } from '../orm'; +import type { OrmClientConfig } from '../orm/client'; + +export type { OrmClientConfig } from '../orm/client'; +export type { GraphQLAdapter, GraphQLError, QueryResult } from '../orm/client'; +export { GraphQLRequestError } from '../orm/client'; + +type OrmClientInstance = ReturnType; +let client: OrmClientInstance | null = null; + +/** + * Configure the ORM client for React Query hooks + * + * @example + * ```ts + * import { configure } from './generated/hooks'; + * + * configure({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer ' }, + * }); + * ``` + */ +export function configure(config: OrmClientConfig): void { + client = createClient(config); +} + +/** + * Get the configured ORM client instance + * @throws Error if configure() has not been called + */ +export function getClient(): OrmClientInstance { + if (!client) { + throw new Error('ORM client not configured. Call configure() before using hooks.'); + } + return client; +} diff --git a/sdk/constructive-react/src/config/hooks/index.ts b/sdk/constructive-react/src/config/hooks/index.ts new file mode 100644 index 0000000000..faacb942c8 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/index.ts @@ -0,0 +1,39 @@ +/** + * GraphQL SDK + * @generated by @constructive-io/graphql-codegen + * + * Tables: PlatformConfigDefinition, PlatformConfig + * + * Usage: + * + * 1. Configure the client: + * ```ts + * import { configure } from './generated'; + * + * configure({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer ' }, + * }); + * ``` + * + * 2. Use the hooks: + * ```tsx + * import { useCarsQuery, useCreateCarMutation } from './generated'; + * + * function MyComponent() { + * const { data, isLoading } = useCarsQuery({ + * selection: { fields: { id: true }, first: 10 }, + * }); + * const { mutate } = useCreateCarMutation({ + * selection: { fields: { id: true } }, + * }); + * // ... + * } + * ``` + */ +export * from './client'; +export * from './query-keys'; +export * from './mutation-keys'; +export * from './invalidation'; +export * from './queries'; +export * from './mutations'; diff --git a/sdk/constructive-react/src/config/hooks/invalidation.ts b/sdk/constructive-react/src/config/hooks/invalidation.ts new file mode 100644 index 0000000000..2d85346ef1 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/invalidation.ts @@ -0,0 +1,101 @@ +/** + * Cache invalidation helpers + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// ============================================================================ +// Type-safe cache invalidation utilities +// +// Features: +// - Simple invalidation helpers per entity +// - Cascade invalidation for parent-child relationships +// - Remove helpers for delete operations +// ============================================================================ + +import type { QueryClient } from '@tanstack/react-query'; +import { platformConfigDefinitionKeys, platformConfigKeys } from './query-keys'; +/** +// ============================================================================ +// Invalidation Helpers +// ============================================================================ + + * Type-safe query invalidation helpers + * + * @example + * ```ts + * // Invalidate all user queries + * invalidate.user.all(queryClient); + * + * // Invalidate user lists + * invalidate.user.lists(queryClient); + * + * // Invalidate specific user + * invalidate.user.detail(queryClient, userId); + * ``` + */ +export const invalidate = { + /** Invalidate platformConfigDefinition queries */ platformConfigDefinition: { + /** Invalidate all platformConfigDefinition queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformConfigDefinitionKeys.all, + }), + /** Invalidate platformConfigDefinition list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformConfigDefinitionKeys.lists(), + }), + /** Invalidate a specific platformConfigDefinition */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformConfigDefinitionKeys.detail(id), + }), + }, + /** Invalidate platformConfig queries */ platformConfig: { + /** Invalidate all platformConfig queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.all, + }), + /** Invalidate platformConfig list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.lists(), + }), + /** Invalidate a specific platformConfig */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.detail(id), + }), + }, +} as const; +/** + +// ============================================================================ +// Remove Helpers (for delete operations) +// ============================================================================ + + * Remove queries from cache (for delete operations) + * + * Use these when an entity is deleted to remove it from cache + * instead of just invalidating (which would trigger a refetch). + */ +export const remove = { + /** Remove platformConfigDefinition from cache */ platformConfigDefinition: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: platformConfigDefinitionKeys.detail(id), + }); + }, + /** Remove platformConfig from cache */ platformConfig: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: platformConfigKeys.detail(id), + }); + }, +} as const; diff --git a/sdk/constructive-react/src/config/hooks/mutation-keys.ts b/sdk/constructive-react/src/config/hooks/mutation-keys.ts new file mode 100644 index 0000000000..28cb9967b5 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutation-keys.ts @@ -0,0 +1,113 @@ +/** + * Centralized mutation key factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// ============================================================================ +// Mutation keys for tracking in-flight mutations +// +// Benefits: +// - Track mutation state with useIsMutating +// - Implement optimistic updates with proper rollback +// - Deduplicate identical mutations +// - Coordinate related mutations +// ============================================================================ + +// ============================================================================ +// Entity Mutation Keys +// ============================================================================ + +export const platformConfigDefinitionMutationKeys = { + /** All platformConfigDefinition mutation keys */ all: [ + 'mutation', + 'platformconfigdefinition', + ] as const, + /** Create platformConfigDefinition mutation key */ create: () => + ['mutation', 'platformconfigdefinition', 'create'] as const, + /** Update platformConfigDefinition mutation key */ update: (id: string | number) => + ['mutation', 'platformconfigdefinition', 'update', id] as const, + /** Delete platformConfigDefinition mutation key */ delete: (id: string | number) => + ['mutation', 'platformconfigdefinition', 'delete', id] as const, +} as const; +export const platformConfigMutationKeys = { + /** All platformConfig mutation keys */ all: ['mutation', 'platformconfig'] as const, + /** Create platformConfig mutation key */ create: () => + ['mutation', 'platformconfig', 'create'] as const, + /** Update platformConfig mutation key */ update: (id: string | number) => + ['mutation', 'platformconfig', 'update', id] as const, + /** Delete platformConfig mutation key */ delete: (id: string | number) => + ['mutation', 'platformconfig', 'delete', id] as const, +} as const; + +// ============================================================================ +// Custom Mutation Keys +// ============================================================================ + +export const customMutationKeys = { + /** Mutation key for platformSecretsDel */ platformSecretsDel: (identifier?: string) => + identifier + ? (['mutation', 'platformSecretsDel', identifier] as const) + : (['mutation', 'platformSecretsDel'] as const), + /** Mutation key for orgSecretsDel */ orgSecretsDel: (identifier?: string) => + identifier + ? (['mutation', 'orgSecretsDel', identifier] as const) + : (['mutation', 'orgSecretsDel'] as const), + /** Mutation key for platformSecretsRemoveArray */ platformSecretsRemoveArray: ( + identifier?: string + ) => + identifier + ? (['mutation', 'platformSecretsRemoveArray', identifier] as const) + : (['mutation', 'platformSecretsRemoveArray'] as const), + /** Mutation key for orgSecretsRemoveArray */ orgSecretsRemoveArray: (identifier?: string) => + identifier + ? (['mutation', 'orgSecretsRemoveArray', identifier] as const) + : (['mutation', 'orgSecretsRemoveArray'] as const), + /** Mutation key for platformSecretsRotate */ platformSecretsRotate: (identifier?: string) => + identifier + ? (['mutation', 'platformSecretsRotate', identifier] as const) + : (['mutation', 'platformSecretsRotate'] as const), + /** Mutation key for platformSecretsSet */ platformSecretsSet: (identifier?: string) => + identifier + ? (['mutation', 'platformSecretsSet', identifier] as const) + : (['mutation', 'platformSecretsSet'] as const), + /** Mutation key for orgSecretsRotate */ orgSecretsRotate: (identifier?: string) => + identifier + ? (['mutation', 'orgSecretsRotate', identifier] as const) + : (['mutation', 'orgSecretsRotate'] as const), + /** Mutation key for orgSecretsSet */ orgSecretsSet: (identifier?: string) => + identifier + ? (['mutation', 'orgSecretsSet', identifier] as const) + : (['mutation', 'orgSecretsSet'] as const), + /** Mutation key for provisionBucket */ provisionBucket: (identifier?: string) => + identifier + ? (['mutation', 'provisionBucket', identifier] as const) + : (['mutation', 'provisionBucket'] as const), +} as const; +/** + +// ============================================================================ +// Unified Mutation Key Store +// ============================================================================ + + * Unified mutation key store + * + * Use this for tracking in-flight mutations with useIsMutating. + * + * @example + * ```ts + * import { useIsMutating } from '@tanstack/react-query'; + * import { mutationKeys } from './generated'; + * + * // Check if any user mutations are in progress + * const isMutatingUser = useIsMutating({ mutationKey: mutationKeys.user.all }); + * + * // Check if a specific user is being updated + * const isUpdating = useIsMutating({ mutationKey: mutationKeys.user.update(userId) }); + * ``` + */ +export const mutationKeys = { + platformConfigDefinition: platformConfigDefinitionMutationKeys, + platformConfig: platformConfigMutationKeys, + custom: customMutationKeys, +} as const; diff --git a/sdk/constructive-react/src/config/hooks/mutations/index.ts b/sdk/constructive-react/src/config/hooks/mutations/index.ts new file mode 100644 index 0000000000..01e4a4fa31 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/index.ts @@ -0,0 +1,20 @@ +/** + * Mutation hooks barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export * from './useCreatePlatformConfigDefinitionMutation'; +export * from './useUpdatePlatformConfigDefinitionMutation'; +export * from './useDeletePlatformConfigDefinitionMutation'; +export * from './useCreatePlatformConfigMutation'; +export * from './useUpdatePlatformConfigMutation'; +export * from './useDeletePlatformConfigMutation'; +export * from './usePlatformSecretsDelMutation'; +export * from './useOrgSecretsDelMutation'; +export * from './usePlatformSecretsRemoveArrayMutation'; +export * from './useOrgSecretsRemoveArrayMutation'; +export * from './usePlatformSecretsRotateMutation'; +export * from './usePlatformSecretsSetMutation'; +export * from './useOrgSecretsRotateMutation'; +export * from './useOrgSecretsSetMutation'; +export * from './useProvisionBucketMutation'; diff --git a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigDefinitionMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigDefinitionMutation.ts new file mode 100644 index 0000000000..d4d968334c --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigDefinitionMutation.ts @@ -0,0 +1,91 @@ +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigDefinitionKeys } from '../query-keys'; +import { platformConfigDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, + CreatePlatformConfigDefinitionInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, + CreatePlatformConfigDefinitionInput, +} from '../../orm/input-types'; +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```tsx + * const { mutate, isPending } = useCreatePlatformConfigDefinitionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreatePlatformConfigDefinitionMutation( + params: { + selection: { + fields: S & PlatformConfigDefinitionSelect; + } & HookStrictSelect, PlatformConfigDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }, + Error, + CreatePlatformConfigDefinitionInput['platformConfigDefinition'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }, + Error, + CreatePlatformConfigDefinitionInput['platformConfigDefinition'] +>; +export function useCreatePlatformConfigDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: platformConfigDefinitionMutationKeys.create(), + mutationFn: (data: CreatePlatformConfigDefinitionInput['platformConfigDefinition']) => + getClient() + .platformConfigDefinition.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: platformConfigDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigMutation.ts new file mode 100644 index 0000000000..2a3c3f743f --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useCreatePlatformConfigMutation.ts @@ -0,0 +1,91 @@ +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import { platformConfigMutationKeys } from '../mutation-keys'; +import type { + PlatformConfigSelect, + PlatformConfigWithRelations, + CreatePlatformConfigInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigSelect, + PlatformConfigWithRelations, + CreatePlatformConfigInput, +} from '../../orm/input-types'; +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```tsx + * const { mutate, isPending } = useCreatePlatformConfigMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreatePlatformConfigMutation( + params: { + selection: { + fields: S & PlatformConfigSelect; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseMutationOptions< + { + createPlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + CreatePlatformConfigInput['platformConfig'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + CreatePlatformConfigInput['platformConfig'] +>; +export function useCreatePlatformConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: platformConfigMutationKeys.create(), + mutationFn: (data: CreatePlatformConfigInput['platformConfig']) => + getClient() + .platformConfig.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigDefinitionMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigDefinitionMutation.ts new file mode 100644 index 0000000000..4cd5b7b9a1 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigDefinitionMutation.ts @@ -0,0 +1,104 @@ +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigDefinitionKeys } from '../query-keys'; +import { platformConfigDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, +} from '../../orm/input-types'; +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```tsx + * const { mutate, isPending } = useDeletePlatformConfigDefinitionMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeletePlatformConfigDefinitionMutation( + params: { + selection: { + fields: S & PlatformConfigDefinitionSelect; + } & HookStrictSelect, PlatformConfigDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformConfigDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: platformConfigDefinitionMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .platformConfigDefinition.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: platformConfigDefinitionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: platformConfigDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigMutation.ts new file mode 100644 index 0000000000..ec92e5af48 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useDeletePlatformConfigMutation.ts @@ -0,0 +1,98 @@ +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import { platformConfigMutationKeys } from '../mutation-keys'; +import type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```tsx + * const { mutate, isPending } = useDeletePlatformConfigMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeletePlatformConfigMutation( + params: { + selection: { + fields: S & PlatformConfigSelect; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseMutationOptions< + { + deletePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePlatformConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: platformConfigMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .platformConfig.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: platformConfigKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsDelMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsDelMutation.ts new file mode 100644 index 0000000000..5fb0778500 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsDelMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for orgSecretsDel + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { OrgSecretsDelVariables } from '../../orm/mutation'; +import type { OrgSecretsDelPayloadSelect, OrgSecretsDelPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { OrgSecretsDelVariables } from '../../orm/mutation'; +export type { OrgSecretsDelPayloadSelect } from '../../orm/input-types'; +export function useOrgSecretsDelMutation( + params: { + selection: { + fields: S & OrgSecretsDelPayloadSelect; + } & HookStrictSelect, OrgSecretsDelPayloadSelect>; + } & Omit< + UseMutationOptions< + { + orgSecretsDel: InferSelectResult | null; + }, + Error, + OrgSecretsDelVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + orgSecretsDel: InferSelectResult | null; + }, + Error, + OrgSecretsDelVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.orgSecretsDel(), + mutationFn: (variables: OrgSecretsDelVariables) => + getClient() + .mutation.orgSecretsDel(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsRemoveArrayMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsRemoveArrayMutation.ts new file mode 100644 index 0000000000..1e0d83620c --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsRemoveArrayMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for orgSecretsRemoveArray + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { OrgSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { + OrgSecretsRemoveArrayPayloadSelect, + OrgSecretsRemoveArrayPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { OrgSecretsRemoveArrayVariables } from '../../orm/mutation'; +export type { OrgSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export function useOrgSecretsRemoveArrayMutation( + params: { + selection: { + fields: S & OrgSecretsRemoveArrayPayloadSelect; + } & HookStrictSelect, OrgSecretsRemoveArrayPayloadSelect>; + } & Omit< + UseMutationOptions< + { + orgSecretsRemoveArray: InferSelectResult | null; + }, + Error, + OrgSecretsRemoveArrayVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + orgSecretsRemoveArray: InferSelectResult | null; + }, + Error, + OrgSecretsRemoveArrayVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.orgSecretsRemoveArray(), + mutationFn: (variables: OrgSecretsRemoveArrayVariables) => + getClient() + .mutation.orgSecretsRemoveArray(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsRotateMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsRotateMutation.ts new file mode 100644 index 0000000000..4523b29c1d --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsRotateMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for orgSecretsRotate + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { OrgSecretsRotateVariables } from '../../orm/mutation'; +import type { OrgSecretsRotatePayloadSelect, OrgSecretsRotatePayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { OrgSecretsRotateVariables } from '../../orm/mutation'; +export type { OrgSecretsRotatePayloadSelect } from '../../orm/input-types'; +export function useOrgSecretsRotateMutation( + params: { + selection: { + fields: S & OrgSecretsRotatePayloadSelect; + } & HookStrictSelect, OrgSecretsRotatePayloadSelect>; + } & Omit< + UseMutationOptions< + { + orgSecretsRotate: InferSelectResult | null; + }, + Error, + OrgSecretsRotateVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + orgSecretsRotate: InferSelectResult | null; + }, + Error, + OrgSecretsRotateVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.orgSecretsRotate(), + mutationFn: (variables: OrgSecretsRotateVariables) => + getClient() + .mutation.orgSecretsRotate(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsSetMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsSetMutation.ts new file mode 100644 index 0000000000..730c4171a2 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useOrgSecretsSetMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for orgSecretsSet + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { OrgSecretsSetVariables } from '../../orm/mutation'; +import type { OrgSecretsSetPayloadSelect, OrgSecretsSetPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { OrgSecretsSetVariables } from '../../orm/mutation'; +export type { OrgSecretsSetPayloadSelect } from '../../orm/input-types'; +export function useOrgSecretsSetMutation( + params: { + selection: { + fields: S & OrgSecretsSetPayloadSelect; + } & HookStrictSelect, OrgSecretsSetPayloadSelect>; + } & Omit< + UseMutationOptions< + { + orgSecretsSet: InferSelectResult | null; + }, + Error, + OrgSecretsSetVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + orgSecretsSet: InferSelectResult | null; + }, + Error, + OrgSecretsSetVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.orgSecretsSet(), + mutationFn: (variables: OrgSecretsSetVariables) => + getClient() + .mutation.orgSecretsSet(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsDelMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsDelMutation.ts new file mode 100644 index 0000000000..d55783e12a --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsDelMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for platformSecretsDel + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsDelVariables } from '../../orm/mutation'; +import type { + PlatformSecretsDelPayloadSelect, + PlatformSecretsDelPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsDelVariables } from '../../orm/mutation'; +export type { PlatformSecretsDelPayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsDelMutation( + params: { + selection: { + fields: S & PlatformSecretsDelPayloadSelect; + } & HookStrictSelect, PlatformSecretsDelPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsDel: InferSelectResult | null; + }, + Error, + PlatformSecretsDelVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsDel: InferSelectResult | null; + }, + Error, + PlatformSecretsDelVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.platformSecretsDel(), + mutationFn: (variables: PlatformSecretsDelVariables) => + getClient() + .mutation.platformSecretsDel(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRemoveArrayMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRemoveArrayMutation.ts new file mode 100644 index 0000000000..91f695a7e3 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRemoveArrayMutation.ts @@ -0,0 +1,60 @@ +/** + * Custom mutation hook for platformSecretsRemoveArray + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsRemoveArrayVariables } from '../../orm/mutation'; +import type { + PlatformSecretsRemoveArrayPayloadSelect, + PlatformSecretsRemoveArrayPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsRemoveArrayVariables } from '../../orm/mutation'; +export type { PlatformSecretsRemoveArrayPayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsRemoveArrayMutation< + S extends PlatformSecretsRemoveArrayPayloadSelect, +>( + params: { + selection: { + fields: S & PlatformSecretsRemoveArrayPayloadSelect; + } & HookStrictSelect, PlatformSecretsRemoveArrayPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsRemoveArray: InferSelectResult | null; + }, + Error, + PlatformSecretsRemoveArrayVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsRemoveArray: InferSelectResult | null; + }, + Error, + PlatformSecretsRemoveArrayVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.platformSecretsRemoveArray(), + mutationFn: (variables: PlatformSecretsRemoveArrayVariables) => + getClient() + .mutation.platformSecretsRemoveArray(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRotateMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRotateMutation.ts new file mode 100644 index 0000000000..1f8a976e9e --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsRotateMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for platformSecretsRotate + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsRotateVariables } from '../../orm/mutation'; +import type { + PlatformSecretsRotatePayloadSelect, + PlatformSecretsRotatePayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsRotateVariables } from '../../orm/mutation'; +export type { PlatformSecretsRotatePayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsRotateMutation( + params: { + selection: { + fields: S & PlatformSecretsRotatePayloadSelect; + } & HookStrictSelect, PlatformSecretsRotatePayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsRotate: InferSelectResult | null; + }, + Error, + PlatformSecretsRotateVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsRotate: InferSelectResult | null; + }, + Error, + PlatformSecretsRotateVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.platformSecretsRotate(), + mutationFn: (variables: PlatformSecretsRotateVariables) => + getClient() + .mutation.platformSecretsRotate(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsSetMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsSetMutation.ts new file mode 100644 index 0000000000..a1bb3d2ba9 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/usePlatformSecretsSetMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for platformSecretsSet + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { PlatformSecretsSetVariables } from '../../orm/mutation'; +import type { + PlatformSecretsSetPayloadSelect, + PlatformSecretsSetPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { PlatformSecretsSetVariables } from '../../orm/mutation'; +export type { PlatformSecretsSetPayloadSelect } from '../../orm/input-types'; +export function usePlatformSecretsSetMutation( + params: { + selection: { + fields: S & PlatformSecretsSetPayloadSelect; + } & HookStrictSelect, PlatformSecretsSetPayloadSelect>; + } & Omit< + UseMutationOptions< + { + platformSecretsSet: InferSelectResult | null; + }, + Error, + PlatformSecretsSetVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + platformSecretsSet: InferSelectResult | null; + }, + Error, + PlatformSecretsSetVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.platformSecretsSet(), + mutationFn: (variables: PlatformSecretsSetVariables) => + getClient() + .mutation.platformSecretsSet(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useProvisionBucketMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useProvisionBucketMutation.ts new file mode 100644 index 0000000000..2613680e69 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useProvisionBucketMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for provisionBucket + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { customMutationKeys } from '../mutation-keys'; +import type { ProvisionBucketVariables } from '../../orm/mutation'; +import type { ProvisionBucketPayloadSelect, ProvisionBucketPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { ProvisionBucketVariables } from '../../orm/mutation'; +export type { ProvisionBucketPayloadSelect } from '../../orm/input-types'; +export function useProvisionBucketMutation( + params: { + selection: { + fields: S & ProvisionBucketPayloadSelect; + } & HookStrictSelect, ProvisionBucketPayloadSelect>; + } & Omit< + UseMutationOptions< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + provisionBucket: InferSelectResult | null; + }, + Error, + ProvisionBucketVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.provisionBucket(), + mutationFn: (variables: ProvisionBucketVariables) => + getClient() + .mutation.provisionBucket(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigDefinitionMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigDefinitionMutation.ts new file mode 100644 index 0000000000..c8dcb167e2 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigDefinitionMutation.ts @@ -0,0 +1,116 @@ +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigDefinitionKeys } from '../query-keys'; +import { platformConfigDefinitionMutationKeys } from '../mutation-keys'; +import type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, + PlatformConfigDefinitionPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, + PlatformConfigDefinitionPatch, +} from '../../orm/input-types'; +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdatePlatformConfigDefinitionMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', platformConfigDefinitionPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdatePlatformConfigDefinitionMutation( + params: { + selection: { + fields: S & PlatformConfigDefinitionSelect; + } & HookStrictSelect, PlatformConfigDefinitionSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }, + Error, + { + id: string; + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; + } +>; +export function useUpdatePlatformConfigDefinitionMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: platformConfigDefinitionMutationKeys.all, + mutationFn: ({ + id, + platformConfigDefinitionPatch, + }: { + id: string; + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; + }) => + getClient() + .platformConfigDefinition.update({ + where: { + id, + }, + data: platformConfigDefinitionPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: platformConfigDefinitionKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: platformConfigDefinitionKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigMutation.ts b/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigMutation.ts new file mode 100644 index 0000000000..a21a509ce2 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/mutations/useUpdatePlatformConfigMutation.ts @@ -0,0 +1,116 @@ +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import { platformConfigMutationKeys } from '../mutation-keys'; +import type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigPatch, +} from '../../orm/input-types'; +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdatePlatformConfigMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', platformConfigPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdatePlatformConfigMutation( + params: { + selection: { + fields: S & PlatformConfigSelect; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseMutationOptions< + { + updatePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + platformConfigPatch: PlatformConfigPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePlatformConfig: { + platformConfig: InferSelectResult; + }; + }, + Error, + { + id: string; + platformConfigPatch: PlatformConfigPatch; + } +>; +export function useUpdatePlatformConfigMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + platformConfigPatch: PlatformConfigPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: platformConfigMutationKeys.all, + mutationFn: ({ + id, + platformConfigPatch, + }: { + id: string; + platformConfigPatch: PlatformConfigPatch; + }) => + getClient() + .platformConfig.update({ + where: { + id, + }, + data: platformConfigPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: platformConfigKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/config/hooks/queries/index.ts b/sdk/constructive-react/src/config/hooks/queries/index.ts new file mode 100644 index 0000000000..688d688ac3 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/queries/index.ts @@ -0,0 +1,9 @@ +/** + * Query hooks barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export * from './usePlatformConfigDefinitionsQuery'; +export * from './usePlatformConfigDefinitionQuery'; +export * from './usePlatformConfigsQuery'; +export * from './usePlatformConfigQuery'; diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigDefinitionQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigDefinitionQuery.ts new file mode 100644 index 0000000000..0a1560fb35 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigDefinitionQuery.ts @@ -0,0 +1,151 @@ +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigDefinitionKeys } from '../query-keys'; +import type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const platformConfigDefinitionQueryKey = platformConfigDefinitionKeys.detail; +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```tsx + * const { data, isLoading } = usePlatformConfigDefinitionQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function usePlatformConfigDefinitionQuery< + S extends PlatformConfigDefinitionSelect, + TData = { + platformConfigDefinition: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + platformConfigDefinition: InferSelectResult< + PlatformConfigDefinitionWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformConfigDefinitionQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: platformConfigDefinitionKeys.detail(params.id), + queryFn: () => + getClient() + .platformConfigDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```ts + * const data = await fetchPlatformConfigDefinitionQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchPlatformConfigDefinitionQuery< + S extends PlatformConfigDefinitionSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigDefinitionSelect>; +}): Promise<{ + platformConfigDefinition: InferSelectResult | null; +}>; +export async function fetchPlatformConfigDefinitionQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .platformConfigDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```ts + * await prefetchPlatformConfigDefinitionQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchPlatformConfigDefinitionQuery< + S extends PlatformConfigDefinitionSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigDefinitionSelect>; + } +): Promise; +export async function prefetchPlatformConfigDefinitionQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: platformConfigDefinitionKeys.detail(params.id), + queryFn: () => + getClient() + .platformConfigDefinition.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigDefinitionsQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigDefinitionsQuery.ts new file mode 100644 index 0000000000..0e07fa0f1c --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigDefinitionsQuery.ts @@ -0,0 +1,182 @@ +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { platformConfigDefinitionKeys } from '../query-keys'; +import type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionWithRelations, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const platformConfigDefinitionsQueryKey = platformConfigDefinitionKeys.list; +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```tsx + * const { data, isLoading } = usePlatformConfigDefinitionsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function usePlatformConfigDefinitionsQuery< + S extends PlatformConfigDefinitionSelect, + TData = { + platformConfigDefinitions: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformConfigDefinitionSelect>; + } & Omit< + UseQueryOptions< + { + platformConfigDefinitions: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformConfigDefinitionsQuery( + params: { + selection: ListSelectionConfig< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: platformConfigDefinitionKeys.list(args), + queryFn: () => getClient().platformConfigDefinition.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```ts + * const data = await fetchPlatformConfigDefinitionsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchPlatformConfigDefinitionsQuery< + S extends PlatformConfigDefinitionSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformConfigDefinitionSelect>; +}): Promise<{ + platformConfigDefinitions: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchPlatformConfigDefinitionsQuery(params: { + selection: ListSelectionConfig< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + >; +}) { + const args = buildListSelectionArgs< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + >(params.selection); + return getClient().platformConfigDefinition.findMany(args).unwrap(); +} +/** + * Registry of valid config keys — declares which config entries the platform recognizes + * + * @example + * ```ts + * await prefetchPlatformConfigDefinitionsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchPlatformConfigDefinitionsQuery< + S extends PlatformConfigDefinitionSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PlatformConfigDefinitionSelect>; + } +): Promise; +export async function prefetchPlatformConfigDefinitionsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: platformConfigDefinitionKeys.list(args), + queryFn: () => getClient().platformConfigDefinition.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigQuery.ts new file mode 100644 index 0000000000..a995879ed8 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigQuery.ts @@ -0,0 +1,138 @@ +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PlatformConfigSelect, PlatformConfigWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const platformConfigQueryKey = platformConfigKeys.detail; +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```tsx + * const { data, isLoading } = usePlatformConfigQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function usePlatformConfigQuery< + S extends PlatformConfigSelect, + TData = { + platformConfig: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseQueryOptions< + { + platformConfig: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformConfigQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: platformConfigKeys.detail(params.id), + queryFn: () => + getClient() + .platformConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```ts + * const data = await fetchPlatformConfigQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchPlatformConfigQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigSelect>; +}): Promise<{ + platformConfig: InferSelectResult | null; +}>; +export async function fetchPlatformConfigQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .platformConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```ts + * await prefetchPlatformConfigQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchPlatformConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PlatformConfigSelect>; + } +): Promise; +export async function prefetchPlatformConfigQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: platformConfigKeys.detail(params.id), + queryFn: () => + getClient() + .platformConfig.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigsQuery.ts b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigsQuery.ts new file mode 100644 index 0000000000..369aa1f176 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/queries/usePlatformConfigsQuery.ts @@ -0,0 +1,159 @@ +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { platformConfigKeys } from '../query-keys'; +import type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigFilter, + PlatformConfigOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PlatformConfigSelect, + PlatformConfigWithRelations, + PlatformConfigFilter, + PlatformConfigOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const platformConfigsQueryKey = platformConfigKeys.list; +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```tsx + * const { data, isLoading } = usePlatformConfigsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function usePlatformConfigsQuery< + S extends PlatformConfigSelect, + TData = { + platformConfigs: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformConfigSelect>; + } & Omit< + UseQueryOptions< + { + platformConfigs: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePlatformConfigsQuery( + params: { + selection: ListSelectionConfig< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: platformConfigKeys.list(args), + queryFn: () => getClient().platformConfig.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```ts + * const data = await fetchPlatformConfigsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchPlatformConfigsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformConfigSelect>; +}): Promise<{ + platformConfigs: ConnectionResult>; +}>; +export async function fetchPlatformConfigsQuery(params: { + selection: ListSelectionConfig; +}) { + const args = buildListSelectionArgs< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >(params.selection); + return getClient().platformConfig.findMany(args).unwrap(); +} +/** + * App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed + * + * @example + * ```ts + * await prefetchPlatformConfigsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchPlatformConfigsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PlatformConfigSelect>; + } +): Promise; +export async function prefetchPlatformConfigsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: platformConfigKeys.list(args), + queryFn: () => getClient().platformConfig.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/config/hooks/query-keys.ts b/sdk/constructive-react/src/config/hooks/query-keys.ts new file mode 100644 index 0000000000..320580e957 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/query-keys.ts @@ -0,0 +1,67 @@ +/** + * Centralized query key factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// ============================================================================ +// This file provides a centralized, type-safe query key factory following +// the lukemorales query-key-factory pattern for React Query. +// +// Benefits: +// - Single source of truth for all query keys +// - Type-safe key access with autocomplete +// - Hierarchical invalidation (invalidate all 'user.*' queries) +// - Scoped keys for parent-child relationships +// ============================================================================ + +// ============================================================================ +// Entity Query Keys +// ============================================================================ + +export const platformConfigDefinitionKeys = { + /** All platformConfigDefinition queries */ all: ['platformconfigdefinition'] as const, + /** List query keys */ lists: () => [...platformConfigDefinitionKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformConfigDefinitionKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformConfigDefinitionKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformConfigDefinitionKeys.details(), id] as const, +} as const; +export const platformConfigKeys = { + /** All platformConfig queries */ all: ['platformconfig'] as const, + /** List query keys */ lists: () => [...platformConfigKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...platformConfigKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...platformConfigKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...platformConfigKeys.details(), id] as const, +} as const; +/** + +// ============================================================================ +// Unified Query Key Store +// ============================================================================ + + * Unified query key store + * + * Use this for type-safe query key access across your application. + * + * @example + * ```ts + * // Invalidate all user queries + * queryClient.invalidateQueries({ queryKey: queryKeys.user.all }); + * + * // Invalidate user list queries + * queryClient.invalidateQueries({ queryKey: queryKeys.user.lists() }); + * + * // Invalidate specific user + * queryClient.invalidateQueries({ queryKey: queryKeys.user.detail(userId) }); + * ``` + */ +export const queryKeys = { + platformConfigDefinition: platformConfigDefinitionKeys, + platformConfig: platformConfigKeys, +} as const; +/** Type representing all available query key scopes */ +export type QueryKeyScope = keyof typeof queryKeys; diff --git a/sdk/constructive-react/src/config/hooks/selection.ts b/sdk/constructive-react/src/config/hooks/selection.ts new file mode 100644 index 0000000000..2952aab647 --- /dev/null +++ b/sdk/constructive-react/src/config/hooks/selection.ts @@ -0,0 +1,60 @@ +/** + * Selection helpers for React Query hooks + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface SelectionConfig { + fields: TFields; +} + +export interface ListSelectionConfig extends SelectionConfig { + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +function ensureSelectionFields( + selection: SelectionConfig | undefined +): asserts selection is SelectionConfig { + if (!selection || typeof selection !== 'object' || !('fields' in selection)) { + throw new Error( + 'Invalid hook params: `selection.fields` is required. Example: { selection: { fields: { id: true } } }' + ); + } +} + +export function buildSelectionArgs(selection: SelectionConfig): { + select: TFields; +} { + ensureSelectionFields(selection); + return { select: selection.fields }; +} + +export function buildListSelectionArgs( + selection: ListSelectionConfig +): { + select: TFields; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} { + ensureSelectionFields(selection); + return { + select: selection.fields, + where: selection.where, + orderBy: selection.orderBy, + first: selection.first, + last: selection.last, + after: selection.after, + before: selection.before, + offset: selection.offset, + }; +} diff --git a/sdk/constructive-react/src/config/index.ts b/sdk/constructive-react/src/config/index.ts new file mode 100644 index 0000000000..2b8402539a --- /dev/null +++ b/sdk/constructive-react/src/config/index.ts @@ -0,0 +1,7 @@ +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +export * from './types'; +export * from './hooks'; +export * from './orm'; diff --git a/sdk/constructive-react/src/config/orm/README.md b/sdk/constructive-react/src/config/orm/README.md new file mode 100644 index 0000000000..803661dc8e --- /dev/null +++ b/sdk/constructive-react/src/config/orm/README.md @@ -0,0 +1,252 @@ +# ORM Client + +

+ +

+ + + +## Setup + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); +``` + +## Models + +| Model | Operations | +|-------|------------| +| `platformConfigDefinition` | findMany, findOne, create, update, delete | +| `platformConfig` | findMany, findOne, create, update, delete | + +## Table Operations + +### `db.platformConfigDefinition` + +CRUD operations for PlatformConfigDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `name` | String | Yes | +| `description` | String | Yes | +| `defaultValue` | String | Yes | +| `isBuiltIn` | Boolean | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | + +**Operations:** + +```typescript +// List all platformConfigDefinition records +const items = await db.platformConfigDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }).execute(); + +// Get one by id +const item = await db.platformConfigDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }).execute(); + +// Create +const created = await db.platformConfigDefinition.create({ data: { name: '', description: '', defaultValue: '', isBuiltIn: '', labels: '', annotations: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.platformConfigDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.platformConfigDefinition.delete({ where: { id: '' } }).execute(); +``` + +### `db.platformConfig` + +CRUD operations for PlatformConfig records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `namespaceId` | UUID | Yes | +| `name` | String | Yes | +| `value` | String | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `description` | String | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `expiresAt` | Datetime | Yes | + +**Operations:** + +```typescript +// List all platformConfig records +const items = await db.platformConfig.findMany({ select: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }).execute(); + +// Get one by id +const item = await db.platformConfig.findOne({ id: '', select: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }).execute(); + +// Create +const created = await db.platformConfig.create({ data: { namespaceId: '', name: '', value: '', labels: '', annotations: '', description: '', expiresAt: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.platformConfig.update({ where: { id: '' }, data: { namespaceId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.platformConfig.delete({ where: { id: '' } }).execute(); +``` + +## Custom Operations + +### `db.mutation.platformSecretsDel` + +platformSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsDelInput (required) | + +```typescript +const result = await db.mutation.platformSecretsDel({ input: { secretName: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.orgSecretsDel` + +orgSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsDelInput (required) | + +```typescript +const result = await db.mutation.orgSecretsDel({ input: { ownerId: '', secretName: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.platformSecretsRemoveArray` + +platformSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRemoveArrayInput (required) | + +```typescript +const result = await db.mutation.platformSecretsRemoveArray({ input: { secretNames: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.orgSecretsRemoveArray` + +orgSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRemoveArrayInput (required) | + +```typescript +const result = await db.mutation.orgSecretsRemoveArray({ input: { ownerId: '', secretNames: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.platformSecretsRotate` + +platformSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRotateInput (required) | + +```typescript +const result = await db.mutation.platformSecretsRotate({ input: { secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.platformSecretsSet` + +platformSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsSetInput (required) | + +```typescript +const result = await db.mutation.platformSecretsSet({ input: { secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.orgSecretsRotate` + +orgSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRotateInput (required) | + +```typescript +const result = await db.mutation.orgSecretsRotate({ input: { ownerId: '', secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.orgSecretsSet` + +orgSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsSetInput (required) | + +```typescript +const result = await db.mutation.orgSecretsSet({ input: { scopeOwnerId: '', secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.provisionBucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-react/src/config/orm/client.ts b/sdk/constructive-react/src/config/orm/client.ts new file mode 100644 index 0000000000..16e683c712 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/client.ts @@ -0,0 +1,244 @@ +/** + * ORM Client - Runtime GraphQL executor + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; +import { createFetch } from '@constructive-io/graphql-query/runtime'; + +import type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + Unsubscribe, +} from './realtime'; +import { RealtimeManager } from './realtime'; + +export type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; + +export type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + SubscriptionOperation, + Unsubscribe, + WsClient, +} from './realtime'; +export { RealtimeManager } from './realtime'; + +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +export class FetchAdapter implements GraphQLAdapter { + private headers: Record; + private fetchFn: typeof globalThis.fetch; + + constructor( + private endpoint: string, + headers?: Record, + fetchFn?: typeof globalThis.fetch + ) { + this.headers = headers ?? {}; + this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); + } + + async execute(document: string, variables?: Record): Promise> { + const response = await this.fetchFn(this.endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + ...this.headers, + }, + body: JSON.stringify({ + query: document, + variables: variables ?? {}, + }), + }); + + if (!response.ok) { + return { + ok: false, + data: null, + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], + }; + } + + const json = (await response.json()) as { + data?: T; + errors?: GraphQLError[]; + }; + + if (json.errors && json.errors.length > 0) { + return { + ok: false, + data: null, + errors: json.errors, + }; + } + + return { + ok: true, + data: json.data as T, + errors: undefined, + }; + } + + setHeaders(headers: Record): void { + this.headers = { ...this.headers, ...headers }; + } + + getEndpoint(): string { + return this.endpoint; + } +} + +/** + * Configuration for creating an ORM client. + * Either provide endpoint (and optional headers/fetch) for HTTP requests, + * or provide a custom adapter for alternative execution strategies. + */ +export interface OrmClientConfig { + /** GraphQL endpoint URL (required if adapter not provided) */ + endpoint?: string; + /** Default headers for HTTP requests (only used with endpoint) */ + headers?: Record; + /** + * Custom fetch implementation. Defaults to createFetch() from + * @constructive-io/graphql-query/runtime which handles *.localhost + * DNS and Host headers in Node.js. Pass your own for test mocking + * or custom proxy/credentials. + */ + fetch?: typeof globalThis.fetch; + /** Custom adapter for GraphQL execution (overrides endpoint/headers/fetch) */ + adapter?: GraphQLAdapter; + /** + * Optional realtime (WebSocket) configuration. + * When provided, enables subscription methods on models. + * The WebSocket connection is created lazily on first subscribe(). + */ + realtime?: RealtimeConfig; +} + +/** + * Error thrown when GraphQL request fails + */ +export class GraphQLRequestError extends Error { + constructor( + public readonly errors: GraphQLError[], + public readonly data: unknown = null + ) { + const messages = errors.map((e) => e.message).join('; '); + super(`GraphQL Error: ${messages}`); + this.name = 'GraphQLRequestError'; + } +} + +export class OrmClient { + private adapter: GraphQLAdapter; + private realtimeManager?: RealtimeManager; + + constructor(config: OrmClientConfig) { + if (config.adapter) { + this.adapter = config.adapter; + } else if (config.endpoint) { + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); + } else { + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); + } + + if (config.realtime) { + this.realtimeManager = new RealtimeManager(config.realtime); + } + } + + async execute(document: string, variables?: Record): Promise> { + return this.adapter.execute(document, variables); + } + + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + if (!this.realtimeManager) { + throw new Error( + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' + ); + } + return this.realtimeManager.subscribe(meta, document, variables, options); + } + + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers: Record): void { + if (this.adapter.setHeaders) { + this.adapter.setHeaders(headers); + } + } + + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint(): string { + return this.adapter.getEndpoint?.() ?? ''; + } + + /** Get current WebSocket connection state */ + getConnectionState(): ConnectionState { + return this.realtimeManager?.getConnectionState() ?? 'disconnected'; + } + + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + if (!this.realtimeManager) return () => {}; + return this.realtimeManager.onConnectionStateChange(listener); + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.realtimeManager?.getActiveSubscriptionCount() ?? 0; + } + + /** Whether realtime is configured */ + get isRealtimeEnabled(): boolean { + return this.realtimeManager !== undefined; + } + + /** Dispose the realtime manager (close WebSocket) */ + dispose(): void { + this.realtimeManager?.dispose(); + } +} diff --git a/sdk/constructive-react/src/config/orm/index.ts b/sdk/constructive-react/src/config/orm/index.ts new file mode 100644 index 0000000000..9ea4028079 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/index.ts @@ -0,0 +1,47 @@ +/** + * ORM Client - createClient factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { PlatformConfigDefinitionModel } from './models/platformConfigDefinition'; +import { PlatformConfigModel } from './models/platformConfig'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +export function createClient(config: OrmClientConfig) { + const client = new OrmClient(config); + return { + platformConfigDefinition: new PlatformConfigDefinitionModel(client), + platformConfig: new PlatformConfigModel(client), + mutation: createMutationOperations(client), + }; +} diff --git a/sdk/constructive-react/src/config/orm/input-types.ts b/sdk/constructive-react/src/config/orm/input-types.ts new file mode 100644 index 0000000000..693309a1fb --- /dev/null +++ b/sdk/constructive-react/src/config/orm/input-types.ts @@ -0,0 +1,774 @@ +/** + * GraphQL types for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// ============ Scalar Filter Types ============ +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: Record; + containedBy?: Record; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containsOrEqualTo?: string; + containedBy?: string; + containedByOrEqualTo?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +/** Registry of valid config keys — declares which config entries the platform recognizes */ +// ============ Entity Types ============ +export interface PlatformConfigDefinition { + /** Unique identifier for this config definition */ + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Config key name (must match config table name for resolution) */ + name?: string | null; + /** Human-readable description of what this config key controls */ + description?: string | null; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string | null; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean | null; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: Record | null; + /** Freeform metadata annotations for config definitions */ + annotations?: Record | null; +} +/** App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed */ +export interface PlatformConfig { + /** Unique identifier for this config entry */ + id: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId?: string | null; + /** Key name identifying the config entry */ + name?: string | null; + /** Plaintext config value */ + value?: string | null; + /** Key/value pairs for selecting/filtering config entries */ + labels?: Record | null; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record | null; + /** Human-readable note about this config entry */ + description?: string | null; + createdAt?: string | null; + updatedAt?: string | null; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string | null; +} +// ============ Relation Helper Types ============ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +// ============ Entity Relation Types ============ +export interface PlatformConfigDefinitionRelations {} +export interface PlatformConfigRelations {} +// ============ Entity Types With Relations ============ +export type PlatformConfigDefinitionWithRelations = PlatformConfigDefinition & + PlatformConfigDefinitionRelations; +export type PlatformConfigWithRelations = PlatformConfig & PlatformConfigRelations; +// ============ Entity Select Types ============ +export type PlatformConfigDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + name?: boolean; + description?: boolean; + defaultValue?: boolean; + isBuiltIn?: boolean; + labels?: boolean; + annotations?: boolean; +}; +export type PlatformConfigSelect = { + id?: boolean; + namespaceId?: boolean; + name?: boolean; + value?: boolean; + labels?: boolean; + annotations?: boolean; + description?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + expiresAt?: boolean; +}; +// ============ Table Filter Types ============ +export interface PlatformConfigDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `defaultValue` field. */ + defaultValue?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigDefinitionFilter[]; + /** Negates the expression. */ + not?: PlatformConfigDefinitionFilter; +} +export interface PlatformConfigFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `value` field. */ + value?: StringFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigFilter[]; + /** Negates the expression. */ + not?: PlatformConfigFilter; +} +// ============ OrderBy Types ============ +export type PlatformConfigDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC'; +export type PlatformConfigOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC'; +// ============ CRUD Input Types ============ +export interface CreatePlatformConfigDefinitionInput { + clientMutationId?: string; + platformConfigDefinition: { + name: string; + description?: string; + defaultValue?: string; + isBuiltIn?: boolean; + labels?: Record; + annotations?: Record; + }; +} +export interface PlatformConfigDefinitionPatch { + name?: string | null; + description?: string | null; + defaultValue?: string | null; + isBuiltIn?: boolean | null; + labels?: Record | null; + annotations?: Record | null; +} +export interface UpdatePlatformConfigDefinitionInput { + clientMutationId?: string; + id: string; + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; +} +export interface DeletePlatformConfigDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformConfigInput { + clientMutationId?: string; + platformConfig: { + namespaceId: string; + name: string; + value?: string; + labels?: Record; + annotations?: Record; + description?: string; + expiresAt?: string; + }; +} +export interface PlatformConfigPatch { + namespaceId?: string | null; + name?: string | null; + value?: string | null; + labels?: Record | null; + annotations?: Record | null; + description?: string | null; + expiresAt?: string | null; +} +export interface UpdatePlatformConfigInput { + clientMutationId?: string; + id: string; + platformConfigPatch: PlatformConfigPatch; +} +export interface DeletePlatformConfigInput { + clientMutationId?: string; + id: string; +} +// ============ Connection Fields Map ============ +export const connectionFieldsMap = {} as Record>; +// ============ Custom Input Types (from schema) ============ +export interface PlatformSecretsDelInput { + clientMutationId?: string; + secretName?: string; + namespaceId?: string; +} +export interface OrgSecretsDelInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + namespaceId?: string; +} +export interface PlatformSecretsRemoveArrayInput { + clientMutationId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface OrgSecretsRemoveArrayInput { + clientMutationId?: string; + ownerId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface PlatformSecretsRotateInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface PlatformSecretsSetInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface OrgSecretsRotateInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface OrgSecretsSetInput { + clientMutationId?: string; + scopeOwnerId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** An input for mutations affecting `PlatformConfigDefinition` */ +export interface PlatformConfigDefinitionInput { + /** Unique identifier for this config definition */ + id?: string; + createdAt?: string; + updatedAt?: string; + /** Config key name (must match config table name for resolution) */ + name: string; + /** Human-readable description of what this config key controls */ + description?: string; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: Record; + /** Freeform metadata annotations for config definitions */ + annotations?: Record; +} +/** An input for mutations affecting `PlatformConfig` */ +export interface PlatformConfigInput { + /** Unique identifier for this config entry */ + id?: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId: string; + /** Key name identifying the config entry */ + name: string; + /** Plaintext config value */ + value?: string; + /** Key/value pairs for selecting/filtering config entries */ + labels?: Record; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record; + /** Human-readable note about this config entry */ + description?: string; + createdAt?: string; + updatedAt?: string; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string; +} +// ============ Payload/Return Types (for custom operations) ============ +export interface PlatformSecretsDelPayload { + clientMutationId?: string | null; +} +export type PlatformSecretsDelPayloadSelect = { + clientMutationId?: boolean; +}; +export interface OrgSecretsDelPayload { + clientMutationId?: string | null; +} +export type OrgSecretsDelPayloadSelect = { + clientMutationId?: boolean; +}; +export interface PlatformSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export type PlatformSecretsRemoveArrayPayloadSelect = { + clientMutationId?: boolean; +}; +export interface OrgSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export type OrgSecretsRemoveArrayPayloadSelect = { + clientMutationId?: boolean; +}; +export interface PlatformSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type PlatformSecretsRotatePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface PlatformSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type PlatformSecretsSetPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface OrgSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type OrgSecretsRotatePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface OrgSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type OrgSecretsSetPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +export type ProvisionBucketPayloadSelect = { + success?: boolean; + bucketName?: boolean; + accessType?: boolean; + provider?: boolean; + endpoint?: boolean; + error?: boolean; +}; +export interface CreatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was created by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type CreatePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface UpdatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was updated by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type UpdatePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface DeletePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was deleted by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type DeletePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface CreatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was created by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type CreatePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +export interface UpdatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was updated by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type UpdatePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +export interface DeletePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was deleted by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type DeletePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +/** A `PlatformConfigDefinition` edge in the connection. */ +export interface PlatformConfigDefinitionEdge { + cursor?: string | null; + /** The `PlatformConfigDefinition` at the end of the edge. */ + node?: PlatformConfigDefinition | null; +} +export type PlatformConfigDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformConfigDefinitionSelect; + }; +}; +/** A `PlatformConfig` edge in the connection. */ +export interface PlatformConfigEdge { + cursor?: string | null; + /** The `PlatformConfig` at the end of the edge. */ + node?: PlatformConfig | null; +} +export type PlatformConfigEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformConfigSelect; + }; +}; diff --git a/sdk/constructive-react/src/config/orm/models/index.ts b/sdk/constructive-react/src/config/orm/models/index.ts new file mode 100644 index 0000000000..c641a1f3e5 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/models/index.ts @@ -0,0 +1,7 @@ +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export { PlatformConfigDefinitionModel } from './platformConfigDefinition'; +export { PlatformConfigModel } from './platformConfig'; diff --git a/sdk/constructive-react/src/config/orm/models/platformConfig.ts b/sdk/constructive-react/src/config/orm/models/platformConfig.ts new file mode 100644 index 0000000000..43634e7a80 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/models/platformConfig.ts @@ -0,0 +1,245 @@ +/** + * PlatformConfig model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfig, + PlatformConfigWithRelations, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, + CreatePlatformConfigInput, + UpdatePlatformConfigInput, + PlatformConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PlatformConfigModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfigs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfig: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', + document, + variables, + transform: (data: { + platformConfigs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfig: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', + document, + variables, + transform: (data: { + platformConfigs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PlatformConfig', + 'createPlatformConfig', + 'platformConfig', + args.select, + args.data, + 'CreatePlatformConfigInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'createPlatformConfig', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfig', + 'updatePlatformConfig', + 'platformConfig', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigInput', + 'id', + 'platformConfigPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'updatePlatformConfig', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfig', + 'deletePlatformConfig', + 'platformConfig', + { + id: args.where.id, + }, + 'DeletePlatformConfigInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'deletePlatformConfig', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/config/orm/models/platformConfigDefinition.ts b/sdk/constructive-react/src/config/orm/models/platformConfigDefinition.ts new file mode 100644 index 0000000000..c28ff1566e --- /dev/null +++ b/sdk/constructive-react/src/config/orm/models/platformConfigDefinition.ts @@ -0,0 +1,247 @@ +/** + * PlatformConfigDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfigDefinition, + PlatformConfigDefinitionWithRelations, + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy, + CreatePlatformConfigDefinitionInput, + UpdatePlatformConfigDefinitionInput, + PlatformConfigDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PlatformConfigDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinitions: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinition', + document, + variables, + transform: (data: { + platformConfigDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfigDefinition: data.platformConfigDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinition', + document, + variables, + transform: (data: { + platformConfigDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfigDefinition: data.platformConfigDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PlatformConfigDefinition', + 'createPlatformConfigDefinition', + 'platformConfigDefinition', + args.select, + args.data, + 'CreatePlatformConfigDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'createPlatformConfigDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfigDefinition', + 'updatePlatformConfigDefinition', + 'platformConfigDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigDefinitionInput', + 'id', + 'platformConfigDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'updatePlatformConfigDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfigDefinition', + 'deletePlatformConfigDefinition', + 'platformConfigDefinition', + { + id: args.where.id, + }, + 'DeletePlatformConfigDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'deletePlatformConfigDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/config/orm/mutation/index.ts b/sdk/constructive-react/src/config/orm/mutation/index.ts new file mode 100644 index 0000000000..b9ef205a98 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/mutation/index.ts @@ -0,0 +1,337 @@ +/** + * Custom mutation operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + PlatformSecretsDelInput, + OrgSecretsDelInput, + PlatformSecretsRemoveArrayInput, + OrgSecretsRemoveArrayInput, + PlatformSecretsRotateInput, + PlatformSecretsSetInput, + OrgSecretsRotateInput, + OrgSecretsSetInput, + ProvisionBucketInput, + PlatformSecretsDelPayload, + OrgSecretsDelPayload, + PlatformSecretsRemoveArrayPayload, + OrgSecretsRemoveArrayPayload, + PlatformSecretsRotatePayload, + PlatformSecretsSetPayload, + OrgSecretsRotatePayload, + OrgSecretsSetPayload, + ProvisionBucketPayload, + PlatformSecretsDelPayloadSelect, + OrgSecretsDelPayloadSelect, + PlatformSecretsRemoveArrayPayloadSelect, + OrgSecretsRemoveArrayPayloadSelect, + PlatformSecretsRotatePayloadSelect, + PlatformSecretsSetPayloadSelect, + OrgSecretsRotatePayloadSelect, + OrgSecretsSetPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export interface PlatformSecretsDelVariables { + input: PlatformSecretsDelInput; +} +export interface OrgSecretsDelVariables { + input: OrgSecretsDelInput; +} +export interface PlatformSecretsRemoveArrayVariables { + input: PlatformSecretsRemoveArrayInput; +} +export interface OrgSecretsRemoveArrayVariables { + input: OrgSecretsRemoveArrayInput; +} +export interface PlatformSecretsRotateVariables { + input: PlatformSecretsRotateInput; +} +export interface PlatformSecretsSetVariables { + input: PlatformSecretsSetInput; +} +export interface OrgSecretsRotateVariables { + input: OrgSecretsRotateInput; +} +export interface OrgSecretsSetVariables { + input: OrgSecretsSetInput; +} +/** + * Variables for provisionBucket + * Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + */ +export interface ProvisionBucketVariables { + input: ProvisionBucketInput; +} +export function createMutationOperations(client: OrmClient) { + return { + platformSecretsDel: ( + args: PlatformSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsDel', + fieldName: 'platformSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsDel', + 'platformSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsDelPayload' + ), + }), + orgSecretsDel: ( + args: OrgSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsDel', + fieldName: 'orgSecretsDel', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsDel', + 'orgSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsDelPayload' + ), + }), + platformSecretsRemoveArray: ( + args: PlatformSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRemoveArray', + fieldName: 'platformSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRemoveArray', + 'platformSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRemoveArrayPayload' + ), + }), + orgSecretsRemoveArray: ( + args: OrgSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsRemoveArray', + fieldName: 'orgSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsRemoveArray', + 'orgSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsRemoveArrayPayload' + ), + }), + platformSecretsRotate: ( + args: PlatformSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRotate', + fieldName: 'platformSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRotate', + 'platformSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRotatePayload' + ), + }), + platformSecretsSet: ( + args: PlatformSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsSet', + fieldName: 'platformSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsSet', + 'platformSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsSetPayload' + ), + }), + orgSecretsRotate: ( + args: OrgSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsRotate', + fieldName: 'orgSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsRotate', + 'orgSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsRotatePayload' + ), + }), + orgSecretsSet: ( + args: OrgSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsSet', + fieldName: 'orgSecretsSet', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsSet', + 'orgSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsSetPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + }; +} diff --git a/sdk/constructive-react/src/config/orm/query-builder.ts b/sdk/constructive-react/src/config/orm/query-builder.ts new file mode 100644 index 0000000000..fd785bbae6 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/query-builder.ts @@ -0,0 +1,1047 @@ +/** + * Query Builder - Builds and executes GraphQL operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { parseType, print } from '@constructive-io/graphql-query/runtime'; +import * as t from 'gql-ast'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; + +import { GraphQLRequestError, OrmClient, QueryResult } from './client'; + +export interface QueryBuilderConfig { + client: OrmClient; + operation: 'query' | 'mutation'; + operationName: string; + fieldName: string; + document: string; + variables?: Record; + transform?: (data: any) => TResult; +} + +export class QueryBuilder { + private config: QueryBuilderConfig; + + constructor(config: QueryBuilderConfig) { + this.config = config; + } + + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + async execute(): Promise> { + const rawResult = await this.config.client.execute( + this.config.document, + this.config.variables + ); + if (!rawResult.ok) { + return rawResult; + } + if (!this.config.transform) { + return rawResult as unknown as QueryResult; + } + return { + ok: true, + data: this.config.transform(rawResult.data), + errors: undefined, + }; + } + + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + async unwrap(): Promise { + const result = await this.execute(); + if (!result.ok) { + throw new GraphQLRequestError(result.errors, result.data); + } + return result.data; + } + + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + async unwrapOr(defaultValue: D): Promise { + const result = await this.execute(); + if (!result.ok) { + return defaultValue; + } + return result.data; + } + + /** + * Execute and unwrap, calling onError callback on failure + */ + async unwrapOrElse( + onError: (errors: import('./client').GraphQLError[]) => D + ): Promise { + const result = await this.execute(); + if (!result.ok) { + return onError(result.errors); + } + return result.data; + } + + toGraphQL(): string { + return this.config.document; + } + + getVariables(): Record | undefined { + return this.config.variables; + } +} + +const OP_QUERY = 'query' as unknown as import('graphql').OperationTypeNode; +const OP_MUTATION = 'mutation' as unknown as import('graphql').OperationTypeNode; +const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; + +// ============================================================================ +// Selection Builders +// ============================================================================ + +export function buildSelections( + select: Record | undefined, + connectionFieldsMap?: Record>, + entityType?: string +): FieldNode[] { + if (!select) { + return []; + } + + const fields: FieldNode[] = []; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; + + for (const [key, value] of Object.entries(select)) { + if (value === false || value === undefined) { + continue; + } + + if (value === true) { + fields.push(t.field({ name: key })); + continue; + } + + if (typeof value === 'object' && value !== null) { + const nested = value as { + select?: Record; + args?: Record; + first?: number; + filter?: Record; + orderBy?: string[]; + connection?: boolean; + }; + + // Field with arguments (e.g. requestUploadUrl on bucket types) + if (nested.args && typeof nested.args === 'object') { + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) + ); + const nestedSelect = nested.select; + if (nestedSelect && typeof nestedSelect === 'object') { + const subSelections = Object.entries(nestedSelect) + .filter(([, v]) => v) + .map(([name]) => t.field({ name })); + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: subSelections.length + ? t.selectionSet({ selections: subSelections }) + : undefined, + }) + ); + } else { + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + }) + ); + } + continue; + } + + if (!nested.select || typeof nested.select !== 'object') { + throw new Error( + `Invalid selection for field "${key}": nested selections must include a "select" object.` + ); + } + + const relatedEntityType = entityConnections?.[key]; + const nestedSelections = buildSelections( + nested.select, + connectionFieldsMap, + relatedEntityType + ); + const isConnection = + nested.connection === true || + nested.first !== undefined || + nested.filter !== undefined || + relatedEntityType !== undefined; + const args = buildArgs([ + buildOptionalArg('first', nested.first), + nested.filter + ? t.argument({ + name: 'filter', + value: buildValueAst(nested.filter), + }) + : null, + buildEnumListArg('orderBy', nested.orderBy), + ]); + + if (isConnection) { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(nestedSelections), + }), + }) + ); + } else { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ selections: nestedSelections }), + }) + ); + } + } + } + + return fields; +} + +// ============================================================================ +// Document Builders +// ============================================================================ + +export function buildFindManyDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { + where?: TWhere; + orderBy?: string[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; + }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'first', typeName: 'Int', value: args.first }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'last', typeName: 'Int', value: args.last }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'after', typeName: 'Cursor', value: args.after }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'before', typeName: 'Cursor', value: args.before }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'offset', typeName: 'Int', value: args.offset }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs.length ? queryArgs : undefined, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(selections), + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildFindFirstDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { where?: TWhere; orderBy?: string[] }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + // Always add first: 1 for findFirst + addVariable( + { varName: 'first', typeName: 'Int', value: 1 }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildCreateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [entityField]: data, + }, + }, + }; +} + +export function buildUpdateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + patchFieldName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + id: where.id, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildUpdateByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + id: string | number, + data: TData, + inputTypeName: string, + idFieldName: string, + patchFieldName: string, + connectionFieldsMap?: Record>, + extraKeys?: Record +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [idFieldName]: id, + ...extraKeys, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildFindOneDocument( + operationName: string, + queryField: string, + id: string | number, + select: TSelect, + idArgName: string, + idTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = [ + t.variableDefinition({ + variable: t.variable({ name: idArgName }), + type: parseType(idTypeName), + }), + ]; + + const queryArgs: ArgumentNode[] = [ + t.argument({ + name: idArgName, + value: t.variable({ name: idArgName }), + }), + ]; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: { [idArgName]: id }, + }; +} + +export function buildDeleteDocument( + operationName: string, + mutationField: string, + entityField: string, + where: TWhere, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ + selections: entitySelections, + }), + }), + ], + }), + variables: { + input: { + id: where.id, + }, + }, + }; +} + +export function buildDeleteByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + keys: Record, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections: entitySelections }), + }), + ], + }), + variables: { + input: keys, + }, + }; +} + +export function buildJunctionRemoveDocument( + operationName: string, + mutationField: string, + keys: Record, + inputTypeName: string +): { document: string; variables: Record } { + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [t.field({ name: 'clientMutationId' })], + }), + variables: { + input: keys, + }, + }; +} + +export function buildCustomDocument( + operationType: 'query' | 'mutation', + operationName: string, + fieldName: string, + select: TSelect, + args: TArgs, + variableDefinitions: Array<{ name: string; type: string }>, + connectionFieldsMap?: Record>, + entityType?: string +): { document: string; variables: Record } { + let actualSelect: TSelect = select; + let isConnection = false; + + if (isCustomSelectionWrapper(select)) { + actualSelect = select.select as TSelect; + isConnection = select.connection === true; + } + + const selections = actualSelect + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) + : []; + + const variableDefs = variableDefinitions.map((definition) => + t.variableDefinition({ + variable: t.variable({ name: definition.name }), + type: parseType(definition.type), + }) + ); + const fieldArgs = variableDefinitions.map((definition) => + t.argument({ + name: definition.name, + value: t.variable({ name: definition.name }), + }) + ); + + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY, + name: operationName, + variableDefinitions: variableDefs.length ? variableDefs : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: fieldName, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: fieldSelections.length + ? t.selectionSet({ selections: fieldSelections }) + : undefined, + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: (args ?? {}) as Record, + }; +} + +function isCustomSelectionWrapper( + value: unknown +): value is { select: Record; connection?: boolean } { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + + const record = value as Record; + const keys = Object.keys(record); + + if (!keys.includes('select') || !keys.includes('connection')) { + return false; + } + + if (keys.some((key) => key !== 'select' && key !== 'connection')) { + return false; + } + + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); +} + +// ============================================================================ +// Helper Functions +// ============================================================================ + +function buildArgs(args: Array): ArgumentNode[] { + return args.filter((arg): arg is ArgumentNode => arg !== null); +} + +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { + if (value === undefined) { + return null; + } + const valueNode = + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); + return t.argument({ name, value: valueNode }); +} + +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { + if (!values || values.length === 0) { + return null; + } + return t.argument({ + name, + value: t.listValue({ + values: values.map((value) => buildEnumValue(value)), + }), + }); +} + +function buildEnumValue(value: string): EnumValueNode { + return { + kind: ENUM_VALUE_KIND, + value, + }; +} + +function buildPageInfoSelections(): FieldNode[] { + return [ + t.field({ name: 'hasNextPage' }), + t.field({ name: 'hasPreviousPage' }), + t.field({ name: 'startCursor' }), + t.field({ name: 'endCursor' }), + ]; +} + +function buildConnectionSelections(nodeSelections: FieldNode[]): FieldNode[] { + return [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections: nodeSelections }), + }), + t.field({ name: 'totalCount' }), + t.field({ + name: 'pageInfo', + selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }), + }), + ]; +} + +interface VariableSpec { + varName: string; + argName?: string; + typeName?: string; + value: unknown; +} + +interface InputMutationConfig { + operationName: string; + mutationField: string; + inputTypeName: string; + resultSelections: FieldNode[]; +} + +function buildInputMutationDocument(config: InputMutationConfig): string { + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_MUTATION, + name: config.operationName + 'Mutation', + variableDefinitions: [ + t.variableDefinition({ + variable: t.variable({ name: 'input' }), + type: parseType(config.inputTypeName + '!'), + }), + ], + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: config.mutationField, + args: [ + t.argument({ + name: 'input', + value: t.variable({ name: 'input' }), + }), + ], + selectionSet: t.selectionSet({ + selections: config.resultSelections, + }), + }), + ], + }), + }), + ], + }); + return print(document); +} + +function addVariable( + spec: VariableSpec, + definitions: VariableDefinitionNode[], + args: ArgumentNode[], + variables: Record +): void { + if (spec.value === undefined || !spec.typeName) return; + + definitions.push( + t.variableDefinition({ + variable: t.variable({ name: spec.varName }), + type: parseType(spec.typeName), + }) + ); + args.push( + t.argument({ + name: spec.argName ?? spec.varName, + value: t.variable({ name: spec.varName }), + }) + ); + variables[spec.varName] = spec.value; +} + +function buildValueAst( + value: unknown +): + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | EnumValueNode { + if (value === null) { + return t.nullValue(); + } + + if (typeof value === 'boolean') { + return t.booleanValue({ value }); + } + + if (typeof value === 'number') { + return Number.isInteger(value) + ? t.intValue({ value: value.toString() }) + : t.floatValue({ value: value.toString() }); + } + + if (typeof value === 'string') { + return t.stringValue({ value }); + } + + if (Array.isArray(value)) { + return t.listValue({ + values: value.map((item) => buildValueAst(item)), + }); + } + + if (typeof value === 'object' && value !== null) { + const obj = value as Record; + return t.objectValue({ + fields: Object.entries(obj).map(([key, val]) => + t.objectField({ + name: key, + value: buildValueAst(val), + }) + ), + }); + } + + throw new Error('Unsupported value type: ' + typeof value); +} + +// ============================================================================ +// Bulk Mutation Document Builders +// ============================================================================ + +export function buildBulkInsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict?: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + ...(onConflict ? { onConflict } : {}), + }, + }, + }; +} + +export function buildBulkUpsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + onConflict, + }, + }, + }; +} + +export function buildBulkUpdateDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + patch: data, + }, + }, + }; +} + +export function buildBulkDeleteDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + }, + }, + }; +} diff --git a/sdk/constructive-react/src/config/orm/realtime.ts b/sdk/constructive-react/src/config/orm/realtime.ts new file mode 100644 index 0000000000..214eb56203 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/realtime.ts @@ -0,0 +1,244 @@ +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// Minimal type shims so this module compiles without graphql-ws +// installed. Consumers supply a WsClient via RealtimeConfig; +// the SDK itself never imports or requires graphql-ws. + +interface WsGraphQLError { + readonly message: string; + readonly [key: string]: unknown; +} + +interface WsExecutionResult> { + data?: TData | null; + errors?: readonly WsGraphQLError[]; + extensions?: Record; +} + +interface WsSink { + next(value: T): void; + error(error: unknown): void; + complete(): void; +} + +/** + * Minimal interface matching the graphql-ws Client. + * Consumers pass a concrete instance via RealtimeConfig.client. + */ +export interface WsClient { + subscribe>( + payload: { query: string; variables?: Record }, + sink: WsSink> + ): () => void; + dispose(): void; +} + +// ============================================================================ +// Types +// ============================================================================ + +/** The DML operation that triggered the subscription event */ +export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; + +/** Connection state of the WebSocket */ +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; + +/** Listener for connection state changes */ +export type ConnectionStateListener = (state: ConnectionState) => void; + +/** Function returned by subscribe() to cancel the subscription */ +export type Unsubscribe = () => void; + +/** + * A realtime subscription event delivered to the client. + * + * @typeParam T - The row type of the subscribed table + */ +export interface SubscriptionEvent { + /** The DML operation that triggered this event */ + operation: SubscriptionOperation; + /** The current row data (null for DELETE if row is no longer visible) */ + data: T | null; + /** Previous field values (populated on UPDATE when available) */ + previousValues?: Partial; + /** Server-side timestamp of when the change occurred */ + timestamp: string; +} + +/** + * Options for creating a subscription. + * + * @typeParam T - The row type of the subscribed table + * @typeParam TFilter - The filter type for the table + */ +export interface SubscribeOptions> { + /** Server-side filter to limit which events are delivered */ + filter?: TFilter; + /** Called when a subscription event is received */ + onEvent: (event: SubscriptionEvent) => void; + /** Called when the subscription encounters an error */ + onError?: (error: Error) => void; + /** Called when the subscription completes (server-initiated close) */ + onComplete?: () => void; +} + +/** + * Metadata about a subscription field, used internally to map + * table names to GraphQL subscription field names and types. + */ +export interface SubscriptionFieldMeta { + /** The GraphQL subscription field name (e.g., 'onContactChanged') */ + fieldName: string; + /** The table name in the source schema (e.g., 'contact') */ + tableName: string; + /** The data field name inside the subscription payload (e.g., 'contact') */ + dataFieldName: string; +} + +/** + * Configuration for the realtime (WebSocket) connection. + * Pass this as the `realtime` option in OrmClientConfig. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * + * const client = createOrmClient({ + * endpoint: 'https://api.example.com/graphql', + * realtime: { + * client: createClient({ url: 'wss://api.example.com/graphql' }), + * }, + * }); + * ``` + */ +export interface RealtimeConfig { + /** + * A graphql-ws Client instance (or any object satisfying WsClient). + * The consumer creates this themselves, giving full control over + * connection options, auth, and transport. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * const wsClient = createClient({ url: 'wss://...' }); + * ``` + */ + client: WsClient; +} + +// ============================================================================ +// RealtimeManager +// ============================================================================ + +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +export class RealtimeManager { + private wsClient: WsClient; + private connectionState: ConnectionState = 'disconnected'; + private stateListeners: Set = new Set(); + private activeSubscriptions = 0; + + constructor(config: RealtimeConfig) { + this.wsClient = config.client; + } + + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + this.activeSubscriptions++; + let disposed = false; + + const cleanup = this.wsClient.subscribe>( + { query: document, variables }, + { + next: (result) => { + if (disposed) return; + if (result.errors) { + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); + return; + } + + const payload = result.data?.[meta.fieldName] as + | { event?: string; [key: string]: unknown } + | undefined; + + if (!payload) return; + + const event: SubscriptionEvent = { + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', + data: (payload[meta.dataFieldName] as T) ?? null, + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), + }; + options.onEvent(event); + }, + error: (err) => { + if (disposed) return; + options.onError?.(err instanceof Error ? err : new Error(String(err))); + }, + complete: () => { + if (disposed) return; + options.onComplete?.(); + }, + } + ); + + return () => { + if (disposed) return; + disposed = true; + this.activeSubscriptions--; + cleanup(); + }; + } + + /** Register a listener for connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + this.stateListeners.add(listener); + return () => { + this.stateListeners.delete(listener); + }; + } + + /** Get current connection state */ + getConnectionState(): ConnectionState { + return this.connectionState; + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.activeSubscriptions; + } + + /** Dispose the manager and close the WebSocket connection */ + dispose(): void { + this.wsClient.dispose(); + this.stateListeners.clear(); + this.activeSubscriptions = 0; + this.setConnectionState('disconnected'); + } + + private setConnectionState(state: ConnectionState): void { + if (this.connectionState === state) return; + this.connectionState = state; + for (const listener of this.stateListeners) { + listener(state); + } + } +} diff --git a/sdk/constructive-react/src/config/orm/select-types.ts b/sdk/constructive-react/src/config/orm/select-types.ts new file mode 100644 index 0000000000..4b39d7e820 --- /dev/null +++ b/sdk/constructive-react/src/config/orm/select-types.ts @@ -0,0 +1,169 @@ +/** + * Type utilities for select inference + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} + +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} + +export interface FindManyArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +export interface FindFirstArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; +} + +export interface CreateArgs { + data: TData; + select?: TSelect; +} + +export interface UpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export type FindOneArgs = { + select?: TSelect; +} & Record; + +export interface DeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkInsertArgs { + data: TData[]; + select?: TSelect; + onConflict?: TOnConflict; +} + +export interface BulkUpsertArgs { + data: TData[]; + select?: TSelect; + onConflict: TOnConflict; +} + +export interface BulkUpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export interface BulkDeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkMutationResult { + affectedCount: number; + returning: T[]; +} + +type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +type DecrementDepth = { + 0: 0; + 1: 0; + 2: 1; + 3: 2; + 4: 3; + 5: 4; + 6: 5; + 7: 6; + 8: 7; + 9: 8; + 10: 9; +}; + +/** + * Recursively validates select objects, rejecting unknown keys. + * + * NOTE: Depth is intentionally capped to avoid circular-instantiation issues + * in very large cyclic schemas. + */ +export type DeepExact = Depth extends 0 + ? T extends Shape + ? T + : never + : T extends Shape + ? Exclude extends never + ? { + [K in keyof T]: K extends keyof Shape + ? T[K] extends { select: infer NS } + ? Extract extends { + select?: infer ShapeNS; + } + ? DeepExact< + Omit & { + select: DeepExact, DecrementDepth[Depth]>; + }, + Extract, + DecrementDepth[Depth] + > + : never + : T[K] + : never; + } + : never + : never; + +/** + * Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`. + * Use this as an intersection in overloads: + * `{ select: S } & StrictSelect`. + */ +export type StrictSelect = S extends DeepExact ? {} : never; + +/** + * Hook-optimized strict select variant. + * + * Uses a shallower recursion depth to keep editor autocomplete responsive + * in large schemas while still validating common nested-select mistakes. + */ +export type HookStrictSelect = S extends DeepExact ? {} : never; + +/** + * Infer result type from select configuration + */ +export type InferSelectResult = TSelect extends undefined + ? TEntity + : { + [K in keyof TSelect as TSelect[K] extends false | undefined + ? never + : K]: TSelect[K] extends true + ? K extends keyof TEntity + ? TEntity[K] + : never + : TSelect[K] extends { select: infer NestedSelect } + ? K extends keyof TEntity + ? NonNullable extends ConnectionResult + ? ConnectionResult> + : + | InferSelectResult, NestedSelect> + | (null extends TEntity[K] ? null : never) + : never + : K extends keyof TEntity + ? TEntity[K] + : never; + }; diff --git a/sdk/constructive-react/src/config/orm/types.ts b/sdk/constructive-react/src/config/orm/types.ts new file mode 100644 index 0000000000..7c1120bcdf --- /dev/null +++ b/sdk/constructive-react/src/config/orm/types.ts @@ -0,0 +1,8 @@ +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// Re-export all types from input-types +export * from './input-types'; diff --git a/sdk/constructive-react/src/config/schema-types.ts b/sdk/constructive-react/src/config/schema-types.ts new file mode 100644 index 0000000000..8bff1314df --- /dev/null +++ b/sdk/constructive-react/src/config/schema-types.ts @@ -0,0 +1,627 @@ +/** + * GraphQL schema types for custom operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import type { + PlatformConfig, + PlatformConfigDefinition, + BigFloatFilter, + BigIntFilter, + BitStringFilter, + BooleanFilter, + DateFilter, + DatetimeFilter, + FloatFilter, + FullTextFilter, + IntFilter, + IntListFilter, + InternetAddressFilter, + JSONFilter, + StringFilter, + StringListFilter, + UUIDFilter, + UUIDListFilter, + VectorFilter, +} from './types'; +/** Methods to use when ordering `PlatformConfigDefinition`. */ +export type PlatformConfigDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC'; +/** Methods to use when ordering `PlatformConfig`. */ +export type PlatformConfigOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC'; +/** A filter to be used against `PlatformConfigDefinition` object types. All fields are combined with a logical ‘and.’ */ +export interface PlatformConfigDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `defaultValue` field. */ + defaultValue?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigDefinitionFilter[]; + /** Negates the expression. */ + not?: PlatformConfigDefinitionFilter; +} +/** A filter to be used against `PlatformConfig` object types. All fields are combined with a logical ‘and.’ */ +export interface PlatformConfigFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `value` field. */ + value?: StringFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigFilter[]; + /** Negates the expression. */ + not?: PlatformConfigFilter; +} +export interface PlatformSecretsDelInput { + clientMutationId?: string; + secretName?: string; + namespaceId?: string; +} +export interface OrgSecretsDelInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + namespaceId?: string; +} +export interface PlatformSecretsRemoveArrayInput { + clientMutationId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface OrgSecretsRemoveArrayInput { + clientMutationId?: string; + ownerId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface PlatformSecretsRotateInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface PlatformSecretsSetInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface OrgSecretsRotateInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface OrgSecretsSetInput { + clientMutationId?: string; + scopeOwnerId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface CreatePlatformConfigDefinitionInput { + clientMutationId?: string; + /** The `PlatformConfigDefinition` to be created by this mutation. */ + platformConfigDefinition: PlatformConfigDefinitionInput; +} +/** An input for mutations affecting `PlatformConfigDefinition` */ +export interface PlatformConfigDefinitionInput { + /** Unique identifier for this config definition */ + id?: string; + createdAt?: string; + updatedAt?: string; + /** Config key name (must match config table name for resolution) */ + name: string; + /** Human-readable description of what this config key controls */ + description?: string; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: unknown; + /** Freeform metadata annotations for config definitions */ + annotations?: unknown; +} +export interface CreatePlatformConfigInput { + clientMutationId?: string; + /** The `PlatformConfig` to be created by this mutation. */ + platformConfig: PlatformConfigInput; +} +/** An input for mutations affecting `PlatformConfig` */ +export interface PlatformConfigInput { + /** Unique identifier for this config entry */ + id?: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId: string; + /** Key name identifying the config entry */ + name: string; + /** Plaintext config value */ + value?: string; + /** Key/value pairs for selecting/filtering config entries */ + labels?: unknown; + /** Freeform metadata for tooling and operational notes */ + annotations?: unknown; + /** Human-readable note about this config entry */ + description?: string; + createdAt?: string; + updatedAt?: string; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string; +} +export interface UpdatePlatformConfigDefinitionInput { + clientMutationId?: string; + /** Unique identifier for this config definition */ + id: string; + /** An object where the defined keys will be set on the `PlatformConfigDefinition` being updated. */ + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; +} +/** Represents an update to a `PlatformConfigDefinition`. Fields that are set will be updated. */ +export interface PlatformConfigDefinitionPatch { + /** Unique identifier for this config definition */ + id?: string; + createdAt?: string; + updatedAt?: string; + /** Config key name (must match config table name for resolution) */ + name?: string; + /** Human-readable description of what this config key controls */ + description?: string; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: unknown; + /** Freeform metadata annotations for config definitions */ + annotations?: unknown; +} +export interface UpdatePlatformConfigInput { + clientMutationId?: string; + /** Unique identifier for this config entry */ + id: string; + /** An object where the defined keys will be set on the `PlatformConfig` being updated. */ + platformConfigPatch: PlatformConfigPatch; +} +/** Represents an update to a `PlatformConfig`. Fields that are set will be updated. */ +export interface PlatformConfigPatch { + /** Unique identifier for this config entry */ + id?: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId?: string; + /** Key name identifying the config entry */ + name?: string; + /** Plaintext config value */ + value?: string; + /** Key/value pairs for selecting/filtering config entries */ + labels?: unknown; + /** Freeform metadata for tooling and operational notes */ + annotations?: unknown; + /** Human-readable note about this config entry */ + description?: string; + createdAt?: string; + updatedAt?: string; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string; +} +export interface DeletePlatformConfigDefinitionInput { + clientMutationId?: string; + /** Unique identifier for this config definition */ + id: string; +} +export interface DeletePlatformConfigInput { + clientMutationId?: string; + /** Unique identifier for this config entry */ + id: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** A connection to a list of `PlatformConfigDefinition` values. */ +export interface PlatformConfigDefinitionConnection { + nodes: PlatformConfigDefinition[]; + edges: PlatformConfigDefinitionEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `PlatformConfig` values. */ +export interface PlatformConfigConnection { + nodes: PlatformConfig[]; + edges: PlatformConfigEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** Root meta schema type */ +export interface MetaSchema { + tables: MetaTable[]; +} +export interface PlatformSecretsDelPayload { + clientMutationId?: string | null; +} +export interface OrgSecretsDelPayload { + clientMutationId?: string | null; +} +export interface PlatformSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export interface OrgSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export interface PlatformSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export interface PlatformSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export interface OrgSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export interface OrgSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export interface CreatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was created by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export interface CreatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was created by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export interface UpdatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was updated by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export interface UpdatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was updated by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export interface DeletePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was deleted by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export interface DeletePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was deleted by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +/** A `PlatformConfigDefinition` edge in the connection. */ +export interface PlatformConfigDefinitionEdge { + cursor?: string | null; + /** The `PlatformConfigDefinition` at the end of the edge. */ + node?: PlatformConfigDefinition | null; +} +/** Information about pagination in a connection. */ +export interface PageInfo { + /** When paginating forwards, are there more items? */ + hasNextPage: boolean; + /** When paginating backwards, are there more items? */ + hasPreviousPage: boolean; + /** When paginating backwards, the cursor to continue. */ + startCursor?: string | null; + /** When paginating forwards, the cursor to continue. */ + endCursor?: string | null; +} +/** A `PlatformConfig` edge in the connection. */ +export interface PlatformConfigEdge { + cursor?: string | null; + /** The `PlatformConfig` at the end of the edge. */ + node?: PlatformConfig | null; +} +/** Information about a database table */ +export interface MetaTable { + name: string; + schemaName: string; + fields: MetaField[]; + indexes: MetaIndex[]; + constraints: MetaConstraints; + foreignKeyConstraints: MetaForeignKeyConstraint[]; + primaryKeyConstraints: MetaPrimaryKeyConstraint[]; + uniqueConstraints: MetaUniqueConstraint[]; + relations: MetaRelations; + inflection: MetaInflection; + query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; +} +/** Information about a table field/column */ +export interface MetaField { + name: string; + type: MetaType; + isNotNull: boolean; + hasDefault: boolean; + isPrimaryKey: boolean; + isForeignKey: boolean; + description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; +} +/** Information about a database index */ +export interface MetaIndex { + name: string; + isUnique: boolean; + isPrimary: boolean; + columns: string[]; + fields?: MetaField[] | null; +} +/** Table constraints */ +export interface MetaConstraints { + primaryKey?: MetaPrimaryKeyConstraint | null; + unique: MetaUniqueConstraint[]; + foreignKey: MetaForeignKeyConstraint[]; +} +/** Information about a foreign key constraint */ +export interface MetaForeignKeyConstraint { + name: string; + fields: MetaField[]; + referencedTable: string; + referencedFields: string[]; + refFields?: MetaField[] | null; + refTable?: MetaRefTable | null; +} +/** Information about a primary key constraint */ +export interface MetaPrimaryKeyConstraint { + name: string; + fields: MetaField[]; +} +/** Information about a unique constraint */ +export interface MetaUniqueConstraint { + name: string; + fields: MetaField[]; +} +/** Table relations */ +export interface MetaRelations { + belongsTo: MetaBelongsToRelation[]; + has: MetaHasRelation[]; + hasOne: MetaHasRelation[]; + hasMany: MetaHasRelation[]; + manyToMany: MetaManyToManyRelation[]; +} +/** Table inflection names */ +export interface MetaInflection { + tableType: string; + allRows: string; + connection: string; + edge: string; + filterType?: string | null; + orderByType: string; + conditionType: string; + patchType?: string | null; + createInputType: string; + createPayloadType: string; + updatePayloadType?: string | null; + deletePayloadType: string; +} +/** Table query/mutation names */ +export interface MetaQuery { + all: string; + one?: string | null; + create?: string | null; + update?: string | null; + delete?: string | null; +} +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} +/** Information about a PostgreSQL type */ +export interface MetaType { + pgType: string; + gqlType: string; + isArray: boolean; + isNotNull?: boolean | null; + hasDefault?: boolean | null; + subtype?: string | null; +} +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} +/** Reference to a related table */ +export interface MetaRefTable { + name: string; +} +/** A belongs-to (forward FK) relation */ +export interface MetaBelongsToRelation { + fieldName?: string | null; + isUnique: boolean; + type?: string | null; + keys: MetaField[]; + references: MetaRefTable; +} +/** A has-one or has-many (reverse FK) relation */ +export interface MetaHasRelation { + fieldName?: string | null; + isUnique: boolean; + type?: string | null; + keys: MetaField[]; + referencedBy: MetaRefTable; +} +/** A many-to-many relation via junction table */ +export interface MetaManyToManyRelation { + fieldName?: string | null; + type?: string | null; + junctionTable: MetaRefTable; + junctionLeftConstraint: MetaForeignKeyConstraint; + junctionLeftKeyAttributes: MetaField[]; + junctionRightConstraint: MetaForeignKeyConstraint; + junctionRightKeyAttributes: MetaField[]; + leftKeyAttributes: MetaField[]; + rightKeyAttributes: MetaField[]; + rightTable: MetaRefTable; +} +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/config/types.ts b/sdk/constructive-react/src/config/types.ts new file mode 100644 index 0000000000..9d44cc028c --- /dev/null +++ b/sdk/constructive-react/src/config/types.ts @@ -0,0 +1,252 @@ +/** + * Entity types and filter types + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface PlatformConfigDefinition { + id: string | null; + createdAt: string | null; + updatedAt: string | null; + name: string | null; + description: string | null; + defaultValue: string | null; + isBuiltIn: boolean | null; + labels: unknown | null; + annotations: unknown | null; +} +export interface PlatformConfig { + id: string | null; + namespaceId: string | null; + name: string | null; + value: string | null; + labels: unknown | null; + annotations: unknown | null; + description: string | null; + createdAt: string | null; + updatedAt: string | null; + expiresAt: string | null; +} +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: unknown; + containedBy?: unknown; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containedBy?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} diff --git a/sdk/constructive-react/src/index.ts b/sdk/constructive-react/src/index.ts index dca8c56ed3..eb54985786 100644 --- a/sdk/constructive-react/src/index.ts +++ b/sdk/constructive-react/src/index.ts @@ -10,6 +10,8 @@ export * as admin from './admin'; export * as agent from './agent'; export * as api from './api'; export * as auth from './auth'; +export * as compute from './compute'; +export * as config from './config'; export * as modules from './modules'; export * as objects from './objects'; export * as usage from './usage'; diff --git a/sdk/constructive-react/src/modules/README.md b/sdk/constructive-react/src/modules/README.md index 8aff8e0a49..ae5832ff41 100644 --- a/sdk/constructive-react/src/modules/README.md +++ b/sdk/constructive-react/src/modules/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 57 +- **Tables:** 59 - **Custom queries:** 2 - **Custom mutations:** 10 diff --git a/sdk/constructive-react/src/modules/hooks/README.md b/sdk/constructive-react/src/modules/hooks/README.md index 21ffc56316..e6d1d52b26 100644 --- a/sdk/constructive-react/src/modules/hooks/README.md +++ b/sdk/constructive-react/src/modules/hooks/README.md @@ -277,11 +277,6 @@ function App() { | `useCreateInvitesModuleMutation` | Mutation | Create a invitesModule | | `useUpdateInvitesModuleMutation` | Mutation | Update a invitesModule | | `useDeleteInvitesModuleMutation` | Mutation | Delete a invitesModule | -| `useNamespaceModulesQuery` | Query | List all namespaceModules | -| `useNamespaceModuleQuery` | Query | Get one namespaceModule | -| `useCreateNamespaceModuleMutation` | Mutation | Create a namespaceModule | -| `useUpdateNamespaceModuleMutation` | Mutation | Update a namespaceModule | -| `useDeleteNamespaceModuleMutation` | Mutation | Delete a namespaceModule | | `useComputeLogModulesQuery` | Query | List all computeLogModules | | `useComputeLogModuleQuery` | Query | Get one computeLogModule | | `useCreateComputeLogModuleMutation` | Mutation | Create a computeLogModule | @@ -292,6 +287,11 @@ function App() { | `useCreateInferenceLogModuleMutation` | Mutation | Create a inferenceLogModule | | `useUpdateInferenceLogModuleMutation` | Mutation | Update a inferenceLogModule | | `useDeleteInferenceLogModuleMutation` | Mutation | Delete a inferenceLogModule | +| `useNamespaceModulesQuery` | Query | List all namespaceModules | +| `useNamespaceModuleQuery` | Query | Get one namespaceModule | +| `useCreateNamespaceModuleMutation` | Mutation | Create a namespaceModule | +| `useUpdateNamespaceModuleMutation` | Mutation | Update a namespaceModule | +| `useDeleteNamespaceModuleMutation` | Mutation | Delete a namespaceModule | | `useStorageLogModulesQuery` | Query | List all storageLogModules | | `useStorageLogModuleQuery` | Query | Get one storageLogModule | | `useCreateStorageLogModuleMutation` | Mutation | Create a storageLogModule | @@ -302,6 +302,11 @@ function App() { | `useCreateTransferLogModuleMutation` | Mutation | Create a transferLogModule | | `useUpdateTransferLogModuleMutation` | Mutation | Update a transferLogModule | | `useDeleteTransferLogModuleMutation` | Mutation | Delete a transferLogModule | +| `useFunctionDeploymentModulesQuery` | Query | List all functionDeploymentModules | +| `useFunctionDeploymentModuleQuery` | Query | Get one functionDeploymentModule | +| `useCreateFunctionDeploymentModuleMutation` | Mutation | Create a functionDeploymentModule | +| `useUpdateFunctionDeploymentModuleMutation` | Mutation | Update a functionDeploymentModule | +| `useDeleteFunctionDeploymentModuleMutation` | Mutation | Delete a functionDeploymentModule | | `usePlansModulesQuery` | Query | List all plansModules | | `usePlansModuleQuery` | Query | Get one plansModule | | `useCreatePlansModuleMutation` | Mutation | Create a plansModule | @@ -317,6 +322,11 @@ function App() { | `useCreateDbUsageModuleMutation` | Mutation | Create a dbUsageModule | | `useUpdateDbUsageModuleMutation` | Mutation | Update a dbUsageModule | | `useDeleteDbUsageModuleMutation` | Mutation | Delete a dbUsageModule | +| `useGraphExecutionModulesQuery` | Query | List all graphExecutionModules | +| `useGraphExecutionModuleQuery` | Query | Get one graphExecutionModule | +| `useCreateGraphExecutionModuleMutation` | Mutation | Create a graphExecutionModule | +| `useUpdateGraphExecutionModuleMutation` | Mutation | Update a graphExecutionModule | +| `useDeleteGraphExecutionModuleMutation` | Mutation | Delete a graphExecutionModule | | `useHierarchyModulesQuery` | Query | List all hierarchyModules | | `useHierarchyModuleQuery` | Query | Get one hierarchyModule | | `useCreateHierarchyModuleMutation` | Mutation | Create a hierarchyModule | @@ -1042,20 +1052,20 @@ create({ databaseId: '', schemaId: '', privateSchemaId: '', pu ```typescript // List all graphModules const { data, isLoading } = useGraphModulesQuery({ - selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, + selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, }); // Get one graphModule const { data: item } = useGraphModuleQuery({ id: '', - selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, + selection: { fields: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, }); // Create a graphModule const { mutate: create } = useCreateGraphModuleMutation({ selection: { fields: { id: true } }, }); -create({ databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', executionsTableId: '', outputsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); +create({ databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); ``` ### DatabaseProvisionModule @@ -1226,27 +1236,6 @@ const { mutate: create } = useCreateInvitesModuleMutation({ create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', emailsTableId: '', usersTableId: '', invitesTableId: '', claimedInvitesTableId: '', invitesTableName: '', claimedInvitesTableName: '', submitInviteCodeFunction: '', scope: '', prefix: '', entityTableId: '', apiName: '', privateApiName: '' }); ``` -### NamespaceModule - -```typescript -// List all namespaceModules -const { data, isLoading } = useNamespaceModulesQuery({ - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }, -}); - -// Get one namespaceModule -const { data: item } = useNamespaceModuleQuery({ - id: '', - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }, -}); - -// Create a namespaceModule -const { mutate: create } = useCreateNamespaceModuleMutation({ - selection: { fields: { id: true } }, -}); -create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); -``` - ### ComputeLogModule ```typescript @@ -1289,6 +1278,27 @@ const { mutate: create } = useCreateInferenceLogModuleMutation({ create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', inferenceLogTableId: '', inferenceLogTableName: '', usageDailyTableId: '', usageDailyTableName: '', interval: '', retention: '', premake: '', scope: '', actorFkTableId: '', entityFkTableId: '', prefix: '', apiName: '', privateApiName: '' }); ``` +### NamespaceModule + +```typescript +// List all namespaceModules +const { data, isLoading } = useNamespaceModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }, +}); + +// Get one namespaceModule +const { data: item } = useNamespaceModuleQuery({ + id: '', + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }, +}); + +// Create a namespaceModule +const { mutate: create } = useCreateNamespaceModuleMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', platformNamespacesTableId: '', policies: '', provisions: '', defaultPermissions: '' }); +``` + ### StorageLogModule ```typescript @@ -1331,6 +1341,27 @@ const { mutate: create } = useCreateTransferLogModuleMutation({ create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', transferLogTableId: '', transferLogTableName: '', usageDailyTableId: '', usageDailyTableName: '', interval: '', retention: '', premake: '', scope: '', actorFkTableId: '', entityFkTableId: '', prefix: '', apiName: '', privateApiName: '' }); ``` +### FunctionDeploymentModule + +```typescript +// List all functionDeploymentModules +const { data, isLoading } = useFunctionDeploymentModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }, +}); + +// Get one functionDeploymentModule +const { data: item } = useFunctionDeploymentModuleQuery({ + id: '', + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }, +}); + +// Create a functionDeploymentModule +const { mutate: create } = useCreateFunctionDeploymentModuleMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', deploymentsTableId: '', deploymentEventsTableId: '', deploymentsTableName: '', deploymentEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', functionModuleId: '', namespaceModuleId: '', policies: '', provisions: '', defaultPermissions: '' }); +``` + ### PlansModule ```typescript @@ -1394,6 +1425,27 @@ const { mutate: create } = useCreateDbUsageModuleMutation({ create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableStatsLogTableId: '', tableStatsLogTableName: '', tableStatsDailyTableId: '', tableStatsDailyTableName: '', queryStatsLogTableId: '', queryStatsLogTableName: '', queryStatsDailyTableId: '', queryStatsDailyTableName: '', interval: '', retention: '', premake: '', scope: '', prefix: '', defaultPermissions: '', apiName: '', privateApiName: '' }); ``` +### GraphExecutionModule + +```typescript +// List all graphExecutionModules +const { data, isLoading } = useGraphExecutionModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, +}); + +// Get one graphExecutionModule +const { data: item } = useGraphExecutionModuleQuery({ + id: '', + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, +}); + +// Create a graphExecutionModule +const { mutate: create } = useCreateGraphExecutionModuleMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', graphModuleId: '', scope: '', prefix: '', executionsTableId: '', outputsTableId: '', nodeStatesTableId: '', executionsTableName: '', outputsTableName: '', nodeStatesTableName: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); +``` + ### HierarchyModule ```typescript diff --git a/sdk/constructive-react/src/modules/hooks/index.ts b/sdk/constructive-react/src/modules/hooks/index.ts index e93e1825bb..3de92c18ee 100644 --- a/sdk/constructive-react/src/modules/hooks/index.ts +++ b/sdk/constructive-react/src/modules/hooks/index.ts @@ -2,7 +2,7 @@ * GraphQL SDK * @generated by @constructive-io/graphql-codegen * - * Tables: DefaultIdsModule, MembershipTypesModule, UserStateModule, SessionSecretsModule, ConfigSecretsOrgModule, DevicesModule, I18NModule, UserCredentialsModule, UserSettingsModule, ConfigSecretsUserModule, ConnectedAccountsModule, EmailsModule, PhoneNumbersModule, RateLimitsModule, UsersModule, WebauthnCredentialsModule, CryptoAddressesModule, DenormalizedTableField, IdentityProvidersModule, RlsModule, Blueprint, BlueprintTemplate, BlueprintConstruction, CryptoAuthModule, SessionsModule, SecureTableProvision, MerkleStoreModule, GraphModule, DatabaseProvisionModule, ConfigSecretsModule, RateLimitMetersModule, RealtimeModule, WebauthnAuthModule, FunctionInvocationModule, FunctionModule, InvitesModule, NamespaceModule, ComputeLogModule, InferenceLogModule, StorageLogModule, TransferLogModule, PlansModule, BillingProviderModule, DbUsageModule, HierarchyModule, PermissionsModule, NotificationsModule, ProfilesModule, BillingModule, RelationProvision, UserAuthModule, AgentModule, LimitsModule, MembershipsModule, EntityTypeProvision, StorageModule, EventsModule + * Tables: DefaultIdsModule, MembershipTypesModule, UserStateModule, SessionSecretsModule, ConfigSecretsOrgModule, DevicesModule, I18NModule, UserCredentialsModule, UserSettingsModule, ConfigSecretsUserModule, ConnectedAccountsModule, EmailsModule, PhoneNumbersModule, RateLimitsModule, UsersModule, WebauthnCredentialsModule, CryptoAddressesModule, DenormalizedTableField, IdentityProvidersModule, RlsModule, Blueprint, BlueprintTemplate, BlueprintConstruction, CryptoAuthModule, SessionsModule, SecureTableProvision, MerkleStoreModule, GraphModule, DatabaseProvisionModule, ConfigSecretsModule, RateLimitMetersModule, RealtimeModule, WebauthnAuthModule, FunctionInvocationModule, FunctionModule, InvitesModule, ComputeLogModule, InferenceLogModule, NamespaceModule, StorageLogModule, TransferLogModule, FunctionDeploymentModule, PlansModule, BillingProviderModule, DbUsageModule, GraphExecutionModule, HierarchyModule, PermissionsModule, NotificationsModule, ProfilesModule, BillingModule, RelationProvision, UserAuthModule, AgentModule, LimitsModule, MembershipsModule, EntityTypeProvision, StorageModule, EventsModule * * Usage: * diff --git a/sdk/constructive-react/src/modules/hooks/invalidation.ts b/sdk/constructive-react/src/modules/hooks/invalidation.ts index eac46b9727..b971252a18 100644 --- a/sdk/constructive-react/src/modules/hooks/invalidation.ts +++ b/sdk/constructive-react/src/modules/hooks/invalidation.ts @@ -51,14 +51,16 @@ import { functionInvocationModuleKeys, functionModuleKeys, invitesModuleKeys, - namespaceModuleKeys, computeLogModuleKeys, inferenceLogModuleKeys, + namespaceModuleKeys, storageLogModuleKeys, transferLogModuleKeys, + functionDeploymentModuleKeys, plansModuleKeys, billingProviderModuleKeys, dbUsageModuleKeys, + graphExecutionModuleKeys, hierarchyModuleKeys, permissionsModuleKeys, notificationsModuleKeys, @@ -705,23 +707,6 @@ export const invalidate = { queryKey: invitesModuleKeys.detail(id), }), }, - /** Invalidate namespaceModule queries */ namespaceModule: { - /** Invalidate all namespaceModule queries */ all: (queryClient: QueryClient) => - queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.all, - }), - /** Invalidate namespaceModule list queries */ lists: (queryClient: QueryClient) => - queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.lists(), - }), - /** Invalidate a specific namespaceModule */ detail: ( - queryClient: QueryClient, - id: string | number - ) => - queryClient.invalidateQueries({ - queryKey: namespaceModuleKeys.detail(id), - }), - }, /** Invalidate computeLogModule queries */ computeLogModule: { /** Invalidate all computeLogModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -756,6 +741,23 @@ export const invalidate = { queryKey: inferenceLogModuleKeys.detail(id), }), }, + /** Invalidate namespaceModule queries */ namespaceModule: { + /** Invalidate all namespaceModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceModuleKeys.all, + }), + /** Invalidate namespaceModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: namespaceModuleKeys.lists(), + }), + /** Invalidate a specific namespaceModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: namespaceModuleKeys.detail(id), + }), + }, /** Invalidate storageLogModule queries */ storageLogModule: { /** Invalidate all storageLogModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -790,6 +792,23 @@ export const invalidate = { queryKey: transferLogModuleKeys.detail(id), }), }, + /** Invalidate functionDeploymentModule queries */ functionDeploymentModule: { + /** Invalidate all functionDeploymentModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.all, + }), + /** Invalidate functionDeploymentModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.lists(), + }), + /** Invalidate a specific functionDeploymentModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.detail(id), + }), + }, /** Invalidate plansModule queries */ plansModule: { /** Invalidate all plansModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -841,6 +860,23 @@ export const invalidate = { queryKey: dbUsageModuleKeys.detail(id), }), }, + /** Invalidate graphExecutionModule queries */ graphExecutionModule: { + /** Invalidate all graphExecutionModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.all, + }), + /** Invalidate graphExecutionModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.lists(), + }), + /** Invalidate a specific graphExecutionModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.detail(id), + }), + }, /** Invalidate hierarchyModule queries */ hierarchyModule: { /** Invalidate all hierarchyModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -1357,28 +1393,28 @@ export const remove = { queryKey: invitesModuleKeys.detail(id), }); }, - /** Remove namespaceModule from cache */ namespaceModule: ( + /** Remove computeLogModule from cache */ computeLogModule: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: namespaceModuleKeys.detail(id), + queryKey: computeLogModuleKeys.detail(id), }); }, - /** Remove computeLogModule from cache */ computeLogModule: ( + /** Remove inferenceLogModule from cache */ inferenceLogModule: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: computeLogModuleKeys.detail(id), + queryKey: inferenceLogModuleKeys.detail(id), }); }, - /** Remove inferenceLogModule from cache */ inferenceLogModule: ( + /** Remove namespaceModule from cache */ namespaceModule: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: inferenceLogModuleKeys.detail(id), + queryKey: namespaceModuleKeys.detail(id), }); }, /** Remove storageLogModule from cache */ storageLogModule: ( @@ -1397,6 +1433,14 @@ export const remove = { queryKey: transferLogModuleKeys.detail(id), }); }, + /** Remove functionDeploymentModule from cache */ functionDeploymentModule: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: functionDeploymentModuleKeys.detail(id), + }); + }, /** Remove plansModule from cache */ plansModule: ( queryClient: QueryClient, id: string | number @@ -1421,6 +1465,14 @@ export const remove = { queryKey: dbUsageModuleKeys.detail(id), }); }, + /** Remove graphExecutionModule from cache */ graphExecutionModule: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: graphExecutionModuleKeys.detail(id), + }); + }, /** Remove hierarchyModule from cache */ hierarchyModule: ( queryClient: QueryClient, id: string | number diff --git a/sdk/constructive-react/src/modules/hooks/mutation-keys.ts b/sdk/constructive-react/src/modules/hooks/mutation-keys.ts index c420528fa4..35bd3233b4 100644 --- a/sdk/constructive-react/src/modules/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/modules/hooks/mutation-keys.ts @@ -378,15 +378,6 @@ export const invitesModuleMutationKeys = { /** Delete invitesModule mutation key */ delete: (id: string | number) => ['mutation', 'invitesmodule', 'delete', id] as const, } as const; -export const namespaceModuleMutationKeys = { - /** All namespaceModule mutation keys */ all: ['mutation', 'namespacemodule'] as const, - /** Create namespaceModule mutation key */ create: () => - ['mutation', 'namespacemodule', 'create'] as const, - /** Update namespaceModule mutation key */ update: (id: string | number) => - ['mutation', 'namespacemodule', 'update', id] as const, - /** Delete namespaceModule mutation key */ delete: (id: string | number) => - ['mutation', 'namespacemodule', 'delete', id] as const, -} as const; export const computeLogModuleMutationKeys = { /** All computeLogModule mutation keys */ all: ['mutation', 'computelogmodule'] as const, /** Create computeLogModule mutation key */ create: () => @@ -405,6 +396,15 @@ export const inferenceLogModuleMutationKeys = { /** Delete inferenceLogModule mutation key */ delete: (id: string | number) => ['mutation', 'inferencelogmodule', 'delete', id] as const, } as const; +export const namespaceModuleMutationKeys = { + /** All namespaceModule mutation keys */ all: ['mutation', 'namespacemodule'] as const, + /** Create namespaceModule mutation key */ create: () => + ['mutation', 'namespacemodule', 'create'] as const, + /** Update namespaceModule mutation key */ update: (id: string | number) => + ['mutation', 'namespacemodule', 'update', id] as const, + /** Delete namespaceModule mutation key */ delete: (id: string | number) => + ['mutation', 'namespacemodule', 'delete', id] as const, +} as const; export const storageLogModuleMutationKeys = { /** All storageLogModule mutation keys */ all: ['mutation', 'storagelogmodule'] as const, /** Create storageLogModule mutation key */ create: () => @@ -423,6 +423,18 @@ export const transferLogModuleMutationKeys = { /** Delete transferLogModule mutation key */ delete: (id: string | number) => ['mutation', 'transferlogmodule', 'delete', id] as const, } as const; +export const functionDeploymentModuleMutationKeys = { + /** All functionDeploymentModule mutation keys */ all: [ + 'mutation', + 'functiondeploymentmodule', + ] as const, + /** Create functionDeploymentModule mutation key */ create: () => + ['mutation', 'functiondeploymentmodule', 'create'] as const, + /** Update functionDeploymentModule mutation key */ update: (id: string | number) => + ['mutation', 'functiondeploymentmodule', 'update', id] as const, + /** Delete functionDeploymentModule mutation key */ delete: (id: string | number) => + ['mutation', 'functiondeploymentmodule', 'delete', id] as const, +} as const; export const plansModuleMutationKeys = { /** All plansModule mutation keys */ all: ['mutation', 'plansmodule'] as const, /** Create plansModule mutation key */ create: () => @@ -453,6 +465,15 @@ export const dbUsageModuleMutationKeys = { /** Delete dbUsageModule mutation key */ delete: (id: string | number) => ['mutation', 'dbusagemodule', 'delete', id] as const, } as const; +export const graphExecutionModuleMutationKeys = { + /** All graphExecutionModule mutation keys */ all: ['mutation', 'graphexecutionmodule'] as const, + /** Create graphExecutionModule mutation key */ create: () => + ['mutation', 'graphexecutionmodule', 'create'] as const, + /** Update graphExecutionModule mutation key */ update: (id: string | number) => + ['mutation', 'graphexecutionmodule', 'update', id] as const, + /** Delete graphExecutionModule mutation key */ delete: (id: string | number) => + ['mutation', 'graphexecutionmodule', 'delete', id] as const, +} as const; export const hierarchyModuleMutationKeys = { /** All hierarchyModule mutation keys */ all: ['mutation', 'hierarchymodule'] as const, /** Create hierarchyModule mutation key */ create: () => @@ -682,14 +703,16 @@ export const mutationKeys = { functionInvocationModule: functionInvocationModuleMutationKeys, functionModule: functionModuleMutationKeys, invitesModule: invitesModuleMutationKeys, - namespaceModule: namespaceModuleMutationKeys, computeLogModule: computeLogModuleMutationKeys, inferenceLogModule: inferenceLogModuleMutationKeys, + namespaceModule: namespaceModuleMutationKeys, storageLogModule: storageLogModuleMutationKeys, transferLogModule: transferLogModuleMutationKeys, + functionDeploymentModule: functionDeploymentModuleMutationKeys, plansModule: plansModuleMutationKeys, billingProviderModule: billingProviderModuleMutationKeys, dbUsageModule: dbUsageModuleMutationKeys, + graphExecutionModule: graphExecutionModuleMutationKeys, hierarchyModule: hierarchyModuleMutationKeys, permissionsModule: permissionsModuleMutationKeys, notificationsModule: notificationsModuleMutationKeys, diff --git a/sdk/constructive-react/src/modules/hooks/mutations/index.ts b/sdk/constructive-react/src/modules/hooks/mutations/index.ts index 7cdf23ba00..edeff4af8f 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/index.ts @@ -111,21 +111,24 @@ export * from './useDeleteFunctionModuleMutation'; export * from './useCreateInvitesModuleMutation'; export * from './useUpdateInvitesModuleMutation'; export * from './useDeleteInvitesModuleMutation'; -export * from './useCreateNamespaceModuleMutation'; -export * from './useUpdateNamespaceModuleMutation'; -export * from './useDeleteNamespaceModuleMutation'; export * from './useCreateComputeLogModuleMutation'; export * from './useUpdateComputeLogModuleMutation'; export * from './useDeleteComputeLogModuleMutation'; export * from './useCreateInferenceLogModuleMutation'; export * from './useUpdateInferenceLogModuleMutation'; export * from './useDeleteInferenceLogModuleMutation'; +export * from './useCreateNamespaceModuleMutation'; +export * from './useUpdateNamespaceModuleMutation'; +export * from './useDeleteNamespaceModuleMutation'; export * from './useCreateStorageLogModuleMutation'; export * from './useUpdateStorageLogModuleMutation'; export * from './useDeleteStorageLogModuleMutation'; export * from './useCreateTransferLogModuleMutation'; export * from './useUpdateTransferLogModuleMutation'; export * from './useDeleteTransferLogModuleMutation'; +export * from './useCreateFunctionDeploymentModuleMutation'; +export * from './useUpdateFunctionDeploymentModuleMutation'; +export * from './useDeleteFunctionDeploymentModuleMutation'; export * from './useCreatePlansModuleMutation'; export * from './useUpdatePlansModuleMutation'; export * from './useDeletePlansModuleMutation'; @@ -135,6 +138,9 @@ export * from './useDeleteBillingProviderModuleMutation'; export * from './useCreateDbUsageModuleMutation'; export * from './useUpdateDbUsageModuleMutation'; export * from './useDeleteDbUsageModuleMutation'; +export * from './useCreateGraphExecutionModuleMutation'; +export * from './useUpdateGraphExecutionModuleMutation'; +export * from './useDeleteGraphExecutionModuleMutation'; export * from './useCreateHierarchyModuleMutation'; export * from './useUpdateHierarchyModuleMutation'; export * from './useDeleteHierarchyModuleMutation'; diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionDeploymentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionDeploymentModuleMutation.ts new file mode 100644 index 0000000000..eea1638be6 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateFunctionDeploymentModuleMutation.ts @@ -0,0 +1,91 @@ +/** + * Create mutation hook for FunctionDeploymentModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import { functionDeploymentModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + CreateFunctionDeploymentModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + CreateFunctionDeploymentModuleInput, +} from '../../orm/input-types'; +/** + * Mutation hook for creating a FunctionDeploymentModule + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateFunctionDeploymentModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateFunctionDeploymentModuleMutation( + params: { + selection: { + fields: S & FunctionDeploymentModuleSelect; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseMutationOptions< + { + createFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentModuleInput['functionDeploymentModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + CreateFunctionDeploymentModuleInput['functionDeploymentModule'] +>; +export function useCreateFunctionDeploymentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentModuleMutationKeys.create(), + mutationFn: (data: CreateFunctionDeploymentModuleInput['functionDeploymentModule']) => + getClient() + .functionDeploymentModule.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphExecutionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphExecutionModuleMutation.ts new file mode 100644 index 0000000000..ef08145d0d --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreateGraphExecutionModuleMutation.ts @@ -0,0 +1,91 @@ +/** + * Create mutation hook for GraphExecutionModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import { graphExecutionModuleMutationKeys } from '../mutation-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + CreateGraphExecutionModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + CreateGraphExecutionModuleInput, +} from '../../orm/input-types'; +/** + * Mutation hook for creating a GraphExecutionModule + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateGraphExecutionModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateGraphExecutionModuleMutation( + params: { + selection: { + fields: S & GraphExecutionModuleSelect; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseMutationOptions< + { + createGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + CreateGraphExecutionModuleInput['graphExecutionModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + CreateGraphExecutionModuleInput['graphExecutionModule'] +>; +export function useCreateGraphExecutionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: graphExecutionModuleMutationKeys.create(), + mutationFn: (data: CreateGraphExecutionModuleInput['graphExecutionModule']) => + getClient() + .graphExecutionModule.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionDeploymentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionDeploymentModuleMutation.ts new file mode 100644 index 0000000000..89989bf383 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteFunctionDeploymentModuleMutation.ts @@ -0,0 +1,104 @@ +/** + * Delete mutation hook for FunctionDeploymentModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import { functionDeploymentModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; +/** + * Mutation hook for deleting a FunctionDeploymentModule with typed selection + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteFunctionDeploymentModuleMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteFunctionDeploymentModuleMutation( + params: { + selection: { + fields: S & FunctionDeploymentModuleSelect; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteFunctionDeploymentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentModuleMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .functionDeploymentModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: functionDeploymentModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphExecutionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphExecutionModuleMutation.ts new file mode 100644 index 0000000000..f88e719ad7 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeleteGraphExecutionModuleMutation.ts @@ -0,0 +1,104 @@ +/** + * Delete mutation hook for GraphExecutionModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import { graphExecutionModuleMutationKeys } from '../mutation-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; +/** + * Mutation hook for deleting a GraphExecutionModule with typed selection + * + * @example + * ```tsx + * const { mutate, isPending } = useDeleteGraphExecutionModuleMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeleteGraphExecutionModuleMutation( + params: { + selection: { + fields: S & GraphExecutionModuleSelect; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseMutationOptions< + { + deleteGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeleteGraphExecutionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: graphExecutionModuleMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .graphExecutionModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: graphExecutionModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionDeploymentModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionDeploymentModuleMutation.ts new file mode 100644 index 0000000000..41e3fe9870 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateFunctionDeploymentModuleMutation.ts @@ -0,0 +1,116 @@ +/** + * Update mutation hook for FunctionDeploymentModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import { functionDeploymentModuleMutationKeys } from '../mutation-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModulePatch, +} from '../../orm/input-types'; +/** + * Mutation hook for updating a FunctionDeploymentModule + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateFunctionDeploymentModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', functionDeploymentModulePatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateFunctionDeploymentModuleMutation( + params: { + selection: { + fields: S & FunctionDeploymentModuleSelect; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }, + Error, + { + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; + } +>; +export function useUpdateFunctionDeploymentModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: functionDeploymentModuleMutationKeys.all, + mutationFn: ({ + id, + functionDeploymentModulePatch, + }: { + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; + }) => + getClient() + .functionDeploymentModule.update({ + where: { + id, + }, + data: functionDeploymentModulePatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: functionDeploymentModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphExecutionModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphExecutionModuleMutation.ts new file mode 100644 index 0000000000..e5a5c20a4a --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdateGraphExecutionModuleMutation.ts @@ -0,0 +1,116 @@ +/** + * Update mutation hook for GraphExecutionModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import { graphExecutionModuleMutationKeys } from '../mutation-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModulePatch, +} from '../../orm/input-types'; +/** + * Mutation hook for updating a GraphExecutionModule + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdateGraphExecutionModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', graphExecutionModulePatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdateGraphExecutionModuleMutation( + params: { + selection: { + fields: S & GraphExecutionModuleSelect; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseMutationOptions< + { + updateGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + graphExecutionModulePatch: GraphExecutionModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updateGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }, + Error, + { + id: string; + graphExecutionModulePatch: GraphExecutionModulePatch; + } +>; +export function useUpdateGraphExecutionModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + graphExecutionModulePatch: GraphExecutionModulePatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: graphExecutionModuleMutationKeys.all, + mutationFn: ({ + id, + graphExecutionModulePatch, + }: { + id: string; + graphExecutionModulePatch: GraphExecutionModulePatch; + }) => + getClient() + .graphExecutionModule.update({ + where: { + id, + }, + data: graphExecutionModulePatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: graphExecutionModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/queries/index.ts b/sdk/constructive-react/src/modules/hooks/queries/index.ts index 0986052b1f..b3cd4d97da 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/index.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/index.ts @@ -75,22 +75,26 @@ export * from './useFunctionModulesQuery'; export * from './useFunctionModuleQuery'; export * from './useInvitesModulesQuery'; export * from './useInvitesModuleQuery'; -export * from './useNamespaceModulesQuery'; -export * from './useNamespaceModuleQuery'; export * from './useComputeLogModulesQuery'; export * from './useComputeLogModuleQuery'; export * from './useInferenceLogModulesQuery'; export * from './useInferenceLogModuleQuery'; +export * from './useNamespaceModulesQuery'; +export * from './useNamespaceModuleQuery'; export * from './useStorageLogModulesQuery'; export * from './useStorageLogModuleQuery'; export * from './useTransferLogModulesQuery'; export * from './useTransferLogModuleQuery'; +export * from './useFunctionDeploymentModulesQuery'; +export * from './useFunctionDeploymentModuleQuery'; export * from './usePlansModulesQuery'; export * from './usePlansModuleQuery'; export * from './useBillingProviderModulesQuery'; export * from './useBillingProviderModuleQuery'; export * from './useDbUsageModulesQuery'; export * from './useDbUsageModuleQuery'; +export * from './useGraphExecutionModulesQuery'; +export * from './useGraphExecutionModuleQuery'; export * from './useHierarchyModulesQuery'; export * from './useHierarchyModuleQuery'; export * from './usePermissionsModulesQuery'; diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModuleQuery.ts new file mode 100644 index 0000000000..886b76ee94 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModuleQuery.ts @@ -0,0 +1,151 @@ +/** + * Single item query hook for FunctionDeploymentModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDeploymentModuleQueryKey = functionDeploymentModuleKeys.detail; +/** + * Query hook for fetching a single FunctionDeploymentModule + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDeploymentModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useFunctionDeploymentModuleQuery< + S extends FunctionDeploymentModuleSelect, + TData = { + functionDeploymentModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentModule: InferSelectResult< + FunctionDeploymentModuleWithRelations, + S + > | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDeploymentModuleKeys.detail(params.id), + queryFn: () => + getClient() + .functionDeploymentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Fetch a single FunctionDeploymentModule without React hooks + * + * @example + * ```ts + * const data = await fetchFunctionDeploymentModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchFunctionDeploymentModuleQuery< + S extends FunctionDeploymentModuleSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; +}): Promise<{ + functionDeploymentModule: InferSelectResult | null; +}>; +export async function fetchFunctionDeploymentModuleQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .functionDeploymentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Prefetch a single FunctionDeploymentModule for SSR or cache warming + * + * @example + * ```ts + * await prefetchFunctionDeploymentModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchFunctionDeploymentModuleQuery< + S extends FunctionDeploymentModuleSelect, +>( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, FunctionDeploymentModuleSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDeploymentModuleKeys.detail(params.id), + queryFn: () => + getClient() + .functionDeploymentModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModulesQuery.ts new file mode 100644 index 0000000000..742a7f6966 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/queries/useFunctionDeploymentModulesQuery.ts @@ -0,0 +1,182 @@ +/** + * List query hook for FunctionDeploymentModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { functionDeploymentModuleKeys } from '../query-keys'; +import type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const functionDeploymentModulesQueryKey = functionDeploymentModuleKeys.list; +/** + * Query hook for fetching FunctionDeploymentModule list + * + * @example + * ```tsx + * const { data, isLoading } = useFunctionDeploymentModulesQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useFunctionDeploymentModulesQuery< + S extends FunctionDeploymentModuleSelect, + TData = { + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentModuleSelect>; + } & Omit< + UseQueryOptions< + { + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useFunctionDeploymentModulesQuery( + params: { + selection: ListSelectionConfig< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: functionDeploymentModuleKeys.list(args), + queryFn: () => getClient().functionDeploymentModule.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Fetch FunctionDeploymentModule list without React hooks + * + * @example + * ```ts + * const data = await fetchFunctionDeploymentModulesQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchFunctionDeploymentModulesQuery< + S extends FunctionDeploymentModuleSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentModuleSelect>; +}): Promise<{ + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchFunctionDeploymentModulesQuery(params: { + selection: ListSelectionConfig< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >; +}) { + const args = buildListSelectionArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >(params.selection); + return getClient().functionDeploymentModule.findMany(args).unwrap(); +} +/** + * Prefetch FunctionDeploymentModule list for SSR or cache warming + * + * @example + * ```ts + * await prefetchFunctionDeploymentModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchFunctionDeploymentModulesQuery< + S extends FunctionDeploymentModuleSelect, +>( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, FunctionDeploymentModuleSelect>; + } +): Promise; +export async function prefetchFunctionDeploymentModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: functionDeploymentModuleKeys.list(args), + queryFn: () => getClient().functionDeploymentModule.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModuleQuery.ts new file mode 100644 index 0000000000..8bf3b48ff1 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModuleQuery.ts @@ -0,0 +1,144 @@ +/** + * Single item query hook for GraphExecutionModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildSelectionArgs } from '../selection'; +import type { SelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const graphExecutionModuleQueryKey = graphExecutionModuleKeys.detail; +/** + * Query hook for fetching a single GraphExecutionModule + * + * @example + * ```tsx + * const { data, isLoading } = useGraphExecutionModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useGraphExecutionModuleQuery< + S extends GraphExecutionModuleSelect, + TData = { + graphExecutionModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseQueryOptions< + { + graphExecutionModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGraphExecutionModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: graphExecutionModuleKeys.detail(params.id), + queryFn: () => + getClient() + .graphExecutionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Fetch a single GraphExecutionModule without React hooks + * + * @example + * ```ts + * const data = await fetchGraphExecutionModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchGraphExecutionModuleQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, GraphExecutionModuleSelect>; +}): Promise<{ + graphExecutionModule: InferSelectResult | null; +}>; +export async function fetchGraphExecutionModuleQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .graphExecutionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Prefetch a single GraphExecutionModule for SSR or cache warming + * + * @example + * ```ts + * await prefetchGraphExecutionModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchGraphExecutionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, GraphExecutionModuleSelect>; + } +): Promise; +export async function prefetchGraphExecutionModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: graphExecutionModuleKeys.detail(params.id), + queryFn: () => + getClient() + .graphExecutionModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModulesQuery.ts new file mode 100644 index 0000000000..a78a2242ff --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/queries/useGraphExecutionModulesQuery.ts @@ -0,0 +1,178 @@ +/** + * List query hook for GraphExecutionModule + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +import { useQuery } from '@tanstack/react-query'; +import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; +import { getClient } from '../client'; +import { buildListSelectionArgs } from '../selection'; +import type { ListSelectionConfig } from '../selection'; +import { graphExecutionModuleKeys } from '../query-keys'; +import type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + GraphExecutionModuleSelect, + GraphExecutionModuleWithRelations, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const graphExecutionModulesQueryKey = graphExecutionModuleKeys.list; +/** + * Query hook for fetching GraphExecutionModule list + * + * @example + * ```tsx + * const { data, isLoading } = useGraphExecutionModulesQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useGraphExecutionModulesQuery< + S extends GraphExecutionModuleSelect, + TData = { + graphExecutionModules: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GraphExecutionModuleSelect>; + } & Omit< + UseQueryOptions< + { + graphExecutionModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useGraphExecutionModulesQuery( + params: { + selection: ListSelectionConfig< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: graphExecutionModuleKeys.list(args), + queryFn: () => getClient().graphExecutionModule.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Fetch GraphExecutionModule list without React hooks + * + * @example + * ```ts + * const data = await fetchGraphExecutionModulesQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchGraphExecutionModulesQuery< + S extends GraphExecutionModuleSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GraphExecutionModuleSelect>; +}): Promise<{ + graphExecutionModules: ConnectionResult>; +}>; +export async function fetchGraphExecutionModulesQuery(params: { + selection: ListSelectionConfig< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >; +}) { + const args = buildListSelectionArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >(params.selection); + return getClient().graphExecutionModule.findMany(args).unwrap(); +} +/** + * Prefetch GraphExecutionModule list for SSR or cache warming + * + * @example + * ```ts + * await prefetchGraphExecutionModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchGraphExecutionModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, GraphExecutionModuleSelect>; + } +): Promise; +export async function prefetchGraphExecutionModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: graphExecutionModuleKeys.list(args), + queryFn: () => getClient().graphExecutionModule.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/query-keys.ts b/sdk/constructive-react/src/modules/hooks/query-keys.ts index 9a9f527f9c..a0a26278e1 100644 --- a/sdk/constructive-react/src/modules/hooks/query-keys.ts +++ b/sdk/constructive-react/src/modules/hooks/query-keys.ts @@ -343,15 +343,6 @@ export const invitesModuleKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...invitesModuleKeys.details(), id] as const, } as const; -export const namespaceModuleKeys = { - /** All namespaceModule queries */ all: ['namespacemodule'] as const, - /** List query keys */ lists: () => [...namespaceModuleKeys.all, 'list'] as const, - /** List query key with variables */ list: (variables?: object) => - [...namespaceModuleKeys.lists(), variables] as const, - /** Detail query keys */ details: () => [...namespaceModuleKeys.all, 'detail'] as const, - /** Detail query key for specific item */ detail: (id: string | number) => - [...namespaceModuleKeys.details(), id] as const, -} as const; export const computeLogModuleKeys = { /** All computeLogModule queries */ all: ['computelogmodule'] as const, /** List query keys */ lists: () => [...computeLogModuleKeys.all, 'list'] as const, @@ -370,6 +361,15 @@ export const inferenceLogModuleKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...inferenceLogModuleKeys.details(), id] as const, } as const; +export const namespaceModuleKeys = { + /** All namespaceModule queries */ all: ['namespacemodule'] as const, + /** List query keys */ lists: () => [...namespaceModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...namespaceModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...namespaceModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...namespaceModuleKeys.details(), id] as const, +} as const; export const storageLogModuleKeys = { /** All storageLogModule queries */ all: ['storagelogmodule'] as const, /** List query keys */ lists: () => [...storageLogModuleKeys.all, 'list'] as const, @@ -388,6 +388,15 @@ export const transferLogModuleKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...transferLogModuleKeys.details(), id] as const, } as const; +export const functionDeploymentModuleKeys = { + /** All functionDeploymentModule queries */ all: ['functiondeploymentmodule'] as const, + /** List query keys */ lists: () => [...functionDeploymentModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...functionDeploymentModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...functionDeploymentModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...functionDeploymentModuleKeys.details(), id] as const, +} as const; export const plansModuleKeys = { /** All plansModule queries */ all: ['plansmodule'] as const, /** List query keys */ lists: () => [...plansModuleKeys.all, 'list'] as const, @@ -415,6 +424,15 @@ export const dbUsageModuleKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...dbUsageModuleKeys.details(), id] as const, } as const; +export const graphExecutionModuleKeys = { + /** All graphExecutionModule queries */ all: ['graphexecutionmodule'] as const, + /** List query keys */ lists: () => [...graphExecutionModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...graphExecutionModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...graphExecutionModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...graphExecutionModuleKeys.details(), id] as const, +} as const; export const hierarchyModuleKeys = { /** All hierarchyModule queries */ all: ['hierarchymodule'] as const, /** List query keys */ lists: () => [...hierarchyModuleKeys.all, 'list'] as const, @@ -602,14 +620,16 @@ export const queryKeys = { functionInvocationModule: functionInvocationModuleKeys, functionModule: functionModuleKeys, invitesModule: invitesModuleKeys, - namespaceModule: namespaceModuleKeys, computeLogModule: computeLogModuleKeys, inferenceLogModule: inferenceLogModuleKeys, + namespaceModule: namespaceModuleKeys, storageLogModule: storageLogModuleKeys, transferLogModule: transferLogModuleKeys, + functionDeploymentModule: functionDeploymentModuleKeys, plansModule: plansModuleKeys, billingProviderModule: billingProviderModuleKeys, dbUsageModule: dbUsageModuleKeys, + graphExecutionModule: graphExecutionModuleKeys, hierarchyModule: hierarchyModuleKeys, permissionsModule: permissionsModuleKeys, notificationsModule: notificationsModuleKeys, diff --git a/sdk/constructive-react/src/modules/orm/README.md b/sdk/constructive-react/src/modules/orm/README.md index 029e5d6ca7..495d56755f 100644 --- a/sdk/constructive-react/src/modules/orm/README.md +++ b/sdk/constructive-react/src/modules/orm/README.md @@ -57,14 +57,16 @@ const db = createClient({ | `functionInvocationModule` | findMany, findOne, create, update, delete | | `functionModule` | findMany, findOne, create, update, delete | | `invitesModule` | findMany, findOne, create, update, delete | -| `namespaceModule` | findMany, findOne, create, update, delete | | `computeLogModule` | findMany, findOne, create, update, delete | | `inferenceLogModule` | findMany, findOne, create, update, delete | +| `namespaceModule` | findMany, findOne, create, update, delete | | `storageLogModule` | findMany, findOne, create, update, delete | | `transferLogModule` | findMany, findOne, create, update, delete | +| `functionDeploymentModule` | findMany, findOne, create, update, delete | | `plansModule` | findMany, findOne, create, update, delete | | `billingProviderModule` | findMany, findOne, create, update, delete | | `dbUsageModule` | findMany, findOne, create, update, delete | +| `graphExecutionModule` | findMany, findOne, create, update, delete | | `hierarchyModule` | findMany, findOne, create, update, delete | | `permissionsModule` | findMany, findOne, create, update, delete | | `notificationsModule` | findMany, findOne, create, update, delete | @@ -1113,8 +1115,6 @@ CRUD operations for GraphModule records. | `prefix` | String | Yes | | `merkleStoreModuleId` | UUID | Yes | | `graphsTableId` | UUID | Yes | -| `executionsTableId` | UUID | Yes | -| `outputsTableId` | UUID | Yes | | `apiName` | String | Yes | | `privateApiName` | String | Yes | | `entityTableId` | UUID | Yes | @@ -1127,13 +1127,13 @@ CRUD operations for GraphModule records. ```typescript // List all graphModule records -const items = await db.graphModule.findMany({ select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const items = await db.graphModule.findMany({ select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Get one by id -const item = await db.graphModule.findOne({ id: '', select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const item = await db.graphModule.findOne({ id: '', select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Create -const created = await db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', executionsTableId: '', outputsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); +const created = await db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); // Update const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); @@ -1498,52 +1498,6 @@ const updated = await db.invitesModule.update({ where: { id: '' }, data: { const deleted = await db.invitesModule.delete({ where: { id: '' } }).execute(); ``` -### `db.namespaceModule` - -CRUD operations for NamespaceModule records. - -**Fields:** - -| Field | Type | Editable | -|-------|------|----------| -| `id` | UUID | No | -| `databaseId` | UUID | Yes | -| `schemaId` | UUID | Yes | -| `privateSchemaId` | UUID | Yes | -| `publicSchemaName` | String | Yes | -| `privateSchemaName` | String | Yes | -| `namespacesTableId` | UUID | Yes | -| `namespaceEventsTableId` | UUID | Yes | -| `namespacesTableName` | String | Yes | -| `namespaceEventsTableName` | String | Yes | -| `apiName` | String | Yes | -| `privateApiName` | String | Yes | -| `scope` | String | Yes | -| `prefix` | String | Yes | -| `entityTableId` | UUID | Yes | -| `policies` | JSON | Yes | -| `provisions` | JSON | Yes | -| `defaultPermissions` | String | Yes | - -**Operations:** - -```typescript -// List all namespaceModule records -const items = await db.namespaceModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); - -// Get one by id -const item = await db.namespaceModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); - -// Create -const created = await db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); - -// Update -const updated = await db.namespaceModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); - -// Delete -const deleted = await db.namespaceModule.delete({ where: { id: '' } }).execute(); -``` - ### `db.computeLogModule` CRUD operations for ComputeLogModule records. @@ -1638,6 +1592,53 @@ const updated = await db.inferenceLogModule.update({ where: { id: '' }, da const deleted = await db.inferenceLogModule.delete({ where: { id: '' } }).execute(); ``` +### `db.namespaceModule` + +CRUD operations for NamespaceModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `namespacesTableId` | UUID | Yes | +| `namespaceEventsTableId` | UUID | Yes | +| `namespacesTableName` | String | Yes | +| `namespaceEventsTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `entityTableId` | UUID | Yes | +| `platformNamespacesTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | + +**Operations:** + +```typescript +// List all namespaceModule records +const items = await db.namespaceModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Get one by id +const item = await db.namespaceModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Create +const created = await db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', platformNamespacesTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.namespaceModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.namespaceModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.storageLogModule` CRUD operations for StorageLogModule records. @@ -1732,6 +1733,54 @@ const updated = await db.transferLogModule.update({ where: { id: '' }, dat const deleted = await db.transferLogModule.delete({ where: { id: '' } }).execute(); ``` +### `db.functionDeploymentModule` + +CRUD operations for FunctionDeploymentModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `deploymentsTableId` | UUID | Yes | +| `deploymentEventsTableId` | UUID | Yes | +| `deploymentsTableName` | String | Yes | +| `deploymentEventsTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `entityTableId` | UUID | Yes | +| `functionModuleId` | UUID | Yes | +| `namespaceModuleId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | + +**Operations:** + +```typescript +// List all functionDeploymentModule records +const items = await db.functionDeploymentModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Get one by id +const item = await db.functionDeploymentModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Create +const created = await db.functionDeploymentModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', deploymentsTableId: '', deploymentEventsTableId: '', deploymentsTableName: '', deploymentEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', functionModuleId: '', namespaceModuleId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeploymentModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeploymentModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.plansModule` CRUD operations for PlansModule records. @@ -1881,6 +1930,56 @@ const updated = await db.dbUsageModule.update({ where: { id: '' }, data: { const deleted = await db.dbUsageModule.delete({ where: { id: '' } }).execute(); ``` +### `db.graphExecutionModule` + +CRUD operations for GraphExecutionModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `graphModuleId` | UUID | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `executionsTableId` | UUID | Yes | +| `outputsTableId` | UUID | Yes | +| `nodeStatesTableId` | UUID | Yes | +| `executionsTableName` | String | Yes | +| `outputsTableName` | String | Yes | +| `nodeStatesTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `entityTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all graphExecutionModule records +const items = await db.graphExecutionModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.graphExecutionModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); + +// Create +const created = await db.graphExecutionModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', graphModuleId: '', scope: '', prefix: '', executionsTableId: '', outputsTableId: '', nodeStatesTableId: '', executionsTableName: '', outputsTableName: '', nodeStatesTableName: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.graphExecutionModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.graphExecutionModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.hierarchyModule` CRUD operations for HierarchyModule records. diff --git a/sdk/constructive-react/src/modules/orm/index.ts b/sdk/constructive-react/src/modules/orm/index.ts index e8c151cfdb..7c5a882c52 100644 --- a/sdk/constructive-react/src/modules/orm/index.ts +++ b/sdk/constructive-react/src/modules/orm/index.ts @@ -41,14 +41,16 @@ import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; import { FunctionModuleModel } from './models/functionModule'; import { InvitesModuleModel } from './models/invitesModule'; -import { NamespaceModuleModel } from './models/namespaceModule'; import { ComputeLogModuleModel } from './models/computeLogModule'; import { InferenceLogModuleModel } from './models/inferenceLogModule'; +import { NamespaceModuleModel } from './models/namespaceModule'; import { StorageLogModuleModel } from './models/storageLogModule'; import { TransferLogModuleModel } from './models/transferLogModule'; +import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule'; import { PlansModuleModel } from './models/plansModule'; import { BillingProviderModuleModel } from './models/billingProviderModule'; import { DbUsageModuleModel } from './models/dbUsageModule'; +import { GraphExecutionModuleModel } from './models/graphExecutionModule'; import { HierarchyModuleModel } from './models/hierarchyModule'; import { PermissionsModuleModel } from './models/permissionsModule'; import { NotificationsModuleModel } from './models/notificationsModule'; @@ -133,14 +135,16 @@ export function createClient(config: OrmClientConfig) { functionInvocationModule: new FunctionInvocationModuleModel(client), functionModule: new FunctionModuleModel(client), invitesModule: new InvitesModuleModel(client), - namespaceModule: new NamespaceModuleModel(client), computeLogModule: new ComputeLogModuleModel(client), inferenceLogModule: new InferenceLogModuleModel(client), + namespaceModule: new NamespaceModuleModel(client), storageLogModule: new StorageLogModuleModel(client), transferLogModule: new TransferLogModuleModel(client), + functionDeploymentModule: new FunctionDeploymentModuleModel(client), plansModule: new PlansModuleModel(client), billingProviderModule: new BillingProviderModuleModel(client), dbUsageModule: new DbUsageModuleModel(client), + graphExecutionModule: new GraphExecutionModuleModel(client), hierarchyModule: new HierarchyModuleModel(client), permissionsModule: new PermissionsModuleModel(client), notificationsModule: new NotificationsModuleModel(client), diff --git a/sdk/constructive-react/src/modules/orm/input-types.ts b/sdk/constructive-react/src/modules/orm/input-types.ts index 62271cf277..ddd8bf6a34 100644 --- a/sdk/constructive-react/src/modules/orm/input-types.ts +++ b/sdk/constructive-react/src/modules/orm/input-types.ts @@ -635,8 +635,6 @@ export interface GraphModule { prefix?: string | null; merkleStoreModuleId?: string | null; graphsTableId?: string | null; - executionsTableId?: string | null; - outputsTableId?: string | null; apiName?: string | null; privateApiName?: string | null; entityTableId?: string | null; @@ -808,26 +806,6 @@ export interface InvitesModule { apiName?: string | null; privateApiName?: string | null; } -export interface NamespaceModule { - id: string; - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - namespacesTableId?: string | null; - namespaceEventsTableId?: string | null; - namespacesTableName?: string | null; - namespaceEventsTableName?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; -} export interface ComputeLogModule { id: string; databaseId?: string | null; @@ -870,6 +848,27 @@ export interface InferenceLogModule { apiName?: string | null; privateApiName?: string | null; } +export interface NamespaceModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + namespacesTableId?: string | null; + namespaceEventsTableId?: string | null; + namespacesTableName?: string | null; + namespaceEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + platformNamespacesTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} export interface StorageLogModule { id: string; databaseId?: string | null; @@ -912,6 +911,28 @@ export interface TransferLogModule { apiName?: string | null; privateApiName?: string | null; } +export interface FunctionDeploymentModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + deploymentsTableId?: string | null; + deploymentEventsTableId?: string | null; + deploymentsTableName?: string | null; + deploymentEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + functionModuleId?: string | null; + namespaceModuleId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} export interface PlansModule { id: string; databaseId?: string | null; @@ -983,6 +1004,30 @@ export interface DbUsageModule { apiName?: string | null; privateApiName?: string | null; } +export interface GraphExecutionModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + graphModuleId?: string | null; + scope?: string | null; + prefix?: string | null; + executionsTableId?: string | null; + outputsTableId?: string | null; + nodeStatesTableId?: string | null; + executionsTableName?: string | null; + outputsTableName?: string | null; + nodeStatesTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; + createdAt?: string | null; +} export interface HierarchyModule { id: string; databaseId?: string | null; @@ -1800,14 +1845,21 @@ export interface WebauthnAuthModuleRelations {} export interface FunctionInvocationModuleRelations {} export interface FunctionModuleRelations {} export interface InvitesModuleRelations {} -export interface NamespaceModuleRelations {} export interface ComputeLogModuleRelations {} export interface InferenceLogModuleRelations {} +export interface NamespaceModuleRelations {} export interface StorageLogModuleRelations {} export interface TransferLogModuleRelations {} +export interface FunctionDeploymentModuleRelations { + functionModule?: FunctionModule | null; + namespaceModule?: NamespaceModule | null; +} export interface PlansModuleRelations {} export interface BillingProviderModuleRelations {} export interface DbUsageModuleRelations {} +export interface GraphExecutionModuleRelations { + graphModule?: GraphModule | null; +} export interface HierarchyModuleRelations {} export interface PermissionsModuleRelations {} export interface NotificationsModuleRelations {} @@ -1873,15 +1925,19 @@ export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; -export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; +export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; export type StorageLogModuleWithRelations = StorageLogModule & StorageLogModuleRelations; export type TransferLogModuleWithRelations = TransferLogModule & TransferLogModuleRelations; +export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & + FunctionDeploymentModuleRelations; export type PlansModuleWithRelations = PlansModule & PlansModuleRelations; export type BillingProviderModuleWithRelations = BillingProviderModule & BillingProviderModuleRelations; export type DbUsageModuleWithRelations = DbUsageModule & DbUsageModuleRelations; +export type GraphExecutionModuleWithRelations = GraphExecutionModule & + GraphExecutionModuleRelations; export type HierarchyModuleWithRelations = HierarchyModule & HierarchyModuleRelations; export type PermissionsModuleWithRelations = PermissionsModule & PermissionsModuleRelations; export type NotificationsModuleWithRelations = NotificationsModule & NotificationsModuleRelations; @@ -2252,8 +2308,6 @@ export type GraphModuleSelect = { prefix?: boolean; merkleStoreModuleId?: boolean; graphsTableId?: boolean; - executionsTableId?: boolean; - outputsTableId?: boolean; apiName?: boolean; privateApiName?: boolean; entityTableId?: boolean; @@ -2413,26 +2467,6 @@ export type InvitesModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; -export type NamespaceModuleSelect = { - id?: boolean; - databaseId?: boolean; - schemaId?: boolean; - privateSchemaId?: boolean; - publicSchemaName?: boolean; - privateSchemaName?: boolean; - namespacesTableId?: boolean; - namespaceEventsTableId?: boolean; - namespacesTableName?: boolean; - namespaceEventsTableName?: boolean; - apiName?: boolean; - privateApiName?: boolean; - scope?: boolean; - prefix?: boolean; - entityTableId?: boolean; - policies?: boolean; - provisions?: boolean; - defaultPermissions?: boolean; -}; export type ComputeLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2475,6 +2509,27 @@ export type InferenceLogModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type NamespaceModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + namespacesTableId?: boolean; + namespaceEventsTableId?: boolean; + namespacesTableName?: boolean; + namespaceEventsTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + scope?: boolean; + prefix?: boolean; + entityTableId?: boolean; + platformNamespacesTableId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; +}; export type StorageLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2517,6 +2572,34 @@ export type TransferLogModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type FunctionDeploymentModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + deploymentsTableId?: boolean; + deploymentEventsTableId?: boolean; + deploymentsTableName?: boolean; + deploymentEventsTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + scope?: boolean; + prefix?: boolean; + entityTableId?: boolean; + functionModuleId?: boolean; + namespaceModuleId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; + functionModule?: { + select: FunctionModuleSelect; + }; + namespaceModule?: { + select: NamespaceModuleSelect; + }; +}; export type PlansModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2588,6 +2671,33 @@ export type DbUsageModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type GraphExecutionModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + graphModuleId?: boolean; + scope?: boolean; + prefix?: boolean; + executionsTableId?: boolean; + outputsTableId?: boolean; + nodeStatesTableId?: boolean; + executionsTableName?: boolean; + outputsTableName?: boolean; + nodeStatesTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + entityTableId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; + createdAt?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; +}; export type HierarchyModuleSelect = { id?: boolean; databaseId?: boolean; @@ -3796,10 +3906,6 @@ export interface GraphModuleFilter { merkleStoreModuleId?: UUIDFilter; /** Filter by the object’s `graphsTableId` field. */ graphsTableId?: UUIDFilter; - /** Filter by the object’s `executionsTableId` field. */ - executionsTableId?: UUIDFilter; - /** Filter by the object’s `outputsTableId` field. */ - outputsTableId?: UUIDFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ @@ -4151,50 +4257,6 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } -export interface NamespaceModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `schemaId` field. */ - schemaId?: UUIDFilter; - /** Filter by the object’s `privateSchemaId` field. */ - privateSchemaId?: UUIDFilter; - /** Filter by the object’s `publicSchemaName` field. */ - publicSchemaName?: StringFilter; - /** Filter by the object’s `privateSchemaName` field. */ - privateSchemaName?: StringFilter; - /** Filter by the object’s `namespacesTableId` field. */ - namespacesTableId?: UUIDFilter; - /** Filter by the object’s `namespaceEventsTableId` field. */ - namespaceEventsTableId?: UUIDFilter; - /** Filter by the object’s `namespacesTableName` field. */ - namespacesTableName?: StringFilter; - /** Filter by the object’s `namespaceEventsTableName` field. */ - namespaceEventsTableName?: StringFilter; - /** Filter by the object’s `apiName` field. */ - apiName?: StringFilter; - /** Filter by the object’s `privateApiName` field. */ - privateApiName?: StringFilter; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Filter by the object’s `entityTableId` field. */ - entityTableId?: UUIDFilter; - /** Filter by the object’s `policies` field. */ - policies?: JSONFilter; - /** Filter by the object’s `provisions` field. */ - provisions?: JSONFilter; - /** Filter by the object’s `defaultPermissions` field. */ - defaultPermissions?: StringListFilter; - /** Checks for all expressions in this list. */ - and?: NamespaceModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: NamespaceModuleFilter[]; - /** Negates the expression. */ - not?: NamespaceModuleFilter; -} export interface ComputeLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -4287,7 +4349,7 @@ export interface InferenceLogModuleFilter { /** Negates the expression. */ not?: InferenceLogModuleFilter; } -export interface StorageLogModuleFilter { +export interface NamespaceModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -4300,40 +4362,86 @@ export interface StorageLogModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `storageLogTableId` field. */ - storageLogTableId?: UUIDFilter; - /** Filter by the object’s `storageLogTableName` field. */ - storageLogTableName?: StringFilter; - /** Filter by the object’s `usageDailyTableId` field. */ - usageDailyTableId?: UUIDFilter; - /** Filter by the object’s `usageDailyTableName` field. */ - usageDailyTableName?: StringFilter; - /** Filter by the object’s `interval` field. */ - interval?: StringFilter; - /** Filter by the object’s `retention` field. */ - retention?: StringFilter; - /** Filter by the object’s `premake` field. */ - premake?: IntFilter; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `actorFkTableId` field. */ - actorFkTableId?: UUIDFilter; - /** Filter by the object’s `entityFkTableId` field. */ - entityFkTableId?: UUIDFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; + /** Filter by the object’s `namespacesTableId` field. */ + namespacesTableId?: UUIDFilter; + /** Filter by the object’s `namespaceEventsTableId` field. */ + namespaceEventsTableId?: UUIDFilter; + /** Filter by the object’s `namespacesTableName` field. */ + namespacesTableName?: StringFilter; + /** Filter by the object’s `namespaceEventsTableName` field. */ + namespaceEventsTableName?: StringFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ privateApiName?: StringFilter; - /** Checks for all expressions in this list. */ - and?: StorageLogModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: StorageLogModuleFilter[]; - /** Negates the expression. */ - not?: StorageLogModuleFilter; -} -export interface TransferLogModuleFilter { + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `platformNamespacesTableId` field. */ + platformNamespacesTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: NamespaceModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: NamespaceModuleFilter[]; + /** Negates the expression. */ + not?: NamespaceModuleFilter; +} +export interface StorageLogModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `storageLogTableId` field. */ + storageLogTableId?: UUIDFilter; + /** Filter by the object’s `storageLogTableName` field. */ + storageLogTableName?: StringFilter; + /** Filter by the object’s `usageDailyTableId` field. */ + usageDailyTableId?: UUIDFilter; + /** Filter by the object’s `usageDailyTableName` field. */ + usageDailyTableName?: StringFilter; + /** Filter by the object’s `interval` field. */ + interval?: StringFilter; + /** Filter by the object’s `retention` field. */ + retention?: StringFilter; + /** Filter by the object’s `premake` field. */ + premake?: IntFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `actorFkTableId` field. */ + actorFkTableId?: UUIDFilter; + /** Filter by the object’s `entityFkTableId` field. */ + entityFkTableId?: UUIDFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: StorageLogModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: StorageLogModuleFilter[]; + /** Negates the expression. */ + not?: StorageLogModuleFilter; +} +export interface TransferLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -4379,6 +4487,62 @@ export interface TransferLogModuleFilter { /** Negates the expression. */ not?: TransferLogModuleFilter; } +export interface FunctionDeploymentModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `deploymentsTableId` field. */ + deploymentsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentEventsTableId` field. */ + deploymentEventsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentsTableName` field. */ + deploymentsTableName?: StringFilter; + /** Filter by the object’s `deploymentEventsTableName` field. */ + deploymentEventsTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `functionModuleId` field. */ + functionModuleId?: UUIDFilter; + /** Filter by the object’s `namespaceModuleId` field. */ + namespaceModuleId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentModuleFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentModuleFilter; + /** Filter by the object’s `functionModule` relation. */ + functionModule?: FunctionModuleFilter; + /** A related `functionModule` exists. */ + functionModuleExists?: boolean; + /** Filter by the object’s `namespaceModule` relation. */ + namespaceModule?: NamespaceModuleFilter; + /** A related `namespaceModule` exists. */ + namespaceModuleExists?: boolean; +} export interface PlansModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -4533,6 +4697,60 @@ export interface DbUsageModuleFilter { /** Negates the expression. */ not?: DbUsageModuleFilter; } +export interface GraphExecutionModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `graphModuleId` field. */ + graphModuleId?: UUIDFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `executionsTableId` field. */ + executionsTableId?: UUIDFilter; + /** Filter by the object’s `outputsTableId` field. */ + outputsTableId?: UUIDFilter; + /** Filter by the object’s `nodeStatesTableId` field. */ + nodeStatesTableId?: UUIDFilter; + /** Filter by the object’s `executionsTableName` field. */ + executionsTableName?: StringFilter; + /** Filter by the object’s `outputsTableName` field. */ + outputsTableName?: StringFilter; + /** Filter by the object’s `nodeStatesTableName` field. */ + nodeStatesTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: GraphExecutionModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: GraphExecutionModuleFilter[]; + /** Negates the expression. */ + not?: GraphExecutionModuleFilter; + /** Filter by the object’s `graphModule` relation. */ + graphModule?: GraphModuleFilter; +} export interface HierarchyModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -6090,10 +6308,6 @@ export type GraphModuleOrderBy = | 'MERKLE_STORE_MODULE_ID_DESC' | 'GRAPHS_TABLE_ID_ASC' | 'GRAPHS_TABLE_ID_DESC' - | 'EXECUTIONS_TABLE_ID_ASC' - | 'EXECUTIONS_TABLE_ID_DESC' - | 'OUTPUTS_TABLE_ID_ASC' - | 'OUTPUTS_TABLE_ID_DESC' | 'API_NAME_ASC' | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' @@ -6404,46 +6618,6 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; -export type NamespaceModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'SCHEMA_ID_ASC' - | 'SCHEMA_ID_DESC' - | 'PRIVATE_SCHEMA_ID_ASC' - | 'PRIVATE_SCHEMA_ID_DESC' - | 'PUBLIC_SCHEMA_NAME_ASC' - | 'PUBLIC_SCHEMA_NAME_DESC' - | 'PRIVATE_SCHEMA_NAME_ASC' - | 'PRIVATE_SCHEMA_NAME_DESC' - | 'NAMESPACES_TABLE_ID_ASC' - | 'NAMESPACES_TABLE_ID_DESC' - | 'NAMESPACE_EVENTS_TABLE_ID_ASC' - | 'NAMESPACE_EVENTS_TABLE_ID_DESC' - | 'NAMESPACES_TABLE_NAME_ASC' - | 'NAMESPACES_TABLE_NAME_DESC' - | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' - | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' - | 'API_NAME_ASC' - | 'API_NAME_DESC' - | 'PRIVATE_API_NAME_ASC' - | 'PRIVATE_API_NAME_DESC' - | 'SCOPE_ASC' - | 'SCOPE_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC' - | 'ENTITY_TABLE_ID_ASC' - | 'ENTITY_TABLE_ID_DESC' - | 'POLICIES_ASC' - | 'POLICIES_DESC' - | 'PROVISIONS_ASC' - | 'PROVISIONS_DESC' - | 'DEFAULT_PERMISSIONS_ASC' - | 'DEFAULT_PERMISSIONS_DESC'; export type ComputeLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6528,6 +6702,48 @@ export type InferenceLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type NamespaceModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'PLATFORM_NAMESPACES_TABLE_ID_ASC' + | 'PLATFORM_NAMESPACES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; export type StorageLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6612,6 +6828,50 @@ export type TransferLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type FunctionDeploymentModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; export type PlansModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6754,6 +7014,54 @@ export type DbUsageModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type GraphExecutionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; export type HierarchyModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -8503,8 +8811,6 @@ export interface CreateGraphModuleInput { prefix?: string; merkleStoreModuleId: string; graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; apiName?: string; privateApiName?: string; entityTableId?: string; @@ -8523,8 +8829,6 @@ export interface GraphModulePatch { prefix?: string | null; merkleStoreModuleId?: string | null; graphsTableId?: string | null; - executionsTableId?: string | null; - outputsTableId?: string | null; apiName?: string | null; privateApiName?: string | null; entityTableId?: string | null; @@ -8913,56 +9217,6 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } -export interface CreateNamespaceModuleInput { - clientMutationId?: string; - namespaceModule: { - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - defaultPermissions?: string[]; - }; -} -export interface NamespaceModulePatch { - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - namespacesTableId?: string | null; - namespaceEventsTableId?: string | null; - namespacesTableName?: string | null; - namespaceEventsTableName?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; -} -export interface UpdateNamespaceModuleInput { - clientMutationId?: string; - id: string; - namespaceModulePatch: NamespaceModulePatch; -} -export interface DeleteNamespaceModuleInput { - clientMutationId?: string; - id: string; -} export interface CreateComputeLogModuleInput { clientMutationId?: string; computeLogModule: { @@ -9067,6 +9321,58 @@ export interface DeleteInferenceLogModuleInput { clientMutationId?: string; id: string; } +export interface CreateNamespaceModuleInput { + clientMutationId?: string; + namespaceModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface NamespaceModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + namespacesTableId?: string | null; + namespaceEventsTableId?: string | null; + namespacesTableName?: string | null; + namespaceEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + platformNamespacesTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} +export interface UpdateNamespaceModuleInput { + clientMutationId?: string; + id: string; + namespaceModulePatch: NamespaceModulePatch; +} +export interface DeleteNamespaceModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateStorageLogModuleInput { clientMutationId?: string; storageLogModule: { @@ -9171,6 +9477,60 @@ export interface DeleteTransferLogModuleInput { clientMutationId?: string; id: string; } +export interface CreateFunctionDeploymentModuleInput { + clientMutationId?: string; + functionDeploymentModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface FunctionDeploymentModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + deploymentsTableId?: string | null; + deploymentEventsTableId?: string | null; + deploymentsTableName?: string | null; + deploymentEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + functionModuleId?: string | null; + namespaceModuleId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} +export interface UpdateFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; +} +export interface DeleteFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; +} export interface CreatePlansModuleInput { clientMutationId?: string; plansModule: { @@ -9330,16 +9690,72 @@ export interface DbUsageModulePatch { premake?: number | null; scope?: string | null; prefix?: string | null; - defaultPermissions?: string[] | null; + defaultPermissions?: string[] | null; + apiName?: string | null; + privateApiName?: string | null; +} +export interface UpdateDbUsageModuleInput { + clientMutationId?: string; + id: string; + dbUsageModulePatch: DbUsageModulePatch; +} +export interface DeleteDbUsageModuleInput { + clientMutationId?: string; + id: string; +} +export interface CreateGraphExecutionModuleInput { + clientMutationId?: string; + graphExecutionModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface GraphExecutionModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + graphModuleId?: string | null; + scope?: string | null; + prefix?: string | null; + executionsTableId?: string | null; + outputsTableId?: string | null; + nodeStatesTableId?: string | null; + executionsTableName?: string | null; + outputsTableName?: string | null; + nodeStatesTableName?: string | null; apiName?: string | null; privateApiName?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; } -export interface UpdateDbUsageModuleInput { +export interface UpdateGraphExecutionModuleInput { clientMutationId?: string; id: string; - dbUsageModulePatch: DbUsageModulePatch; + graphExecutionModulePatch: GraphExecutionModulePatch; } -export interface DeleteDbUsageModuleInput { +export interface DeleteGraphExecutionModuleInput { clientMutationId?: string; id: string; } @@ -10963,8 +11379,6 @@ export interface GraphModuleInput { prefix?: string; merkleStoreModuleId: string; graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; apiName?: string; privateApiName?: string; entityTableId?: string; @@ -11138,27 +11552,6 @@ export interface InvitesModuleInput { apiName?: string; privateApiName?: string; } -/** An input for mutations affecting `NamespaceModule` */ -export interface NamespaceModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - defaultPermissions?: string[]; -} /** An input for mutations affecting `ComputeLogModule` */ export interface ComputeLogModuleInput { id?: string; @@ -11203,6 +11596,28 @@ export interface InferenceLogModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `NamespaceModule` */ +export interface NamespaceModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; +} /** An input for mutations affecting `StorageLogModule` */ export interface StorageLogModuleInput { id?: string; @@ -11247,6 +11662,29 @@ export interface TransferLogModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `FunctionDeploymentModule` */ +export interface FunctionDeploymentModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; +} /** An input for mutations affecting `PlansModule` */ export interface PlansModuleInput { id?: string; @@ -11321,6 +11759,31 @@ export interface DbUsageModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `GraphExecutionModule` */ +export interface GraphExecutionModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + createdAt?: string; +} /** An input for mutations affecting `HierarchyModule` */ export interface HierarchyModuleInput { id?: string; @@ -12226,10 +12689,6 @@ export interface GraphModuleFilter { merkleStoreModuleId?: UUIDFilter; /** Filter by the object’s `graphsTableId` field. */ graphsTableId?: UUIDFilter; - /** Filter by the object’s `executionsTableId` field. */ - executionsTableId?: UUIDFilter; - /** Filter by the object’s `outputsTableId` field. */ - outputsTableId?: UUIDFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ @@ -14239,51 +14698,6 @@ export type DeleteInvitesModulePayloadSelect = { select: InvitesModuleEdgeSelect; }; }; -export interface CreateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was created by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type CreateNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; -export interface UpdateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was updated by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type UpdateNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; -export interface DeleteNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was deleted by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type DeleteNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ @@ -14374,6 +14788,51 @@ export type DeleteInferenceLogModulePayloadSelect = { select: InferenceLogModuleEdgeSelect; }; }; +export interface CreateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was created by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type CreateNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; +export interface UpdateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was updated by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type UpdateNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; +export interface DeleteNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was deleted by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type DeleteNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; export interface CreateStorageLogModulePayload { clientMutationId?: string | null; /** The `StorageLogModule` that was created by this mutation. */ @@ -14464,6 +14923,51 @@ export type DeleteTransferLogModulePayloadSelect = { select: TransferLogModuleEdgeSelect; }; }; +export interface CreateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was created by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type CreateFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was updated by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type UpdateFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was deleted by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type DeleteFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; export interface CreatePlansModulePayload { clientMutationId?: string | null; /** The `PlansModule` that was created by this mutation. */ @@ -14599,6 +15103,51 @@ export type DeleteDbUsageModulePayloadSelect = { select: DbUsageModuleEdgeSelect; }; }; +export interface CreateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was created by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type CreateGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; +export interface UpdateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was updated by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type UpdateGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; +export interface DeleteGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was deleted by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type DeleteGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; export interface CreateHierarchyModulePayload { clientMutationId?: string | null; /** The `HierarchyModule` that was created by this mutation. */ @@ -15636,18 +16185,6 @@ export type InvitesModuleEdgeSelect = { select: InvitesModuleSelect; }; }; -/** A `NamespaceModule` edge in the connection. */ -export interface NamespaceModuleEdge { - cursor?: string | null; - /** The `NamespaceModule` at the end of the edge. */ - node?: NamespaceModule | null; -} -export type NamespaceModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: NamespaceModuleSelect; - }; -}; /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; @@ -15672,6 +16209,18 @@ export type InferenceLogModuleEdgeSelect = { select: InferenceLogModuleSelect; }; }; +/** A `NamespaceModule` edge in the connection. */ +export interface NamespaceModuleEdge { + cursor?: string | null; + /** The `NamespaceModule` at the end of the edge. */ + node?: NamespaceModule | null; +} +export type NamespaceModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: NamespaceModuleSelect; + }; +}; /** A `StorageLogModule` edge in the connection. */ export interface StorageLogModuleEdge { cursor?: string | null; @@ -15696,6 +16245,18 @@ export type TransferLogModuleEdgeSelect = { select: TransferLogModuleSelect; }; }; +/** A `FunctionDeploymentModule` edge in the connection. */ +export interface FunctionDeploymentModuleEdge { + cursor?: string | null; + /** The `FunctionDeploymentModule` at the end of the edge. */ + node?: FunctionDeploymentModule | null; +} +export type FunctionDeploymentModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentModuleSelect; + }; +}; /** A `PlansModule` edge in the connection. */ export interface PlansModuleEdge { cursor?: string | null; @@ -15732,6 +16293,18 @@ export type DbUsageModuleEdgeSelect = { select: DbUsageModuleSelect; }; }; +/** A `GraphExecutionModule` edge in the connection. */ +export interface GraphExecutionModuleEdge { + cursor?: string | null; + /** The `GraphExecutionModule` at the end of the edge. */ + node?: GraphExecutionModule | null; +} +export type GraphExecutionModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: GraphExecutionModuleSelect; + }; +}; /** A `HierarchyModule` edge in the connection. */ export interface HierarchyModuleEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/modules/orm/models/agentModule.ts b/sdk/constructive-react/src/modules/orm/models/agentModule.ts index ad2ea4a388..ec52583704 100644 --- a/sdk/constructive-react/src/modules/orm/models/agentModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/agentModule.ts @@ -196,7 +196,8 @@ export class AgentModuleModel { 'UpdateAgentModuleInput', 'id', 'agentModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/billingModule.ts b/sdk/constructive-react/src/modules/orm/models/billingModule.ts index 712d75ae7b..432eb970f3 100644 --- a/sdk/constructive-react/src/modules/orm/models/billingModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/billingModule.ts @@ -196,7 +196,8 @@ export class BillingModuleModel { 'UpdateBillingModuleInput', 'id', 'billingModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts b/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts index a7e3345201..16a8a68460 100644 --- a/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/billingProviderModule.ts @@ -198,7 +198,8 @@ export class BillingProviderModuleModel { 'UpdateBillingProviderModuleInput', 'id', 'billingProviderModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/blueprint.ts b/sdk/constructive-react/src/modules/orm/models/blueprint.ts index 239c50eb99..48e4dc3d89 100644 --- a/sdk/constructive-react/src/modules/orm/models/blueprint.ts +++ b/sdk/constructive-react/src/modules/orm/models/blueprint.ts @@ -196,7 +196,8 @@ export class BlueprintModel { 'UpdateBlueprintInput', 'id', 'blueprintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts b/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts index dad6db0bff..ee6a157760 100644 --- a/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts +++ b/sdk/constructive-react/src/modules/orm/models/blueprintConstruction.ts @@ -198,7 +198,8 @@ export class BlueprintConstructionModel { 'UpdateBlueprintConstructionInput', 'id', 'blueprintConstructionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts b/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts index 1f957cdeda..486ef1c8e2 100644 --- a/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts +++ b/sdk/constructive-react/src/modules/orm/models/blueprintTemplate.ts @@ -196,7 +196,8 @@ export class BlueprintTemplateModel { 'UpdateBlueprintTemplateInput', 'id', 'blueprintTemplatePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts b/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts index 2e36321ef1..3451b45608 100644 --- a/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/computeLogModule.ts @@ -196,7 +196,8 @@ export class ComputeLogModuleModel { 'UpdateComputeLogModuleInput', 'id', 'computeLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/configSecretsModule.ts b/sdk/constructive-react/src/modules/orm/models/configSecretsModule.ts index 5d482c9ccf..59a6edd5cd 100644 --- a/sdk/constructive-react/src/modules/orm/models/configSecretsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/configSecretsModule.ts @@ -196,7 +196,8 @@ export class ConfigSecretsModuleModel { 'UpdateConfigSecretsModuleInput', 'id', 'configSecretsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/configSecretsOrgModule.ts b/sdk/constructive-react/src/modules/orm/models/configSecretsOrgModule.ts index ef53f2d5cd..08969c552d 100644 --- a/sdk/constructive-react/src/modules/orm/models/configSecretsOrgModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/configSecretsOrgModule.ts @@ -198,7 +198,8 @@ export class ConfigSecretsOrgModuleModel { 'UpdateConfigSecretsOrgModuleInput', 'id', 'configSecretsOrgModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts b/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts index b1b8f0cacb..bd97e5bf01 100644 --- a/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/configSecretsUserModule.ts @@ -198,7 +198,8 @@ export class ConfigSecretsUserModuleModel { 'UpdateConfigSecretsUserModuleInput', 'id', 'configSecretsUserModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts b/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts index 226307b4b8..64b1dc5c4c 100644 --- a/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/connectedAccountsModule.ts @@ -198,7 +198,8 @@ export class ConnectedAccountsModuleModel { 'UpdateConnectedAccountsModuleInput', 'id', 'connectedAccountsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts b/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts index 6618ae4e90..c7797726bf 100644 --- a/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/cryptoAddressesModule.ts @@ -198,7 +198,8 @@ export class CryptoAddressesModuleModel { 'UpdateCryptoAddressesModuleInput', 'id', 'cryptoAddressesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts index c90349b9d4..d975e75267 100644 --- a/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/cryptoAuthModule.ts @@ -196,7 +196,8 @@ export class CryptoAuthModuleModel { 'UpdateCryptoAuthModuleInput', 'id', 'cryptoAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts b/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts index 4cf322de69..1d9457eed6 100644 --- a/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/databaseProvisionModule.ts @@ -198,7 +198,8 @@ export class DatabaseProvisionModuleModel { 'UpdateDatabaseProvisionModuleInput', 'id', 'databaseProvisionModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts b/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts index 69aa58b980..45fc6b2a64 100644 --- a/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/dbUsageModule.ts @@ -196,7 +196,8 @@ export class DbUsageModuleModel { 'UpdateDbUsageModuleInput', 'id', 'dbUsageModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts b/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts index 9553db8ed7..957d0061e4 100644 --- a/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/defaultIdsModule.ts @@ -196,7 +196,8 @@ export class DefaultIdsModuleModel { 'UpdateDefaultIdsModuleInput', 'id', 'defaultIdsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts b/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts index 881f2ffdb7..bdc83099a2 100644 --- a/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts +++ b/sdk/constructive-react/src/modules/orm/models/denormalizedTableField.ts @@ -198,7 +198,8 @@ export class DenormalizedTableFieldModel { 'UpdateDenormalizedTableFieldInput', 'id', 'denormalizedTableFieldPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/devicesModule.ts b/sdk/constructive-react/src/modules/orm/models/devicesModule.ts index 8c9a7e06ee..8dc6cf5282 100644 --- a/sdk/constructive-react/src/modules/orm/models/devicesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/devicesModule.ts @@ -196,7 +196,8 @@ export class DevicesModuleModel { 'UpdateDevicesModuleInput', 'id', 'devicesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/emailsModule.ts b/sdk/constructive-react/src/modules/orm/models/emailsModule.ts index e95985b852..f3a2297a8a 100644 --- a/sdk/constructive-react/src/modules/orm/models/emailsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/emailsModule.ts @@ -196,7 +196,8 @@ export class EmailsModuleModel { 'UpdateEmailsModuleInput', 'id', 'emailsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts b/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts index 93373a3dd4..c8e87d8f9c 100644 --- a/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts +++ b/sdk/constructive-react/src/modules/orm/models/entityTypeProvision.ts @@ -196,7 +196,8 @@ export class EntityTypeProvisionModel { 'UpdateEntityTypeProvisionInput', 'id', 'entityTypeProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/eventsModule.ts b/sdk/constructive-react/src/modules/orm/models/eventsModule.ts index fb45e27ce3..0f07d39979 100644 --- a/sdk/constructive-react/src/modules/orm/models/eventsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/eventsModule.ts @@ -196,7 +196,8 @@ export class EventsModuleModel { 'UpdateEventsModuleInput', 'id', 'eventsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/functionDeploymentModule.ts b/sdk/constructive-react/src/modules/orm/models/functionDeploymentModule.ts new file mode 100644 index 0000000000..afe50267f8 --- /dev/null +++ b/sdk/constructive-react/src/modules/orm/models/functionDeploymentModule.ts @@ -0,0 +1,247 @@ +/** + * FunctionDeploymentModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentModule, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, + CreateFunctionDeploymentModuleInput, + UpdateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', + document, + variables, + transform: (data: { + functionDeploymentModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', + document, + variables, + transform: (data: { + functionDeploymentModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentModule', + 'createFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.data, + 'CreateFunctionDeploymentModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'createFunctionDeploymentModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentModule', + 'updateFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentModuleInput', + 'id', + 'functionDeploymentModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'updateFunctionDeploymentModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentModule', + 'deleteFunctionDeploymentModule', + 'functionDeploymentModule', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'deleteFunctionDeploymentModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts b/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts index f8b9e92fc1..ba40e892ea 100644 --- a/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/functionInvocationModule.ts @@ -198,7 +198,8 @@ export class FunctionInvocationModuleModel { 'UpdateFunctionInvocationModuleInput', 'id', 'functionInvocationModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/functionModule.ts b/sdk/constructive-react/src/modules/orm/models/functionModule.ts index 5c0e724d4c..7e127377dd 100644 --- a/sdk/constructive-react/src/modules/orm/models/functionModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/functionModule.ts @@ -196,7 +196,8 @@ export class FunctionModuleModel { 'UpdateFunctionModuleInput', 'id', 'functionModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/graphExecutionModule.ts b/sdk/constructive-react/src/modules/orm/models/graphExecutionModule.ts new file mode 100644 index 0000000000..9f1866c036 --- /dev/null +++ b/sdk/constructive-react/src/modules/orm/models/graphExecutionModule.ts @@ -0,0 +1,247 @@ +/** + * GraphExecutionModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GraphExecutionModule, + GraphExecutionModuleWithRelations, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, + CreateGraphExecutionModuleInput, + UpdateGraphExecutionModuleInput, + GraphExecutionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class GraphExecutionModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModules: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', + document, + variables, + transform: (data: { + graphExecutionModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', + document, + variables, + transform: (data: { + graphExecutionModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'GraphExecutionModule', + 'createGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.data, + 'CreateGraphExecutionModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'createGraphExecutionModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphExecutionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'GraphExecutionModule', + 'updateGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphExecutionModuleInput', + 'id', + 'graphExecutionModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'updateGraphExecutionModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'GraphExecutionModule', + 'deleteGraphExecutionModule', + 'graphExecutionModule', + { + id: args.where.id, + }, + 'DeleteGraphExecutionModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'deleteGraphExecutionModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/modules/orm/models/graphModule.ts b/sdk/constructive-react/src/modules/orm/models/graphModule.ts index deaa311f4c..f337b77ed9 100644 --- a/sdk/constructive-react/src/modules/orm/models/graphModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/graphModule.ts @@ -196,7 +196,8 @@ export class GraphModuleModel { 'UpdateGraphModuleInput', 'id', 'graphModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts b/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts index e1eca248c8..16e9170d2b 100644 --- a/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/hierarchyModule.ts @@ -196,7 +196,8 @@ export class HierarchyModuleModel { 'UpdateHierarchyModuleInput', 'id', 'hierarchyModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/i18NModule.ts b/sdk/constructive-react/src/modules/orm/models/i18NModule.ts index a1162a5f5f..014ecefd15 100644 --- a/sdk/constructive-react/src/modules/orm/models/i18NModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/i18NModule.ts @@ -196,7 +196,8 @@ export class I18NModuleModel { 'UpdateI18NModuleInput', 'id', 'i18NModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts b/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts index 86a507559d..bc564b56d1 100644 --- a/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/identityProvidersModule.ts @@ -198,7 +198,8 @@ export class IdentityProvidersModuleModel { 'UpdateIdentityProvidersModuleInput', 'id', 'identityProvidersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/index.ts b/sdk/constructive-react/src/modules/orm/models/index.ts index f478d2642f..2ff305f2fc 100644 --- a/sdk/constructive-react/src/modules/orm/models/index.ts +++ b/sdk/constructive-react/src/modules/orm/models/index.ts @@ -39,14 +39,16 @@ export { WebauthnAuthModuleModel } from './webauthnAuthModule'; export { FunctionInvocationModuleModel } from './functionInvocationModule'; export { FunctionModuleModel } from './functionModule'; export { InvitesModuleModel } from './invitesModule'; -export { NamespaceModuleModel } from './namespaceModule'; export { ComputeLogModuleModel } from './computeLogModule'; export { InferenceLogModuleModel } from './inferenceLogModule'; +export { NamespaceModuleModel } from './namespaceModule'; export { StorageLogModuleModel } from './storageLogModule'; export { TransferLogModuleModel } from './transferLogModule'; +export { FunctionDeploymentModuleModel } from './functionDeploymentModule'; export { PlansModuleModel } from './plansModule'; export { BillingProviderModuleModel } from './billingProviderModule'; export { DbUsageModuleModel } from './dbUsageModule'; +export { GraphExecutionModuleModel } from './graphExecutionModule'; export { HierarchyModuleModel } from './hierarchyModule'; export { PermissionsModuleModel } from './permissionsModule'; export { NotificationsModuleModel } from './notificationsModule'; diff --git a/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts b/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts index f6f4ab2452..f4c0f77d3b 100644 --- a/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/inferenceLogModule.ts @@ -196,7 +196,8 @@ export class InferenceLogModuleModel { 'UpdateInferenceLogModuleInput', 'id', 'inferenceLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/invitesModule.ts b/sdk/constructive-react/src/modules/orm/models/invitesModule.ts index b31e122a08..b244078720 100644 --- a/sdk/constructive-react/src/modules/orm/models/invitesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/invitesModule.ts @@ -196,7 +196,8 @@ export class InvitesModuleModel { 'UpdateInvitesModuleInput', 'id', 'invitesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/limitsModule.ts b/sdk/constructive-react/src/modules/orm/models/limitsModule.ts index 60dec78148..50d0d76ba5 100644 --- a/sdk/constructive-react/src/modules/orm/models/limitsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/limitsModule.ts @@ -196,7 +196,8 @@ export class LimitsModuleModel { 'UpdateLimitsModuleInput', 'id', 'limitsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts b/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts index cf72c91fa9..9eeb67961f 100644 --- a/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/membershipTypesModule.ts @@ -198,7 +198,8 @@ export class MembershipTypesModuleModel { 'UpdateMembershipTypesModuleInput', 'id', 'membershipTypesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts b/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts index 5709ac9049..66b41bce21 100644 --- a/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/membershipsModule.ts @@ -196,7 +196,8 @@ export class MembershipsModuleModel { 'UpdateMembershipsModuleInput', 'id', 'membershipsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts b/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts index 9cf13ba7ca..d3bb9d0c67 100644 --- a/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/merkleStoreModule.ts @@ -196,7 +196,8 @@ export class MerkleStoreModuleModel { 'UpdateMerkleStoreModuleInput', 'id', 'merkleStoreModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts b/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts index 9d37ad714a..bd5c681504 100644 --- a/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/namespaceModule.ts @@ -196,7 +196,8 @@ export class NamespaceModuleModel { 'UpdateNamespaceModuleInput', 'id', 'namespaceModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts b/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts index dc44d0d696..a629d81108 100644 --- a/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/notificationsModule.ts @@ -196,7 +196,8 @@ export class NotificationsModuleModel { 'UpdateNotificationsModuleInput', 'id', 'notificationsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts b/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts index 5fb22b44da..2a330457b5 100644 --- a/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/permissionsModule.ts @@ -196,7 +196,8 @@ export class PermissionsModuleModel { 'UpdatePermissionsModuleInput', 'id', 'permissionsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts b/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts index 55f64339ee..42cbdfc98f 100644 --- a/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/phoneNumbersModule.ts @@ -196,7 +196,8 @@ export class PhoneNumbersModuleModel { 'UpdatePhoneNumbersModuleInput', 'id', 'phoneNumbersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/plansModule.ts b/sdk/constructive-react/src/modules/orm/models/plansModule.ts index f13f1849b8..545fbdd7cb 100644 --- a/sdk/constructive-react/src/modules/orm/models/plansModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/plansModule.ts @@ -196,7 +196,8 @@ export class PlansModuleModel { 'UpdatePlansModuleInput', 'id', 'plansModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/profilesModule.ts b/sdk/constructive-react/src/modules/orm/models/profilesModule.ts index f1c152e779..15d5a94e79 100644 --- a/sdk/constructive-react/src/modules/orm/models/profilesModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/profilesModule.ts @@ -196,7 +196,8 @@ export class ProfilesModuleModel { 'UpdateProfilesModuleInput', 'id', 'profilesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts b/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts index 888855807c..1205e581d8 100644 --- a/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/rateLimitMetersModule.ts @@ -198,7 +198,8 @@ export class RateLimitMetersModuleModel { 'UpdateRateLimitMetersModuleInput', 'id', 'rateLimitMetersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts b/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts index 9567ccaa2d..dbf9501696 100644 --- a/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/rateLimitsModule.ts @@ -196,7 +196,8 @@ export class RateLimitsModuleModel { 'UpdateRateLimitsModuleInput', 'id', 'rateLimitsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts b/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts index d3035f9d59..2cb1075457 100644 --- a/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/realtimeModule.ts @@ -196,7 +196,8 @@ export class RealtimeModuleModel { 'UpdateRealtimeModuleInput', 'id', 'realtimeModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/relationProvision.ts b/sdk/constructive-react/src/modules/orm/models/relationProvision.ts index eea0a01010..c8bc481ca9 100644 --- a/sdk/constructive-react/src/modules/orm/models/relationProvision.ts +++ b/sdk/constructive-react/src/modules/orm/models/relationProvision.ts @@ -196,7 +196,8 @@ export class RelationProvisionModel { 'UpdateRelationProvisionInput', 'id', 'relationProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/rlsModule.ts b/sdk/constructive-react/src/modules/orm/models/rlsModule.ts index 5e1ed1afc3..6a1c7cae75 100644 --- a/sdk/constructive-react/src/modules/orm/models/rlsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/rlsModule.ts @@ -196,7 +196,8 @@ export class RlsModuleModel { 'UpdateRlsModuleInput', 'id', 'rlsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts b/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts index ca0ef2a686..88e10489d0 100644 --- a/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts +++ b/sdk/constructive-react/src/modules/orm/models/secureTableProvision.ts @@ -198,7 +198,8 @@ export class SecureTableProvisionModel { 'UpdateSecureTableProvisionInput', 'id', 'secureTableProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts b/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts index 474a953202..9460af6349 100644 --- a/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/sessionSecretsModule.ts @@ -198,7 +198,8 @@ export class SessionSecretsModuleModel { 'UpdateSessionSecretsModuleInput', 'id', 'sessionSecretsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts b/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts index b66cc7be34..324773df9f 100644 --- a/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/sessionsModule.ts @@ -196,7 +196,8 @@ export class SessionsModuleModel { 'UpdateSessionsModuleInput', 'id', 'sessionsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts b/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts index 60e0b45cac..a53edf15d1 100644 --- a/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/storageLogModule.ts @@ -196,7 +196,8 @@ export class StorageLogModuleModel { 'UpdateStorageLogModuleInput', 'id', 'storageLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/storageModule.ts b/sdk/constructive-react/src/modules/orm/models/storageModule.ts index e359f6471c..f69dd6e624 100644 --- a/sdk/constructive-react/src/modules/orm/models/storageModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/storageModule.ts @@ -196,7 +196,8 @@ export class StorageModuleModel { 'UpdateStorageModuleInput', 'id', 'storageModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts b/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts index dd1b30c286..cab2bec096 100644 --- a/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/transferLogModule.ts @@ -196,7 +196,8 @@ export class TransferLogModuleModel { 'UpdateTransferLogModuleInput', 'id', 'transferLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts index 15fe6a854a..341885e14c 100644 --- a/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userAuthModule.ts @@ -196,7 +196,8 @@ export class UserAuthModuleModel { 'UpdateUserAuthModuleInput', 'id', 'userAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts b/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts index 90ada31d7a..9e9bc0b2aa 100644 --- a/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userCredentialsModule.ts @@ -198,7 +198,8 @@ export class UserCredentialsModuleModel { 'UpdateUserCredentialsModuleInput', 'id', 'userCredentialsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts b/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts index 5a905d30b4..252d0cc8bf 100644 --- a/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userSettingsModule.ts @@ -196,7 +196,8 @@ export class UserSettingsModuleModel { 'UpdateUserSettingsModuleInput', 'id', 'userSettingsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/userStateModule.ts b/sdk/constructive-react/src/modules/orm/models/userStateModule.ts index 6070cfbd00..86999c74ae 100644 --- a/sdk/constructive-react/src/modules/orm/models/userStateModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/userStateModule.ts @@ -196,7 +196,8 @@ export class UserStateModuleModel { 'UpdateUserStateModuleInput', 'id', 'userStateModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/usersModule.ts b/sdk/constructive-react/src/modules/orm/models/usersModule.ts index de86bbbfb8..950038fcf0 100644 --- a/sdk/constructive-react/src/modules/orm/models/usersModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/usersModule.ts @@ -196,7 +196,8 @@ export class UsersModuleModel { 'UpdateUsersModuleInput', 'id', 'usersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts index 14ebdd6f29..e8cdb4eb61 100644 --- a/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/webauthnAuthModule.ts @@ -196,7 +196,8 @@ export class WebauthnAuthModuleModel { 'UpdateWebauthnAuthModuleInput', 'id', 'webauthnAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts b/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts index ee66831a79..fd73e47620 100644 --- a/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts +++ b/sdk/constructive-react/src/modules/orm/models/webauthnCredentialsModule.ts @@ -198,7 +198,8 @@ export class WebauthnCredentialsModuleModel { 'UpdateWebauthnCredentialsModuleInput', 'id', 'webauthnCredentialsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/modules/orm/query-builder.ts b/sdk/constructive-react/src/modules/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-react/src/modules/orm/query-builder.ts +++ b/sdk/constructive-react/src/modules/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/src/modules/schema-types.ts b/sdk/constructive-react/src/modules/schema-types.ts index 9540f9f05e..4750467dd8 100644 --- a/sdk/constructive-react/src/modules/schema-types.ts +++ b/sdk/constructive-react/src/modules/schema-types.ts @@ -26,8 +26,10 @@ import type { EmailsModule, EntityTypeProvision, EventsModule, + FunctionDeploymentModule, FunctionInvocationModule, FunctionModule, + GraphExecutionModule, GraphModule, HierarchyModule, I18NModule, @@ -719,10 +721,6 @@ export type GraphModuleOrderBy = | 'MERKLE_STORE_MODULE_ID_DESC' | 'GRAPHS_TABLE_ID_ASC' | 'GRAPHS_TABLE_ID_DESC' - | 'EXECUTIONS_TABLE_ID_ASC' - | 'EXECUTIONS_TABLE_ID_DESC' - | 'OUTPUTS_TABLE_ID_ASC' - | 'OUTPUTS_TABLE_ID_DESC' | 'API_NAME_ASC' | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' @@ -1078,47 +1076,6 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; -/** Methods to use when ordering `NamespaceModule`. */ -export type NamespaceModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'SCHEMA_ID_ASC' - | 'SCHEMA_ID_DESC' - | 'PRIVATE_SCHEMA_ID_ASC' - | 'PRIVATE_SCHEMA_ID_DESC' - | 'PUBLIC_SCHEMA_NAME_ASC' - | 'PUBLIC_SCHEMA_NAME_DESC' - | 'PRIVATE_SCHEMA_NAME_ASC' - | 'PRIVATE_SCHEMA_NAME_DESC' - | 'NAMESPACES_TABLE_ID_ASC' - | 'NAMESPACES_TABLE_ID_DESC' - | 'NAMESPACE_EVENTS_TABLE_ID_ASC' - | 'NAMESPACE_EVENTS_TABLE_ID_DESC' - | 'NAMESPACES_TABLE_NAME_ASC' - | 'NAMESPACES_TABLE_NAME_DESC' - | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' - | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' - | 'API_NAME_ASC' - | 'API_NAME_DESC' - | 'PRIVATE_API_NAME_ASC' - | 'PRIVATE_API_NAME_DESC' - | 'SCOPE_ASC' - | 'SCOPE_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC' - | 'ENTITY_TABLE_ID_ASC' - | 'ENTITY_TABLE_ID_DESC' - | 'POLICIES_ASC' - | 'POLICIES_DESC' - | 'PROVISIONS_ASC' - | 'PROVISIONS_DESC' - | 'DEFAULT_PERMISSIONS_ASC' - | 'DEFAULT_PERMISSIONS_DESC'; /** Methods to use when ordering `ComputeLogModule`. */ export type ComputeLogModuleOrderBy = | 'NATURAL' @@ -1205,6 +1162,49 @@ export type InferenceLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +/** Methods to use when ordering `NamespaceModule`. */ +export type NamespaceModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'PLATFORM_NAMESPACES_TABLE_ID_ASC' + | 'PLATFORM_NAMESPACES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; /** Methods to use when ordering `StorageLogModule`. */ export type StorageLogModuleOrderBy = | 'NATURAL' @@ -1291,6 +1291,51 @@ export type TransferLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +/** Methods to use when ordering `FunctionDeploymentModule`. */ +export type FunctionDeploymentModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; /** Methods to use when ordering `PlansModule`. */ export type PlansModuleOrderBy = | 'NATURAL' @@ -1436,6 +1481,55 @@ export type DbUsageModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +/** Methods to use when ordering `GraphExecutionModule`. */ +export type GraphExecutionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; /** Methods to use when ordering `HierarchyModule`. */ export type HierarchyModuleOrderBy = | 'NATURAL' @@ -3177,10 +3271,6 @@ export interface GraphModuleFilter { merkleStoreModuleId?: UUIDFilter; /** Filter by the object’s `graphsTableId` field. */ graphsTableId?: UUIDFilter; - /** Filter by the object’s `executionsTableId` field. */ - executionsTableId?: UUIDFilter; - /** Filter by the object’s `outputsTableId` field. */ - outputsTableId?: UUIDFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ @@ -3594,51 +3684,6 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } -/** A filter to be used against `NamespaceModule` object types. All fields are combined with a logical ‘and.’ */ -export interface NamespaceModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `schemaId` field. */ - schemaId?: UUIDFilter; - /** Filter by the object’s `privateSchemaId` field. */ - privateSchemaId?: UUIDFilter; - /** Filter by the object’s `publicSchemaName` field. */ - publicSchemaName?: StringFilter; - /** Filter by the object’s `privateSchemaName` field. */ - privateSchemaName?: StringFilter; - /** Filter by the object’s `namespacesTableId` field. */ - namespacesTableId?: UUIDFilter; - /** Filter by the object’s `namespaceEventsTableId` field. */ - namespaceEventsTableId?: UUIDFilter; - /** Filter by the object’s `namespacesTableName` field. */ - namespacesTableName?: StringFilter; - /** Filter by the object’s `namespaceEventsTableName` field. */ - namespaceEventsTableName?: StringFilter; - /** Filter by the object’s `apiName` field. */ - apiName?: StringFilter; - /** Filter by the object’s `privateApiName` field. */ - privateApiName?: StringFilter; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Filter by the object’s `entityTableId` field. */ - entityTableId?: UUIDFilter; - /** Filter by the object’s `policies` field. */ - policies?: JSONFilter; - /** Filter by the object’s `provisions` field. */ - provisions?: JSONFilter; - /** Filter by the object’s `defaultPermissions` field. */ - defaultPermissions?: StringListFilter; - /** Checks for all expressions in this list. */ - and?: NamespaceModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: NamespaceModuleFilter[]; - /** Negates the expression. */ - not?: NamespaceModuleFilter; -} /** A filter to be used against `ComputeLogModule` object types. All fields are combined with a logical ‘and.’ */ export interface ComputeLogModuleFilter { /** Filter by the object’s `id` field. */ @@ -3733,6 +3778,53 @@ export interface InferenceLogModuleFilter { /** Negates the expression. */ not?: InferenceLogModuleFilter; } +/** A filter to be used against `NamespaceModule` object types. All fields are combined with a logical ‘and.’ */ +export interface NamespaceModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `namespacesTableId` field. */ + namespacesTableId?: UUIDFilter; + /** Filter by the object’s `namespaceEventsTableId` field. */ + namespaceEventsTableId?: UUIDFilter; + /** Filter by the object’s `namespacesTableName` field. */ + namespacesTableName?: StringFilter; + /** Filter by the object’s `namespaceEventsTableName` field. */ + namespaceEventsTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `platformNamespacesTableId` field. */ + platformNamespacesTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: NamespaceModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: NamespaceModuleFilter[]; + /** Negates the expression. */ + not?: NamespaceModuleFilter; +} /** A filter to be used against `StorageLogModule` object types. All fields are combined with a logical ‘and.’ */ export interface StorageLogModuleFilter { /** Filter by the object’s `id` field. */ @@ -3827,6 +3919,63 @@ export interface TransferLogModuleFilter { /** Negates the expression. */ not?: TransferLogModuleFilter; } +/** A filter to be used against `FunctionDeploymentModule` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDeploymentModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `deploymentsTableId` field. */ + deploymentsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentEventsTableId` field. */ + deploymentEventsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentsTableName` field. */ + deploymentsTableName?: StringFilter; + /** Filter by the object’s `deploymentEventsTableName` field. */ + deploymentEventsTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `functionModuleId` field. */ + functionModuleId?: UUIDFilter; + /** Filter by the object’s `namespaceModuleId` field. */ + namespaceModuleId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentModuleFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentModuleFilter; + /** Filter by the object’s `functionModule` relation. */ + functionModule?: FunctionModuleFilter; + /** A related `functionModule` exists. */ + functionModuleExists?: boolean; + /** Filter by the object’s `namespaceModule` relation. */ + namespaceModule?: NamespaceModuleFilter; + /** A related `namespaceModule` exists. */ + namespaceModuleExists?: boolean; +} /** A filter to be used against `PlansModule` object types. All fields are combined with a logical ‘and.’ */ export interface PlansModuleFilter { /** Filter by the object’s `id` field. */ @@ -3971,18 +4120,73 @@ export interface DbUsageModuleFilter { scope?: StringFilter; /** Filter by the object’s `prefix` field. */ prefix?: StringFilter; - /** Filter by the object’s `defaultPermissions` field. */ - defaultPermissions?: StringListFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: DbUsageModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DbUsageModuleFilter[]; + /** Negates the expression. */ + not?: DbUsageModuleFilter; +} +/** A filter to be used against `GraphExecutionModule` object types. All fields are combined with a logical ‘and.’ */ +export interface GraphExecutionModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `graphModuleId` field. */ + graphModuleId?: UUIDFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `executionsTableId` field. */ + executionsTableId?: UUIDFilter; + /** Filter by the object’s `outputsTableId` field. */ + outputsTableId?: UUIDFilter; + /** Filter by the object’s `nodeStatesTableId` field. */ + nodeStatesTableId?: UUIDFilter; + /** Filter by the object’s `executionsTableName` field. */ + executionsTableName?: StringFilter; + /** Filter by the object’s `outputsTableName` field. */ + outputsTableName?: StringFilter; + /** Filter by the object’s `nodeStatesTableName` field. */ + nodeStatesTableName?: StringFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ privateApiName?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; /** Checks for all expressions in this list. */ - and?: DbUsageModuleFilter[]; + and?: GraphExecutionModuleFilter[]; /** Checks for any expressions in this list. */ - or?: DbUsageModuleFilter[]; + or?: GraphExecutionModuleFilter[]; /** Negates the expression. */ - not?: DbUsageModuleFilter; + not?: GraphExecutionModuleFilter; + /** Filter by the object’s `graphModule` relation. */ + graphModule?: GraphModuleFilter; } /** A filter to be used against `HierarchyModule` object types. All fields are combined with a logical ‘and.’ */ export interface HierarchyModuleFilter { @@ -5530,6 +5734,31 @@ export interface ConfigSecretsModuleInput { provisions?: unknown; hasConfig?: boolean; } +export interface CreateGraphModuleInput { + clientMutationId?: string; + /** The `GraphModule` to be created by this mutation. */ + graphModule: GraphModuleInput; +} +/** An input for mutations affecting `GraphModule` */ +export interface GraphModuleInput { + id?: string; + databaseId: string; + publicSchemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + scope?: string; + prefix?: string; + merkleStoreModuleId: string; + graphsTableId?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; + createdAt?: string; +} export interface CreateRateLimitMetersModuleInput { clientMutationId?: string; /** The `RateLimitMetersModule` to be created by this mutation. */ @@ -5679,32 +5908,6 @@ export interface InvitesModuleInput { apiName?: string; privateApiName?: string; } -export interface CreateNamespaceModuleInput { - clientMutationId?: string; - /** The `NamespaceModule` to be created by this mutation. */ - namespaceModule: NamespaceModuleInput; -} -/** An input for mutations affecting `NamespaceModule` */ -export interface NamespaceModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: unknown; - provisions?: unknown; - defaultPermissions?: string[]; -} export interface CreateComputeLogModuleInput { clientMutationId?: string; /** The `ComputeLogModule` to be created by this mutation. */ @@ -5732,33 +5935,6 @@ export interface ComputeLogModuleInput { apiName?: string; privateApiName?: string; } -export interface CreateGraphModuleInput { - clientMutationId?: string; - /** The `GraphModule` to be created by this mutation. */ - graphModule: GraphModuleInput; -} -/** An input for mutations affecting `GraphModule` */ -export interface GraphModuleInput { - id?: string; - databaseId: string; - publicSchemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - scope?: string; - prefix?: string; - merkleStoreModuleId: string; - graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; - apiName?: string; - privateApiName?: string; - entityTableId?: string; - policies?: unknown; - provisions?: unknown; - defaultPermissions?: string[]; - createdAt?: string; -} export interface CreateInferenceLogModuleInput { clientMutationId?: string; /** The `InferenceLogModule` to be created by this mutation. */ @@ -5786,6 +5962,33 @@ export interface InferenceLogModuleInput { apiName?: string; privateApiName?: string; } +export interface CreateNamespaceModuleInput { + clientMutationId?: string; + /** The `NamespaceModule` to be created by this mutation. */ + namespaceModule: NamespaceModuleInput; +} +/** An input for mutations affecting `NamespaceModule` */ +export interface NamespaceModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; +} export interface CreateStorageLogModuleInput { clientMutationId?: string; /** The `StorageLogModule` to be created by this mutation. */ @@ -5840,6 +6043,34 @@ export interface TransferLogModuleInput { apiName?: string; privateApiName?: string; } +export interface CreateFunctionDeploymentModuleInput { + clientMutationId?: string; + /** The `FunctionDeploymentModule` to be created by this mutation. */ + functionDeploymentModule: FunctionDeploymentModuleInput; +} +/** An input for mutations affecting `FunctionDeploymentModule` */ +export interface FunctionDeploymentModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; +} export interface CreatePlansModuleInput { clientMutationId?: string; /** The `PlansModule` to be created by this mutation. */ @@ -5929,6 +6160,36 @@ export interface DbUsageModuleInput { apiName?: string; privateApiName?: string; } +export interface CreateGraphExecutionModuleInput { + clientMutationId?: string; + /** The `GraphExecutionModule` to be created by this mutation. */ + graphExecutionModule: GraphExecutionModuleInput; +} +/** An input for mutations affecting `GraphExecutionModule` */ +export interface GraphExecutionModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; + createdAt?: string; +} export interface CreateHierarchyModuleInput { clientMutationId?: string; /** The `HierarchyModule` to be created by this mutation. */ @@ -7360,6 +7621,32 @@ export interface ConfigSecretsModulePatch { provisions?: unknown; hasConfig?: boolean; } +export interface UpdateGraphModuleInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `GraphModule` being updated. */ + graphModulePatch: GraphModulePatch; +} +/** Represents an update to a `GraphModule`. Fields that are set will be updated. */ +export interface GraphModulePatch { + id?: string; + databaseId?: string; + publicSchemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + scope?: string; + prefix?: string; + merkleStoreModuleId?: string; + graphsTableId?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; + createdAt?: string; +} export interface UpdateRateLimitMetersModuleInput { clientMutationId?: string; id: string; @@ -7515,33 +7802,6 @@ export interface InvitesModulePatch { apiName?: string; privateApiName?: string; } -export interface UpdateNamespaceModuleInput { - clientMutationId?: string; - id: string; - /** An object where the defined keys will be set on the `NamespaceModule` being updated. */ - namespaceModulePatch: NamespaceModulePatch; -} -/** Represents an update to a `NamespaceModule`. Fields that are set will be updated. */ -export interface NamespaceModulePatch { - id?: string; - databaseId?: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: unknown; - provisions?: unknown; - defaultPermissions?: string[]; -} export interface UpdateComputeLogModuleInput { clientMutationId?: string; id: string; @@ -7552,51 +7812,23 @@ export interface UpdateComputeLogModuleInput { export interface ComputeLogModulePatch { id?: string; databaseId?: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - computeLogTableId?: string; - computeLogTableName?: string; - usageDailyTableId?: string; - usageDailyTableName?: string; - interval?: string; - retention?: string; - premake?: number; - scope?: string; - actorFkTableId?: string; - entityFkTableId?: string; - prefix?: string; - apiName?: string; - privateApiName?: string; -} -export interface UpdateGraphModuleInput { - clientMutationId?: string; - id: string; - /** An object where the defined keys will be set on the `GraphModule` being updated. */ - graphModulePatch: GraphModulePatch; -} -/** Represents an update to a `GraphModule`. Fields that are set will be updated. */ -export interface GraphModulePatch { - id?: string; - databaseId?: string; - publicSchemaId?: string; + schemaId?: string; privateSchemaId?: string; publicSchemaName?: string; privateSchemaName?: string; + computeLogTableId?: string; + computeLogTableName?: string; + usageDailyTableId?: string; + usageDailyTableName?: string; + interval?: string; + retention?: string; + premake?: number; scope?: string; + actorFkTableId?: string; + entityFkTableId?: string; prefix?: string; - merkleStoreModuleId?: string; - graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; apiName?: string; privateApiName?: string; - entityTableId?: string; - policies?: unknown; - provisions?: unknown; - defaultPermissions?: string[]; - createdAt?: string; } export interface UpdateInferenceLogModuleInput { clientMutationId?: string; @@ -7626,6 +7858,34 @@ export interface InferenceLogModulePatch { apiName?: string; privateApiName?: string; } +export interface UpdateNamespaceModuleInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `NamespaceModule` being updated. */ + namespaceModulePatch: NamespaceModulePatch; +} +/** Represents an update to a `NamespaceModule`. Fields that are set will be updated. */ +export interface NamespaceModulePatch { + id?: string; + databaseId?: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; +} export interface UpdateStorageLogModuleInput { clientMutationId?: string; id: string; @@ -7682,6 +7942,35 @@ export interface TransferLogModulePatch { apiName?: string; privateApiName?: string; } +export interface UpdateFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `FunctionDeploymentModule` being updated. */ + functionDeploymentModulePatch: FunctionDeploymentModulePatch; +} +/** Represents an update to a `FunctionDeploymentModule`. Fields that are set will be updated. */ +export interface FunctionDeploymentModulePatch { + id?: string; + databaseId?: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; +} export interface UpdatePlansModuleInput { clientMutationId?: string; id: string; @@ -7774,6 +8063,37 @@ export interface DbUsageModulePatch { apiName?: string; privateApiName?: string; } +export interface UpdateGraphExecutionModuleInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `GraphExecutionModule` being updated. */ + graphExecutionModulePatch: GraphExecutionModulePatch; +} +/** Represents an update to a `GraphExecutionModule`. Fields that are set will be updated. */ +export interface GraphExecutionModulePatch { + id?: string; + databaseId?: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId?: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: unknown; + provisions?: unknown; + defaultPermissions?: string[]; + createdAt?: string; +} export interface UpdateHierarchyModuleInput { clientMutationId?: string; id: string; @@ -8767,6 +9087,10 @@ export interface DeleteConfigSecretsModuleInput { clientMutationId?: string; id: string; } +export interface DeleteGraphModuleInput { + clientMutationId?: string; + id: string; +} export interface DeleteRateLimitMetersModuleInput { clientMutationId?: string; id: string; @@ -8791,19 +9115,15 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } -export interface DeleteNamespaceModuleInput { - clientMutationId?: string; - id: string; -} export interface DeleteComputeLogModuleInput { clientMutationId?: string; id: string; } -export interface DeleteGraphModuleInput { +export interface DeleteInferenceLogModuleInput { clientMutationId?: string; id: string; } -export interface DeleteInferenceLogModuleInput { +export interface DeleteNamespaceModuleInput { clientMutationId?: string; id: string; } @@ -8815,6 +9135,10 @@ export interface DeleteTransferLogModuleInput { clientMutationId?: string; id: string; } +export interface DeleteFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; +} export interface DeletePlansModuleInput { clientMutationId?: string; id: string; @@ -8827,6 +9151,10 @@ export interface DeleteDbUsageModuleInput { clientMutationId?: string; id: string; } +export interface DeleteGraphExecutionModuleInput { + clientMutationId?: string; + id: string; +} export interface DeleteHierarchyModuleInput { clientMutationId?: string; id: string; @@ -9091,6 +9419,13 @@ export interface ConfigSecretsModuleConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `GraphModule` values. */ +export interface GraphModuleConnection { + nodes: GraphModule[]; + edges: GraphModuleEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `RateLimitMetersModule` values. */ export interface RateLimitMetersModuleConnection { nodes: RateLimitMetersModule[]; @@ -9133,13 +9468,6 @@ export interface InvitesModuleConnection { pageInfo: PageInfo; totalCount: number; } -/** A connection to a list of `NamespaceModule` values. */ -export interface NamespaceModuleConnection { - nodes: NamespaceModule[]; - edges: NamespaceModuleEdge[]; - pageInfo: PageInfo; - totalCount: number; -} /** A connection to a list of `ComputeLogModule` values. */ export interface ComputeLogModuleConnection { nodes: ComputeLogModule[]; @@ -9147,13 +9475,6 @@ export interface ComputeLogModuleConnection { pageInfo: PageInfo; totalCount: number; } -/** A connection to a list of `GraphModule` values. */ -export interface GraphModuleConnection { - nodes: GraphModule[]; - edges: GraphModuleEdge[]; - pageInfo: PageInfo; - totalCount: number; -} /** A connection to a list of `InferenceLogModule` values. */ export interface InferenceLogModuleConnection { nodes: InferenceLogModule[]; @@ -9161,6 +9482,13 @@ export interface InferenceLogModuleConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `NamespaceModule` values. */ +export interface NamespaceModuleConnection { + nodes: NamespaceModule[]; + edges: NamespaceModuleEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `StorageLogModule` values. */ export interface StorageLogModuleConnection { nodes: StorageLogModule[]; @@ -9175,6 +9503,13 @@ export interface TransferLogModuleConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `FunctionDeploymentModule` values. */ +export interface FunctionDeploymentModuleConnection { + nodes: FunctionDeploymentModule[]; + edges: FunctionDeploymentModuleEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `PlansModule` values. */ export interface PlansModuleConnection { nodes: PlansModule[]; @@ -9196,6 +9531,13 @@ export interface DbUsageModuleConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `GraphExecutionModule` values. */ +export interface GraphExecutionModuleConnection { + nodes: GraphExecutionModule[]; + edges: GraphExecutionModuleEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `HierarchyModule` values. */ export interface HierarchyModuleConnection { nodes: HierarchyModule[]; @@ -9500,6 +9842,12 @@ export interface CreateConfigSecretsModulePayload { configSecretsModule?: ConfigSecretsModule | null; configSecretsModuleEdge?: ConfigSecretsModuleEdge | null; } +export interface CreateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was created by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} export interface CreateRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was created by this mutation. */ @@ -9536,30 +9884,24 @@ export interface CreateInvitesModulePayload { invitesModule?: InvitesModule | null; invitesModuleEdge?: InvitesModuleEdge | null; } -export interface CreateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was created by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ computeLogModule?: ComputeLogModule | null; computeLogModuleEdge?: ComputeLogModuleEdge | null; } -export interface CreateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was created by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} export interface CreateInferenceLogModulePayload { clientMutationId?: string | null; /** The `InferenceLogModule` that was created by this mutation. */ inferenceLogModule?: InferenceLogModule | null; inferenceLogModuleEdge?: InferenceLogModuleEdge | null; } +export interface CreateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was created by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} export interface CreateStorageLogModulePayload { clientMutationId?: string | null; /** The `StorageLogModule` that was created by this mutation. */ @@ -9572,6 +9914,12 @@ export interface CreateTransferLogModulePayload { transferLogModule?: TransferLogModule | null; transferLogModuleEdge?: TransferLogModuleEdge | null; } +export interface CreateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was created by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} export interface CreatePlansModulePayload { clientMutationId?: string | null; /** The `PlansModule` that was created by this mutation. */ @@ -9590,6 +9938,12 @@ export interface CreateDbUsageModulePayload { dbUsageModule?: DbUsageModule | null; dbUsageModuleEdge?: DbUsageModuleEdge | null; } +export interface CreateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was created by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} export interface CreateHierarchyModulePayload { clientMutationId?: string | null; /** The `HierarchyModule` that was created by this mutation. */ @@ -9842,6 +10196,12 @@ export interface UpdateConfigSecretsModulePayload { configSecretsModule?: ConfigSecretsModule | null; configSecretsModuleEdge?: ConfigSecretsModuleEdge | null; } +export interface UpdateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was updated by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} export interface UpdateRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was updated by this mutation. */ @@ -9878,30 +10238,24 @@ export interface UpdateInvitesModulePayload { invitesModule?: InvitesModule | null; invitesModuleEdge?: InvitesModuleEdge | null; } -export interface UpdateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was updated by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} export interface UpdateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was updated by this mutation. */ computeLogModule?: ComputeLogModule | null; computeLogModuleEdge?: ComputeLogModuleEdge | null; } -export interface UpdateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was updated by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} export interface UpdateInferenceLogModulePayload { clientMutationId?: string | null; /** The `InferenceLogModule` that was updated by this mutation. */ inferenceLogModule?: InferenceLogModule | null; inferenceLogModuleEdge?: InferenceLogModuleEdge | null; } +export interface UpdateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was updated by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} export interface UpdateStorageLogModulePayload { clientMutationId?: string | null; /** The `StorageLogModule` that was updated by this mutation. */ @@ -9914,6 +10268,12 @@ export interface UpdateTransferLogModulePayload { transferLogModule?: TransferLogModule | null; transferLogModuleEdge?: TransferLogModuleEdge | null; } +export interface UpdateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was updated by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} export interface UpdatePlansModulePayload { clientMutationId?: string | null; /** The `PlansModule` that was updated by this mutation. */ @@ -9932,6 +10292,12 @@ export interface UpdateDbUsageModulePayload { dbUsageModule?: DbUsageModule | null; dbUsageModuleEdge?: DbUsageModuleEdge | null; } +export interface UpdateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was updated by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} export interface UpdateHierarchyModulePayload { clientMutationId?: string | null; /** The `HierarchyModule` that was updated by this mutation. */ @@ -10184,6 +10550,12 @@ export interface DeleteConfigSecretsModulePayload { configSecretsModule?: ConfigSecretsModule | null; configSecretsModuleEdge?: ConfigSecretsModuleEdge | null; } +export interface DeleteGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was deleted by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} export interface DeleteRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was deleted by this mutation. */ @@ -10220,30 +10592,24 @@ export interface DeleteInvitesModulePayload { invitesModule?: InvitesModule | null; invitesModuleEdge?: InvitesModuleEdge | null; } -export interface DeleteNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was deleted by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} export interface DeleteComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was deleted by this mutation. */ computeLogModule?: ComputeLogModule | null; computeLogModuleEdge?: ComputeLogModuleEdge | null; } -export interface DeleteGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was deleted by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} export interface DeleteInferenceLogModulePayload { clientMutationId?: string | null; /** The `InferenceLogModule` that was deleted by this mutation. */ inferenceLogModule?: InferenceLogModule | null; inferenceLogModuleEdge?: InferenceLogModuleEdge | null; } +export interface DeleteNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was deleted by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} export interface DeleteStorageLogModulePayload { clientMutationId?: string | null; /** The `StorageLogModule` that was deleted by this mutation. */ @@ -10256,6 +10622,12 @@ export interface DeleteTransferLogModulePayload { transferLogModule?: TransferLogModule | null; transferLogModuleEdge?: TransferLogModuleEdge | null; } +export interface DeleteFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was deleted by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} export interface DeletePlansModulePayload { clientMutationId?: string | null; /** The `PlansModule` that was deleted by this mutation. */ @@ -10274,6 +10646,12 @@ export interface DeleteDbUsageModulePayload { dbUsageModule?: DbUsageModule | null; dbUsageModuleEdge?: DbUsageModuleEdge | null; } +export interface DeleteGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was deleted by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} export interface DeleteHierarchyModulePayload { clientMutationId?: string | null; /** The `HierarchyModule` that was deleted by this mutation. */ @@ -10551,6 +10929,12 @@ export interface ConfigSecretsModuleEdge { /** The `ConfigSecretsModule` at the end of the edge. */ node?: ConfigSecretsModule | null; } +/** A `GraphModule` edge in the connection. */ +export interface GraphModuleEdge { + cursor?: string | null; + /** The `GraphModule` at the end of the edge. */ + node?: GraphModule | null; +} /** A `RateLimitMetersModule` edge in the connection. */ export interface RateLimitMetersModuleEdge { cursor?: string | null; @@ -10587,30 +10971,24 @@ export interface InvitesModuleEdge { /** The `InvitesModule` at the end of the edge. */ node?: InvitesModule | null; } -/** A `NamespaceModule` edge in the connection. */ -export interface NamespaceModuleEdge { - cursor?: string | null; - /** The `NamespaceModule` at the end of the edge. */ - node?: NamespaceModule | null; -} /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; /** The `ComputeLogModule` at the end of the edge. */ node?: ComputeLogModule | null; } -/** A `GraphModule` edge in the connection. */ -export interface GraphModuleEdge { - cursor?: string | null; - /** The `GraphModule` at the end of the edge. */ - node?: GraphModule | null; -} /** A `InferenceLogModule` edge in the connection. */ export interface InferenceLogModuleEdge { cursor?: string | null; /** The `InferenceLogModule` at the end of the edge. */ node?: InferenceLogModule | null; } +/** A `NamespaceModule` edge in the connection. */ +export interface NamespaceModuleEdge { + cursor?: string | null; + /** The `NamespaceModule` at the end of the edge. */ + node?: NamespaceModule | null; +} /** A `StorageLogModule` edge in the connection. */ export interface StorageLogModuleEdge { cursor?: string | null; @@ -10623,6 +11001,12 @@ export interface TransferLogModuleEdge { /** The `TransferLogModule` at the end of the edge. */ node?: TransferLogModule | null; } +/** A `FunctionDeploymentModule` edge in the connection. */ +export interface FunctionDeploymentModuleEdge { + cursor?: string | null; + /** The `FunctionDeploymentModule` at the end of the edge. */ + node?: FunctionDeploymentModule | null; +} /** A `PlansModule` edge in the connection. */ export interface PlansModuleEdge { cursor?: string | null; @@ -10641,6 +11025,12 @@ export interface DbUsageModuleEdge { /** The `DbUsageModule` at the end of the edge. */ node?: DbUsageModule | null; } +/** A `GraphExecutionModule` edge in the connection. */ +export interface GraphExecutionModuleEdge { + cursor?: string | null; + /** The `GraphExecutionModule` at the end of the edge. */ + node?: GraphExecutionModule | null; +} /** A `HierarchyModule` edge in the connection. */ export interface HierarchyModuleEdge { cursor?: string | null; @@ -10738,6 +11128,14 @@ export interface MetaTable { relations: MetaRelations; inflection: MetaInflection; query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; } export interface ProvisionTableRecord { outTableId?: string | null; @@ -10758,6 +11156,8 @@ export interface MetaField { isPrimaryKey: boolean; isForeignKey: boolean; description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; } /** Information about a database index */ export interface MetaIndex { @@ -10823,6 +11223,36 @@ export interface MetaQuery { update?: string | null; delete?: string | null; } +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} /** Information about a PostgreSQL type */ export interface MetaType { pgType: string; @@ -10832,6 +11262,13 @@ export interface MetaType { hasDefault?: boolean | null; subtype?: string | null; } +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} /** Reference to a related table */ export interface MetaRefTable { name: string; @@ -10865,3 +11302,28 @@ export interface MetaManyToManyRelation { rightKeyAttributes: MetaField[]; rightTable: MetaRefTable; } +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/modules/types.ts b/sdk/constructive-react/src/modules/types.ts index e4db9150f0..3cdbc9e2af 100644 --- a/sdk/constructive-react/src/modules/types.ts +++ b/sdk/constructive-react/src/modules/types.ts @@ -326,8 +326,6 @@ export interface GraphModule { prefix: string | null; merkleStoreModuleId: string | null; graphsTableId: string | null; - executionsTableId: string | null; - outputsTableId: string | null; apiName: string | null; privateApiName: string | null; entityTableId: string | null; @@ -484,26 +482,6 @@ export interface InvitesModule { apiName: string | null; privateApiName: string | null; } -export interface NamespaceModule { - id: string | null; - databaseId: string | null; - schemaId: string | null; - privateSchemaId: string | null; - publicSchemaName: string | null; - privateSchemaName: string | null; - namespacesTableId: string | null; - namespaceEventsTableId: string | null; - namespacesTableName: string | null; - namespaceEventsTableName: string | null; - apiName: string | null; - privateApiName: string | null; - scope: string | null; - prefix: string | null; - entityTableId: string | null; - policies: unknown | null; - provisions: unknown | null; - defaultPermissions: string[] | null; -} export interface ComputeLogModule { id: string | null; databaseId: string | null; @@ -546,6 +524,27 @@ export interface InferenceLogModule { apiName: string | null; privateApiName: string | null; } +export interface NamespaceModule { + id: string | null; + databaseId: string | null; + schemaId: string | null; + privateSchemaId: string | null; + publicSchemaName: string | null; + privateSchemaName: string | null; + namespacesTableId: string | null; + namespaceEventsTableId: string | null; + namespacesTableName: string | null; + namespaceEventsTableName: string | null; + apiName: string | null; + privateApiName: string | null; + scope: string | null; + prefix: string | null; + entityTableId: string | null; + platformNamespacesTableId: string | null; + policies: unknown | null; + provisions: unknown | null; + defaultPermissions: string[] | null; +} export interface StorageLogModule { id: string | null; databaseId: string | null; @@ -588,6 +587,28 @@ export interface TransferLogModule { apiName: string | null; privateApiName: string | null; } +export interface FunctionDeploymentModule { + id: string | null; + databaseId: string | null; + schemaId: string | null; + privateSchemaId: string | null; + publicSchemaName: string | null; + privateSchemaName: string | null; + deploymentsTableId: string | null; + deploymentEventsTableId: string | null; + deploymentsTableName: string | null; + deploymentEventsTableName: string | null; + apiName: string | null; + privateApiName: string | null; + scope: string | null; + prefix: string | null; + entityTableId: string | null; + functionModuleId: string | null; + namespaceModuleId: string | null; + policies: unknown | null; + provisions: unknown | null; + defaultPermissions: string[] | null; +} export interface PlansModule { id: string | null; databaseId: string | null; @@ -659,6 +680,30 @@ export interface DbUsageModule { apiName: string | null; privateApiName: string | null; } +export interface GraphExecutionModule { + id: string | null; + databaseId: string | null; + schemaId: string | null; + privateSchemaId: string | null; + publicSchemaName: string | null; + privateSchemaName: string | null; + graphModuleId: string | null; + scope: string | null; + prefix: string | null; + executionsTableId: string | null; + outputsTableId: string | null; + nodeStatesTableId: string | null; + executionsTableName: string | null; + outputsTableName: string | null; + nodeStatesTableName: string | null; + apiName: string | null; + privateApiName: string | null; + entityTableId: string | null; + policies: unknown | null; + provisions: unknown | null; + defaultPermissions: string[] | null; + createdAt: string | null; +} export interface HierarchyModule { id: string | null; databaseId: string | null; diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts index 2b2513585a..4b3a5ed454 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteCommitMutation.ts @@ -41,6 +41,7 @@ export function useDeleteCommitMutation( Error, { id: string; + databaseId: string; } >, 'mutationFn' @@ -54,6 +55,7 @@ export function useDeleteCommitMutation( Error, { id: string; + databaseId: string; } >; export function useDeleteCommitMutation( @@ -65,6 +67,7 @@ export function useDeleteCommitMutation( Error, { id: string; + databaseId: string; } >, 'mutationFn' @@ -76,11 +79,12 @@ export function useDeleteCommitMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: commitMutationKeys.all, - mutationFn: ({ id }: { id: string }) => + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => getClient() .commit.delete({ where: { id, + databaseId, }, select: args.select, }) diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts index bd423f9659..773c2456e1 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteObjectMutation.ts @@ -41,6 +41,7 @@ export function useDeleteObjectMutation( Error, { id: string; + databaseId: string; } >, 'mutationFn' @@ -54,6 +55,7 @@ export function useDeleteObjectMutation( Error, { id: string; + databaseId: string; } >; export function useDeleteObjectMutation( @@ -65,6 +67,7 @@ export function useDeleteObjectMutation( Error, { id: string; + databaseId: string; } >, 'mutationFn' @@ -76,11 +79,12 @@ export function useDeleteObjectMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: objectMutationKeys.all, - mutationFn: ({ id }: { id: string }) => + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => getClient() .object.delete({ where: { id, + databaseId, }, select: args.select, }) diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts index 12bcafdccb..32cfb9b2ec 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useDeleteRefMutation.ts @@ -41,6 +41,7 @@ export function useDeleteRefMutation( Error, { id: string; + databaseId: string; } >, 'mutationFn' @@ -54,6 +55,7 @@ export function useDeleteRefMutation( Error, { id: string; + databaseId: string; } >; export function useDeleteRefMutation( @@ -65,6 +67,7 @@ export function useDeleteRefMutation( Error, { id: string; + databaseId: string; } >, 'mutationFn' @@ -76,11 +79,12 @@ export function useDeleteRefMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: refMutationKeys.all, - mutationFn: ({ id }: { id: string }) => + mutationFn: ({ id, databaseId }: { id: string; databaseId: string }) => getClient() .ref.delete({ where: { id, + databaseId, }, select: args.select, }) diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts index d29f980cfd..b431e603f2 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateCommitMutation.ts @@ -41,6 +41,7 @@ export function useUpdateCommitMutation( Error, { id: string; + databaseId: string; commitPatch: CommitPatch; } >, @@ -55,6 +56,7 @@ export function useUpdateCommitMutation( Error, { id: string; + databaseId: string; commitPatch: CommitPatch; } >; @@ -67,6 +69,7 @@ export function useUpdateCommitMutation( Error, { id: string; + databaseId: string; commitPatch: CommitPatch; } >, @@ -79,11 +82,20 @@ export function useUpdateCommitMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: commitMutationKeys.all, - mutationFn: ({ id, commitPatch }: { id: string; commitPatch: CommitPatch }) => + mutationFn: ({ + id, + databaseId, + commitPatch, + }: { + id: string; + databaseId: string; + commitPatch: CommitPatch; + }) => getClient() .commit.update({ where: { id, + databaseId, }, data: commitPatch, select: args.select, diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts index 29dd75e3f0..1fcacaaf2c 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateObjectMutation.ts @@ -41,6 +41,7 @@ export function useUpdateObjectMutation( Error, { id: string; + databaseId: string; objectPatch: ObjectPatch; } >, @@ -55,6 +56,7 @@ export function useUpdateObjectMutation( Error, { id: string; + databaseId: string; objectPatch: ObjectPatch; } >; @@ -67,6 +69,7 @@ export function useUpdateObjectMutation( Error, { id: string; + databaseId: string; objectPatch: ObjectPatch; } >, @@ -79,11 +82,20 @@ export function useUpdateObjectMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: objectMutationKeys.all, - mutationFn: ({ id, objectPatch }: { id: string; objectPatch: ObjectPatch }) => + mutationFn: ({ + id, + databaseId, + objectPatch, + }: { + id: string; + databaseId: string; + objectPatch: ObjectPatch; + }) => getClient() .object.update({ where: { id, + databaseId, }, data: objectPatch, select: args.select, diff --git a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts index bbf199a716..6246f15310 100644 --- a/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts +++ b/sdk/constructive-react/src/objects/hooks/mutations/useUpdateRefMutation.ts @@ -41,6 +41,7 @@ export function useUpdateRefMutation( Error, { id: string; + databaseId: string; refPatch: RefPatch; } >, @@ -55,6 +56,7 @@ export function useUpdateRefMutation( Error, { id: string; + databaseId: string; refPatch: RefPatch; } >; @@ -67,6 +69,7 @@ export function useUpdateRefMutation( Error, { id: string; + databaseId: string; refPatch: RefPatch; } >, @@ -79,11 +82,20 @@ export function useUpdateRefMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: refMutationKeys.all, - mutationFn: ({ id, refPatch }: { id: string; refPatch: RefPatch }) => + mutationFn: ({ + id, + databaseId, + refPatch, + }: { + id: string; + databaseId: string; + refPatch: RefPatch; + }) => getClient() .ref.update({ where: { id, + databaseId, }, data: refPatch, select: args.select, diff --git a/sdk/constructive-react/src/objects/orm/models/commit.ts b/sdk/constructive-react/src/objects/orm/models/commit.ts index 70f5c59605..9f20aeeefc 100644 --- a/sdk/constructive-react/src/objects/orm/models/commit.ts +++ b/sdk/constructive-react/src/objects/orm/models/commit.ts @@ -176,6 +176,7 @@ export class CommitModel { S, { id: string; + databaseId: string; }, CommitPatch > & { @@ -196,7 +197,10 @@ export class CommitModel { 'UpdateCommitInput', 'id', 'commitPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class CommitModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -227,6 +232,7 @@ export class CommitModel { 'commit', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteCommitInput', args.select, diff --git a/sdk/constructive-react/src/objects/orm/models/object.ts b/sdk/constructive-react/src/objects/orm/models/object.ts index 8a685b1df7..9470d460f6 100644 --- a/sdk/constructive-react/src/objects/orm/models/object.ts +++ b/sdk/constructive-react/src/objects/orm/models/object.ts @@ -162,6 +162,7 @@ export class ObjectModel { S, { id: string; + databaseId: string; }, ObjectPatch > & { @@ -182,7 +183,10 @@ export class ObjectModel { 'UpdateObjectInput', 'id', 'objectPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -197,6 +201,7 @@ export class ObjectModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -213,6 +218,7 @@ export class ObjectModel { 'object', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteObjectInput', args.select, diff --git a/sdk/constructive-react/src/objects/orm/models/ref.ts b/sdk/constructive-react/src/objects/orm/models/ref.ts index 5c3419d89d..d29b2308a0 100644 --- a/sdk/constructive-react/src/objects/orm/models/ref.ts +++ b/sdk/constructive-react/src/objects/orm/models/ref.ts @@ -176,6 +176,7 @@ export class RefModel { S, { id: string; + databaseId: string; }, RefPatch > & { @@ -196,7 +197,10 @@ export class RefModel { 'UpdateRefInput', 'id', 'refPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class RefModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -227,6 +232,7 @@ export class RefModel { 'ref', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteRefInput', args.select, diff --git a/sdk/constructive-react/src/objects/orm/models/store.ts b/sdk/constructive-react/src/objects/orm/models/store.ts index f80e638901..3e81e5f9ca 100644 --- a/sdk/constructive-react/src/objects/orm/models/store.ts +++ b/sdk/constructive-react/src/objects/orm/models/store.ts @@ -196,7 +196,8 @@ export class StoreModel { 'UpdateStoreInput', 'id', 'storePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/objects/orm/query-builder.ts b/sdk/constructive-react/src/objects/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-react/src/objects/orm/query-builder.ts +++ b/sdk/constructive-react/src/objects/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/src/objects/schema-types.ts b/sdk/constructive-react/src/objects/schema-types.ts index ae4206929a..fa02af917a 100644 --- a/sdk/constructive-react/src/objects/schema-types.ts +++ b/sdk/constructive-react/src/objects/schema-types.ts @@ -608,6 +608,14 @@ export interface MetaTable { relations: MetaRelations; inflection: MetaInflection; query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; } /** Information about a table field/column */ export interface MetaField { @@ -618,6 +626,8 @@ export interface MetaField { isPrimaryKey: boolean; isForeignKey: boolean; description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; } /** Information about a database index */ export interface MetaIndex { @@ -683,6 +693,36 @@ export interface MetaQuery { update?: string | null; delete?: string | null; } +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} /** Information about a PostgreSQL type */ export interface MetaType { pgType: string; @@ -692,6 +732,13 @@ export interface MetaType { hasDefault?: boolean | null; subtype?: string | null; } +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} /** Reference to a related table */ export interface MetaRefTable { name: string; @@ -725,3 +772,28 @@ export interface MetaManyToManyRelation { rightKeyAttributes: MetaField[]; rightTable: MetaRefTable; } +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts index 2c97fe2946..ef8b20c631 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteAppLimitEventMutation.ts @@ -41,6 +41,7 @@ export function useDeleteAppLimitEventMutation( Error, { id: string; + createdAt: string; } >, 'mutationFn' @@ -54,6 +55,7 @@ export function useDeleteAppLimitEventMutation( Error, { id: string; + createdAt: string; } >; export function useDeleteAppLimitEventMutation( @@ -65,6 +67,7 @@ export function useDeleteAppLimitEventMutation( Error, { id: string; + createdAt: string; } >, 'mutationFn' @@ -76,11 +79,12 @@ export function useDeleteAppLimitEventMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: appLimitEventMutationKeys.all, - mutationFn: ({ id }: { id: string }) => + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => getClient() .appLimitEvent.delete({ where: { id, + createdAt, }, select: args.select, }) diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts index a0a4a3b2a7..1ef998e5e2 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useDeleteOrgLimitEventMutation.ts @@ -41,6 +41,7 @@ export function useDeleteOrgLimitEventMutation( Error, { id: string; + createdAt: string; } >, 'mutationFn' @@ -54,6 +55,7 @@ export function useDeleteOrgLimitEventMutation( Error, { id: string; + createdAt: string; } >; export function useDeleteOrgLimitEventMutation( @@ -65,6 +67,7 @@ export function useDeleteOrgLimitEventMutation( Error, { id: string; + createdAt: string; } >, 'mutationFn' @@ -76,11 +79,12 @@ export function useDeleteOrgLimitEventMutation( const queryClient = useQueryClient(); return useMutation({ mutationKey: orgLimitEventMutationKeys.all, - mutationFn: ({ id }: { id: string }) => + mutationFn: ({ id, createdAt }: { id: string; createdAt: string }) => getClient() .orgLimitEvent.delete({ where: { id, + createdAt, }, select: args.select, }) diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts index 7234a1d236..b352e9e1c7 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateAppLimitEventMutation.ts @@ -49,6 +49,7 @@ export function useUpdateAppLimitEventMutation( Error, { id: string; + createdAt: string; appLimitEventPatch: AppLimitEventPatch; } >, @@ -63,6 +64,7 @@ export function useUpdateAppLimitEventMutation( Error, { id: string; + createdAt: string; appLimitEventPatch: AppLimitEventPatch; } >; @@ -75,6 +77,7 @@ export function useUpdateAppLimitEventMutation( Error, { id: string; + createdAt: string; appLimitEventPatch: AppLimitEventPatch; } >, @@ -89,15 +92,18 @@ export function useUpdateAppLimitEventMutation( mutationKey: appLimitEventMutationKeys.all, mutationFn: ({ id, + createdAt, appLimitEventPatch, }: { id: string; + createdAt: string; appLimitEventPatch: AppLimitEventPatch; }) => getClient() .appLimitEvent.update({ where: { id, + createdAt, }, data: appLimitEventPatch, select: args.select, diff --git a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts index 6809f97605..449b2bd66d 100644 --- a/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts +++ b/sdk/constructive-react/src/usage/hooks/mutations/useUpdateOrgLimitEventMutation.ts @@ -49,6 +49,7 @@ export function useUpdateOrgLimitEventMutation( Error, { id: string; + createdAt: string; orgLimitEventPatch: OrgLimitEventPatch; } >, @@ -63,6 +64,7 @@ export function useUpdateOrgLimitEventMutation( Error, { id: string; + createdAt: string; orgLimitEventPatch: OrgLimitEventPatch; } >; @@ -75,6 +77,7 @@ export function useUpdateOrgLimitEventMutation( Error, { id: string; + createdAt: string; orgLimitEventPatch: OrgLimitEventPatch; } >, @@ -89,15 +92,18 @@ export function useUpdateOrgLimitEventMutation( mutationKey: orgLimitEventMutationKeys.all, mutationFn: ({ id, + createdAt, orgLimitEventPatch, }: { id: string; + createdAt: string; orgLimitEventPatch: OrgLimitEventPatch; }) => getClient() .orgLimitEvent.update({ where: { id, + createdAt, }, data: orgLimitEventPatch, select: args.select, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimit.ts b/sdk/constructive-react/src/usage/orm/models/appLimit.ts index 2e109cb07e..e1903aae36 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimit.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimit.ts @@ -196,7 +196,8 @@ export class AppLimitModel { 'UpdateAppLimitInput', 'id', 'appLimitPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts index 3359af7c92..9f93b87628 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCap.ts @@ -196,7 +196,8 @@ export class AppLimitCapModel { 'UpdateAppLimitCapInput', 'id', 'appLimitCapPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts index 0eac9c6f8b..3b0ac8a23b 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCapsDefault.ts @@ -196,7 +196,8 @@ export class AppLimitCapsDefaultModel { 'UpdateAppLimitCapsDefaultInput', 'id', 'appLimitCapsDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts index 87ef262696..7f66c4eb09 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCredit.ts @@ -196,7 +196,8 @@ export class AppLimitCreditModel { 'UpdateAppLimitCreditInput', 'id', 'appLimitCreditPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts index 1d21f2d211..a449fef840 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCode.ts @@ -196,7 +196,8 @@ export class AppLimitCreditCodeModel { 'UpdateAppLimitCreditCodeInput', 'id', 'appLimitCreditCodePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts index ade7d6cdc0..5f37d3fbe0 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCreditCodeItem.ts @@ -198,7 +198,8 @@ export class AppLimitCreditCodeItemModel { 'UpdateAppLimitCreditCodeItemInput', 'id', 'appLimitCreditCodeItemPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts b/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts index f60a8e62f9..582960bd9f 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitCreditRedemption.ts @@ -198,7 +198,8 @@ export class AppLimitCreditRedemptionModel { 'UpdateAppLimitCreditRedemptionInput', 'id', 'appLimitCreditRedemptionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts b/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts index f9df6376e5..f0eb49d31f 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitDefault.ts @@ -196,7 +196,8 @@ export class AppLimitDefaultModel { 'UpdateAppLimitDefaultInput', 'id', 'appLimitDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts b/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts index ef7249f3e9..17fd7e8866 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitEvent.ts @@ -176,6 +176,7 @@ export class AppLimitEventModel { S, { id: string; + createdAt: string; }, AppLimitEventPatch > & { @@ -196,7 +197,10 @@ export class AppLimitEventModel { 'UpdateAppLimitEventInput', 'id', 'appLimitEventPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class AppLimitEventModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class AppLimitEventModel { 'appLimitEvent', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteAppLimitEventInput', args.select, diff --git a/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts b/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts index 8366dd8336..4d31d5490a 100644 --- a/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts +++ b/sdk/constructive-react/src/usage/orm/models/appLimitWarning.ts @@ -196,7 +196,8 @@ export class AppLimitWarningModel { 'UpdateAppLimitWarningInput', 'id', 'appLimitWarningPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimit.ts b/sdk/constructive-react/src/usage/orm/models/orgLimit.ts index 48a3932f23..188531420f 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimit.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimit.ts @@ -196,7 +196,8 @@ export class OrgLimitModel { 'UpdateOrgLimitInput', 'id', 'orgLimitPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts index d74b9e7d92..43f24e6d05 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitAggregate.ts @@ -196,7 +196,8 @@ export class OrgLimitAggregateModel { 'UpdateOrgLimitAggregateInput', 'id', 'orgLimitAggregatePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts index 6755eea460..0877ea93fd 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitCap.ts @@ -196,7 +196,8 @@ export class OrgLimitCapModel { 'UpdateOrgLimitCapInput', 'id', 'orgLimitCapPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts index 7884189152..de62c801b7 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitCapsDefault.ts @@ -196,7 +196,8 @@ export class OrgLimitCapsDefaultModel { 'UpdateOrgLimitCapsDefaultInput', 'id', 'orgLimitCapsDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts index 560f611013..497dd5d807 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitCredit.ts @@ -196,7 +196,8 @@ export class OrgLimitCreditModel { 'UpdateOrgLimitCreditInput', 'id', 'orgLimitCreditPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts index 7e55bfd1f7..3c91177b9c 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitDefault.ts @@ -196,7 +196,8 @@ export class OrgLimitDefaultModel { 'UpdateOrgLimitDefaultInput', 'id', 'orgLimitDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts index 2eb9796e2a..419737757d 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitEvent.ts @@ -176,6 +176,7 @@ export class OrgLimitEventModel { S, { id: string; + createdAt: string; }, OrgLimitEventPatch > & { @@ -196,7 +197,10 @@ export class OrgLimitEventModel { 'UpdateOrgLimitEventInput', 'id', 'orgLimitEventPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class OrgLimitEventModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class OrgLimitEventModel { 'orgLimitEvent', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteOrgLimitEventInput', args.select, diff --git a/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts b/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts index e496b69fef..67d887241a 100644 --- a/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts +++ b/sdk/constructive-react/src/usage/orm/models/orgLimitWarning.ts @@ -196,7 +196,8 @@ export class OrgLimitWarningModel { 'UpdateOrgLimitWarningInput', 'id', 'orgLimitWarningPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-react/src/usage/orm/query-builder.ts b/sdk/constructive-react/src/usage/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-react/src/usage/orm/query-builder.ts +++ b/sdk/constructive-react/src/usage/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-react/src/usage/schema-types.ts b/sdk/constructive-react/src/usage/schema-types.ts index 7ef36822c6..fb2c3b2311 100644 --- a/sdk/constructive-react/src/usage/schema-types.ts +++ b/sdk/constructive-react/src/usage/schema-types.ts @@ -2441,6 +2441,14 @@ export interface MetaTable { relations: MetaRelations; inflection: MetaInflection; query: MetaQuery; + /** Storage metadata (null if not a storage table) */ + storage?: MetaStorage | null; + /** Search metadata (null if no search configured) */ + search?: MetaSearch | null; + /** i18n metadata (null if no @i18n tag) */ + i18n?: MetaI18n | null; + /** Realtime metadata (null if no @realtime tag) */ + realtime?: MetaRealtime | null; } /** Information about a table field/column */ export interface MetaField { @@ -2451,6 +2459,8 @@ export interface MetaField { isPrimaryKey: boolean; isForeignKey: boolean; description?: string | null; + /** Enum metadata if this field has an enum type */ + enumValues?: MetaEnum | null; } /** Information about a database index */ export interface MetaIndex { @@ -2516,6 +2526,36 @@ export interface MetaQuery { update?: string | null; delete?: string | null; } +/** Storage metadata for a table */ +export interface MetaStorage { + /** Whether this table is a storage files table */ + isFilesTable: boolean; + /** Whether this table is a storage buckets table */ + isBucketsTable: boolean; +} +/** Search metadata for a table */ +export interface MetaSearch { + /** Active search algorithms on this table */ + algorithms: string[]; + /** Searchable columns with their algorithm */ + columns: MetaSearchColumn[]; + /** Whether unifiedSearch composite filter is available */ + hasUnifiedSearch: boolean; + /** Per-table search configuration */ + config?: MetaSearchConfig | null; +} +/** i18n metadata for a table with @i18n tag */ +export interface MetaI18n { + /** Name of the translation table */ + translationTable: string; + /** Fields that are translatable */ + translatableFields: MetaI18nField[]; +} +/** Realtime metadata for a table with @realtime tag */ +export interface MetaRealtime { + /** The generated subscription field name (e.g. onPostChanged) */ + subscriptionFieldName: string; +} /** Information about a PostgreSQL type */ export interface MetaType { pgType: string; @@ -2525,6 +2565,13 @@ export interface MetaType { hasDefault?: boolean | null; subtype?: string | null; } +/** Information about a PostgreSQL enum type */ +export interface MetaEnum { + /** The PostgreSQL enum type name */ + name: string; + /** Allowed values for this enum */ + values: string[]; +} /** Reference to a related table */ export interface MetaRefTable { name: string; @@ -2558,3 +2605,28 @@ export interface MetaManyToManyRelation { rightKeyAttributes: MetaField[]; rightTable: MetaRefTable; } +/** A searchable column with its algorithm */ +export interface MetaSearchColumn { + /** Column name (camelCase) */ + name: string; + /** Search algorithm: tsvector, bm25, trgm, or vector */ + algorithm: string; +} +/** Per-table search configuration from @searchConfig smart tag */ +export interface MetaSearchConfig { + /** JSON-encoded per-adapter score weights */ + weights?: string | null; + /** Whether recency boosting is enabled */ + boostRecent: boolean; + /** Field used for recency decay */ + boostRecencyField?: string | null; + /** Exponential decay factor per day */ + boostRecencyDecay?: number | null; +} +/** A translatable field */ +export interface MetaI18nField { + /** GraphQL field name */ + name: string; + /** PostgreSQL column type (text, citext) */ + type: string; +} diff --git a/sdk/constructive-sdk/README.md b/sdk/constructive-sdk/README.md index 5fbe99712f..8826051f79 100644 --- a/sdk/constructive-sdk/README.md +++ b/sdk/constructive-sdk/README.md @@ -14,6 +14,8 @@ | agent | - | ORM | [./src/agent/README.md](./src/agent/README.md) | | api | - | ORM | [./src/api/README.md](./src/api/README.md) | | auth | - | ORM | [./src/auth/README.md](./src/auth/README.md) | +| compute | - | ORM | [./src/compute/README.md](./src/compute/README.md) | +| config | - | ORM | [./src/config/README.md](./src/config/README.md) | | modules | - | ORM | [./src/modules/README.md](./src/modules/README.md) | | objects | - | ORM | [./src/objects/README.md](./src/objects/README.md) | | usage | - | ORM | [./src/usage/README.md](./src/usage/README.md) | diff --git a/sdk/constructive-sdk/schemas/admin.graphql b/sdk/constructive-sdk/schemas/admin.graphql index 97f515ddad..ee491e162f 100644 --- a/sdk/constructive-sdk/schemas/admin.graphql +++ b/sdk/constructive-sdk/schemas/admin.graphql @@ -4961,6 +4961,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -4972,6 +4984,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -4984,6 +4999,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -5093,6 +5117,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ diff --git a/sdk/constructive-sdk/schemas/agent.graphql b/sdk/constructive-sdk/schemas/agent.graphql index 198d5da9ea..72163d43a9 100644 --- a/sdk/constructive-sdk/schemas/agent.graphql +++ b/sdk/constructive-sdk/schemas/agent.graphql @@ -2420,7 +2420,8 @@ input AgentResourceFilter { """ Composite unified search. Provide a search string and it will be dispatched to all text-compatible search algorithms (tsvector, BM25, pg_trgm) - simultaneously. Rows matching ANY algorithm are returned. All matching score + simultaneously. When the LLM plugin is active, pgvector also participates via + auto-embedding. Rows matching ANY algorithm are returned. All matching score fields are populated. """ unifiedSearch: String @@ -2647,6 +2648,11 @@ input VectorNearbyInput { When true (default for tables with @hasChunks), transparently queries the chunks table and returns the minimum distance across parent + all chunks. Set to false to only search the parent embedding. """ includeChunks: Boolean + + """ + Natural language text to embed server-side for similarity search. Mutually exclusive with `vector` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. + """ + text: String } """Similarity metric for vector search""" @@ -2857,6 +2863,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -2868,6 +2886,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -2880,6 +2901,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -2989,6 +3019,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ @@ -3590,6 +3692,11 @@ input AgentResourceChunkInput { metadata: JSON createdAt: Datetime updatedAt: Datetime + + """ + Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. + """ + embeddingText: String } """The output of our create `AgentPersona` mutation.""" @@ -3811,6 +3918,11 @@ input AgentResourceInput { """@@behavior -insert -update""" embeddingUpdatedAt: Datetime + + """ + Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. + """ + embeddingText: String } """The output of our update `AgentPlan` mutation.""" @@ -4210,6 +4322,11 @@ input AgentResourceChunkPatch { metadata: JSON createdAt: Datetime updatedAt: Datetime + + """ + Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. + """ + embeddingText: String } """The output of our update `AgentPersona` mutation.""" @@ -4446,6 +4563,11 @@ input AgentResourcePatch { """@@behavior -insert -update""" embeddingUpdatedAt: Datetime + + """ + Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. + """ + embeddingText: String } """The output of our delete `AgentPlan` mutation.""" diff --git a/sdk/constructive-sdk/schemas/api.graphql b/sdk/constructive-sdk/schemas/api.graphql index 78a8d5693c..a135cb5868 100644 --- a/sdk/constructive-sdk/schemas/api.graphql +++ b/sdk/constructive-sdk/schemas/api.graphql @@ -1104,35 +1104,6 @@ type Query { orderBy: [SiteOrderBy!] = [PRIMARY_KEY_ASC] ): SiteConnection - """Reads and enables pagination through a set of `Schema`.""" - schemas( - """Only read the first `n` values of the set.""" - first: Int - - """Only read the last `n` values of the set.""" - last: Int - - """ - Skip the first `n` values from our `after` cursor, an alternative to cursor - based pagination. May not be used with `last`. - """ - offset: Int - - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: SchemaFilter - - """The method to use when ordering `Schema`.""" - orderBy: [SchemaOrderBy!] = [PRIMARY_KEY_ASC] - ): SchemaConnection - """Reads and enables pagination through a set of `Index`.""" indices( """Only read the first `n` values of the set.""" @@ -1278,6 +1249,35 @@ type Query { orderBy: [AstMigrationOrderBy!] = [NATURAL] ): AstMigrationConnection + """Reads and enables pagination through a set of `Schema`.""" + schemas( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: SchemaFilter + + """The method to use when ordering `Schema`.""" + orderBy: [SchemaOrderBy!] = [PRIMARY_KEY_ASC] + ): SchemaConnection + """Reads and enables pagination through a set of `Field`.""" fields( """Only read the first `n` values of the set.""" @@ -2516,6 +2516,7 @@ type Schema { scope: Int tags: [String]! isPublic: Boolean! + apiExposure: ApiExposureLevel! createdAt: Datetime updatedAt: Datetime @@ -2764,6 +2765,12 @@ enum ObjectCategory { APP } +enum ApiExposureLevel { + EXPOSABLE + INTERNAL_ONLY + NEVER_EXPOSE +} + """A connection to a list of `Table` values.""" type TableConnection { """A list of `Table` objects.""" @@ -4227,6 +4234,9 @@ input SchemaFilter { """Filter by the object’s `isPublic` field.""" isPublic: BooleanFilter + """Filter by the object’s `apiExposure` field.""" + apiExposure: ApiExposureLevelFilter + """Filter by the object’s `createdAt` field.""" createdAt: DatetimeFilter @@ -4336,6 +4346,48 @@ input BooleanFilter { greaterThanOrEqualTo: Boolean } +""" +A filter to be used against ApiExposureLevel fields. All fields are combined with a logical ‘and.’ +""" +input ApiExposureLevelFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: ApiExposureLevel + + """Not equal to the specified value.""" + notEqualTo: ApiExposureLevel + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: ApiExposureLevel + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: ApiExposureLevel + + """Included in the specified list.""" + in: [ApiExposureLevel!] + + """Not included in the specified list.""" + notIn: [ApiExposureLevel!] + + """Less than the specified value.""" + lessThan: ApiExposureLevel + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: ApiExposureLevel + + """Greater than the specified value.""" + greaterThan: ApiExposureLevel + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: ApiExposureLevel +} + """ A filter to be used against many `Table` object types. All fields are combined with a logical ‘and.’ """ @@ -11029,6 +11081,8 @@ enum SchemaOrderBy { TAGS_DESC IS_PUBLIC_ASC IS_PUBLIC_DESC + API_EXPOSURE_ASC + API_EXPOSURE_DESC CREATED_AT_ASC CREATED_AT_DESC UPDATED_AT_ASC @@ -12534,6 +12588,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -12545,6 +12611,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -12557,6 +12626,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -12666,6 +12744,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ @@ -13025,14 +13175,6 @@ type Mutation { input: CreateSiteInput! ): CreateSitePayload - """Creates a single `Schema`.""" - createSchema( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateSchemaInput! - ): CreateSchemaPayload - """Creates a single `Index`.""" createIndex( """ @@ -13073,6 +13215,14 @@ type Mutation { input: CreateAstMigrationInput! ): CreateAstMigrationPayload + """Creates a single `Schema`.""" + createSchema( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateSchemaInput! + ): CreateSchemaPayload + """Creates a single `Field`.""" createField( """ @@ -13379,14 +13529,6 @@ type Mutation { input: UpdateSiteInput! ): UpdateSitePayload - """Updates a single `Schema` using a unique key and a patch.""" - updateSchema( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateSchemaInput! - ): UpdateSchemaPayload - """Updates a single `Index` using a unique key and a patch.""" updateIndex( """ @@ -13421,6 +13563,14 @@ type Mutation { input: UpdateWebauthnSettingInput! ): UpdateWebauthnSettingPayload + """Updates a single `Schema` using a unique key and a patch.""" + updateSchema( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateSchemaInput! + ): UpdateSchemaPayload + """Updates a single `Field` using a unique key and a patch.""" updateField( """ @@ -13725,14 +13875,6 @@ type Mutation { input: DeleteSiteInput! ): DeleteSitePayload - """Deletes a single `Schema` using a unique key.""" - deleteSchema( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteSchemaInput! - ): DeleteSchemaPayload - """Deletes a single `Index` using a unique key.""" deleteIndex( """ @@ -13765,6 +13907,14 @@ type Mutation { input: DeleteWebauthnSettingInput! ): DeleteWebauthnSettingPayload + """Deletes a single `Schema` using a unique key.""" + deleteSchema( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteSchemaInput! + ): DeleteSchemaPayload + """Deletes a single `Field` using a unique key.""" deleteField( """ @@ -16146,58 +16296,6 @@ input SiteInput { dbname: String } -"""The output of our create `Schema` mutation.""" -type CreateSchemaPayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `Schema` that was created by this mutation.""" - schema: Schema - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `Schema`. May be used by Relay 1.""" - schemaEdge( - """The method to use when ordering `Schema`.""" - orderBy: [SchemaOrderBy!]! = [PRIMARY_KEY_ASC] - ): SchemaEdge -} - -"""All input for the create `Schema` mutation.""" -input CreateSchemaInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """The `Schema` to be created by this mutation.""" - schema: SchemaInput! -} - -"""An input for mutations affecting `Schema`""" -input SchemaInput { - id: UUID - databaseId: UUID! - name: String! - schemaName: String! - label: String - description: String - smartTags: JSON - category: ObjectCategory - scope: Int - tags: [String] - isPublic: Boolean - createdAt: Datetime - updatedAt: Datetime -} - """The output of our create `Index` mutation.""" type CreateIndexPayload { """ @@ -16519,6 +16617,59 @@ input AstMigrationInput { actorId: UUID } +"""The output of our create `Schema` mutation.""" +type CreateSchemaPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `Schema` that was created by this mutation.""" + schema: Schema + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `Schema`. May be used by Relay 1.""" + schemaEdge( + """The method to use when ordering `Schema`.""" + orderBy: [SchemaOrderBy!]! = [PRIMARY_KEY_ASC] + ): SchemaEdge +} + +"""All input for the create `Schema` mutation.""" +input CreateSchemaInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `Schema` to be created by this mutation.""" + schema: SchemaInput! +} + +"""An input for mutations affecting `Schema`""" +input SchemaInput { + id: UUID + databaseId: UUID! + name: String! + schemaName: String! + label: String + description: String + smartTags: JSON + category: ObjectCategory + scope: Int + tags: [String] + isPublic: Boolean + apiExposure: ApiExposureLevel + createdAt: Datetime + updatedAt: Datetime +} + """The output of our create `Field` mutation.""" type CreateFieldPayload { """ @@ -18866,63 +19017,6 @@ input SitePatch { logoUpload: Upload } -"""The output of our update `Schema` mutation.""" -type UpdateSchemaPayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `Schema` that was updated by this mutation.""" - schema: Schema - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `Schema`. May be used by Relay 1.""" - schemaEdge( - """The method to use when ordering `Schema`.""" - orderBy: [SchemaOrderBy!]! = [PRIMARY_KEY_ASC] - ): SchemaEdge -} - -"""All input for the `updateSchema` mutation.""" -input UpdateSchemaInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! - - """ - An object where the defined keys will be set on the `Schema` being updated. - """ - schemaPatch: SchemaPatch! -} - -""" -Represents an update to a `Schema`. Fields that are set will be updated. -""" -input SchemaPatch { - id: UUID - databaseId: UUID - name: String - schemaName: String - label: String - description: String - smartTags: JSON - category: ObjectCategory - scope: Int - tags: [String] - isPublic: Boolean - createdAt: Datetime - updatedAt: Datetime -} - """The output of our update `Index` mutation.""" type UpdateIndexPayload { """ @@ -19220,6 +19314,64 @@ input WebauthnSettingPatch { challengeExpirySeconds: BigInt } +"""The output of our update `Schema` mutation.""" +type UpdateSchemaPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `Schema` that was updated by this mutation.""" + schema: Schema + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `Schema`. May be used by Relay 1.""" + schemaEdge( + """The method to use when ordering `Schema`.""" + orderBy: [SchemaOrderBy!]! = [PRIMARY_KEY_ASC] + ): SchemaEdge +} + +"""All input for the `updateSchema` mutation.""" +input UpdateSchemaInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `Schema` being updated. + """ + schemaPatch: SchemaPatch! +} + +""" +Represents an update to a `Schema`. Fields that are set will be updated. +""" +input SchemaPatch { + id: UUID + databaseId: UUID + name: String + schemaName: String + label: String + description: String + smartTags: JSON + category: ObjectCategory + scope: Int + tags: [String] + isPublic: Boolean + apiExposure: ApiExposureLevel + createdAt: Datetime + updatedAt: Datetime +} + """The output of our update `Field` mutation.""" type UpdateFieldPayload { """ @@ -20568,39 +20720,6 @@ input DeleteSiteInput { id: UUID! } -"""The output of our delete `Schema` mutation.""" -type DeleteSchemaPayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `Schema` that was deleted by this mutation.""" - schema: Schema - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `Schema`. May be used by Relay 1.""" - schemaEdge( - """The method to use when ordering `Schema`.""" - orderBy: [SchemaOrderBy!]! = [PRIMARY_KEY_ASC] - ): SchemaEdge -} - -"""All input for the `deleteSchema` mutation.""" -input DeleteSchemaInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! -} - """The output of our delete `Index` mutation.""" type DeleteIndexPayload { """ @@ -20735,6 +20854,39 @@ input DeleteWebauthnSettingInput { id: UUID! } +"""The output of our delete `Schema` mutation.""" +type DeleteSchemaPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `Schema` that was deleted by this mutation.""" + schema: Schema + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `Schema`. May be used by Relay 1.""" + schemaEdge( + """The method to use when ordering `Schema`.""" + orderBy: [SchemaOrderBy!]! = [PRIMARY_KEY_ASC] + ): SchemaEdge +} + +"""All input for the `deleteSchema` mutation.""" +input DeleteSchemaInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + """The output of our delete `Field` mutation.""" type DeleteFieldPayload { """ diff --git a/sdk/constructive-sdk/schemas/auth.graphql b/sdk/constructive-sdk/schemas/auth.graphql index f90fa0afc6..69d407d14e 100644 --- a/sdk/constructive-sdk/schemas/auth.graphql +++ b/sdk/constructive-sdk/schemas/auth.graphql @@ -1053,7 +1053,8 @@ input UserFilter { """ Composite unified search. Provide a search string and it will be dispatched to all text-compatible search algorithms (tsvector, BM25, pg_trgm) - simultaneously. Rows matching ANY algorithm are returned. All matching score + simultaneously. When the LLM plugin is active, pgvector also participates via + auto-embedding. Rows matching ANY algorithm are returned. All matching score fields are populated. """ unifiedSearch: String @@ -2698,6 +2699,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -2709,6 +2722,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -2721,6 +2737,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -2830,6 +2855,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ diff --git a/sdk/constructive-sdk/schemas/compute.graphql b/sdk/constructive-sdk/schemas/compute.graphql new file mode 100644 index 0000000000..fc805077ac --- /dev/null +++ b/sdk/constructive-sdk/schemas/compute.graphql @@ -0,0 +1,8284 @@ +"""The root query type which gives access points into the data universe.""" +type Query { + readFunctionGraph(graphId: UUID): JSON + + """Reads and enables pagination through a set of `GetAllRecord`.""" + getAll( + sId: UUID + id: UUID + + """Only read the first `n` values of the set.""" + first: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set after (below) this cursor.""" + after: Cursor + ): GetAllConnection + getNodeAtPath(sId: UUID, id: UUID, path: [String]): FunctionGraphObject + + """Reads and enables pagination through a set of `FunctionApiBinding`.""" + functionApiBindings( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionApiBindingFilter + + """The method to use when ordering `FunctionApiBinding`.""" + orderBy: [FunctionApiBindingOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionApiBindingConnection + + """Reads and enables pagination through a set of `FunctionGraphRef`.""" + functionGraphRefs( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphRefFilter + + """The method to use when ordering `FunctionGraphRef`.""" + orderBy: [FunctionGraphRefOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphRefConnection + + """Reads and enables pagination through a set of `FunctionGraphStore`.""" + functionGraphStores( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphStoreFilter + + """The method to use when ordering `FunctionGraphStore`.""" + orderBy: [FunctionGraphStoreOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphStoreConnection + + """Reads and enables pagination through a set of `FunctionGraphObject`.""" + functionGraphObjects( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphObjectFilter + + """The method to use when ordering `FunctionGraphObject`.""" + orderBy: [FunctionGraphObjectOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphObjectConnection + + """ + Reads and enables pagination through a set of `FunctionDeploymentEvent`. + """ + functionDeploymentEvents( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionDeploymentEventFilter + + """The method to use when ordering `FunctionDeploymentEvent`.""" + orderBy: [FunctionDeploymentEventOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionDeploymentEventConnection + + """ + Reads and enables pagination through a set of `OrgFunctionExecutionLog`. + """ + orgFunctionExecutionLogs( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: OrgFunctionExecutionLogFilter + + """The method to use when ordering `OrgFunctionExecutionLog`.""" + orderBy: [OrgFunctionExecutionLogOrderBy!] = [PRIMARY_KEY_ASC] + ): OrgFunctionExecutionLogConnection + + """ + Reads and enables pagination through a set of `FunctionGraphExecutionOutput`. + """ + functionGraphExecutionOutputs( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphExecutionOutputFilter + + """The method to use when ordering `FunctionGraphExecutionOutput`.""" + orderBy: [FunctionGraphExecutionOutputOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionOutputConnection + + """Reads and enables pagination through a set of `FunctionGraphCommit`.""" + functionGraphCommits( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphCommitFilter + + """The method to use when ordering `FunctionGraphCommit`.""" + orderBy: [FunctionGraphCommitOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphCommitConnection + + """Reads and enables pagination through a set of `SecretDefinition`.""" + secretDefinitions( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: SecretDefinitionFilter + + """The method to use when ordering `SecretDefinition`.""" + orderBy: [SecretDefinitionOrderBy!] = [PRIMARY_KEY_ASC] + ): SecretDefinitionConnection + + """Reads and enables pagination through a set of `FunctionExecutionLog`.""" + functionExecutionLogs( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionExecutionLogFilter + + """The method to use when ordering `FunctionExecutionLog`.""" + orderBy: [FunctionExecutionLogOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionExecutionLogConnection + + """ + Reads and enables pagination through a set of `FunctionGraphExecutionNodeState`. + """ + functionGraphExecutionNodeStates( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphExecutionNodeStateFilter + + """The method to use when ordering `FunctionGraphExecutionNodeState`.""" + orderBy: [FunctionGraphExecutionNodeStateOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionNodeStateConnection + + """Reads and enables pagination through a set of `FunctionGraph`.""" + functionGraphs( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphFilter + + """The method to use when ordering `FunctionGraph`.""" + orderBy: [FunctionGraphOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphConnection + + """Reads and enables pagination through a set of `OrgFunctionInvocation`.""" + orgFunctionInvocations( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: OrgFunctionInvocationFilter + + """The method to use when ordering `OrgFunctionInvocation`.""" + orderBy: [OrgFunctionInvocationOrderBy!] = [PRIMARY_KEY_ASC] + ): OrgFunctionInvocationConnection + + """Reads and enables pagination through a set of `FunctionInvocation`.""" + functionInvocations( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionInvocationFilter + + """The method to use when ordering `FunctionInvocation`.""" + orderBy: [FunctionInvocationOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionInvocationConnection + + """Reads and enables pagination through a set of `FunctionDeployment`.""" + functionDeployments( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionDeploymentFilter + + """The method to use when ordering `FunctionDeployment`.""" + orderBy: [FunctionDeploymentOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionDeploymentConnection + + """ + Reads and enables pagination through a set of `FunctionGraphExecution`. + """ + functionGraphExecutions( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionGraphExecutionFilter + + """The method to use when ordering `FunctionGraphExecution`.""" + orderBy: [FunctionGraphExecutionOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionConnection + + """Reads and enables pagination through a set of `FunctionDefinition`.""" + functionDefinitions( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionDefinitionFilter + + """The method to use when ordering `FunctionDefinition`.""" + orderBy: [FunctionDefinitionOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionDefinitionConnection + + """ + Metadata about the database schema, including tables, fields, indexes, and constraints. Useful for code generation tools. + """ + _meta: MetaSchema +} + +""" +Represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON + +""" +A universally unique identifier as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). +""" +scalar UUID + +"""A connection to a list of `GetAllRecord` values.""" +type GetAllConnection { + """A list of `GetAllRecord` objects.""" + nodes: [GetAllRecord]! + + """ + A list of edges which contains the `GetAllRecord` and cursor to aid in pagination. + """ + edges: [GetAllEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `GetAllRecord` you could get from the connection.""" + totalCount: Int! +} + +type GetAllRecord { + path: [String] + data: JSON +} + +"""A `GetAllRecord` edge in the connection.""" +type GetAllEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `GetAllRecord` at the end of the edge.""" + node: GetAllRecord +} + +"""A location in a connection that can be used for resuming pagination.""" +scalar Cursor + +"""Information about pagination in a connection.""" +type PageInfo { + """When paginating forwards, are there more items?""" + hasNextPage: Boolean! + + """When paginating backwards, are there more items?""" + hasPreviousPage: Boolean! + + """When paginating backwards, the cursor to continue.""" + startCursor: Cursor + + """When paginating forwards, the cursor to continue.""" + endCursor: Cursor +} + +""" +Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children +""" +type FunctionGraphObject { + """Content-addressed UUID v5 — deterministic hash of (data, kids, ktree)""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Ordered array of child object IDs""" + kids: [UUID] + + """Ordered array of child path names (parallel to kids)""" + ktree: [String] + + """Payload data for this object node""" + data: JSON + + """Timestamp of object creation""" + createdAt: Datetime +} + +""" +A point in time as described by the [ISO +8601](https://en.wikipedia.org/wiki/ISO_8601) and, if it has a timezone, [RFC +3339](https://datatracker.ietf.org/doc/html/rfc3339) standards. Input values +that do not conform to both ISO 8601 and RFC 3339 may be coerced, which may lead +to unexpected results. +""" +scalar Datetime + +"""A connection to a list of `FunctionApiBinding` values.""" +type FunctionApiBindingConnection { + """A list of `FunctionApiBinding` objects.""" + nodes: [FunctionApiBinding]! + + """ + A list of edges which contains the `FunctionApiBinding` and cursor to aid in pagination. + """ + edges: [FunctionApiBindingEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionApiBinding` you could get from the connection. + """ + totalCount: Int! +} + +""" +Join table binding function definitions to API endpoints with per-binding alias and config +""" +type FunctionApiBinding { + id: UUID! + + """Function definition this binding belongs to""" + functionDefinitionId: UUID! + + """API endpoint this function is bound to""" + apiId: UUID! + + """Binding alias (e.g. default, staging, production)""" + alias: String! + + """Per-binding configuration (overrides, routing rules, etc.)""" + config: JSON! + + """ + Reads a single `FunctionDefinition` that is related to this `FunctionApiBinding`. + """ + functionDefinition: FunctionDefinition +} + +""" +Function definitions — registered cloud functions with routing, queue, and retry configuration +""" +type FunctionDefinition { + id: UUID! + createdAt: Datetime + updatedAt: Datetime + + """Function grouping scope (e.g. email, embed, chunk, custom)""" + scope: String! + + """ + Function name within scope (e.g. send_verification_link, process_file_embedding) + """ + name: String! + + """ + Computed routing slug: scope:name (used by Knative job worker for dispatch) + """ + taskIdentifier: String! + + """Human-readable description of what this function does""" + description: String + + """ + Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() + """ + isInvocable: Boolean! + + """Maximum retry attempts for the underlying job""" + maxAttempts: Int! + + """Job priority (lower = higher priority)""" + priority: Int! + + """Job queue name for serialization (e.g. email, ai, default)""" + queueName: String! + + """ + Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) + """ + runtime: String! + + """ + Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. + """ + image: String + + """ + Knative containerConcurrency — max concurrent requests per pod instance + """ + concurrency: Int! + + """Minimum pod count for Knative autoscaling (minScale)""" + scaleMin: Int! + + """Maximum pod count for Knative autoscaling (maxScale)""" + scaleMax: Int! + + """Knative request timeout in seconds""" + timeoutSeconds: Int! + + """ + Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} + """ + resources: JSON! + + """ + Whether this function is a built-in platform function (synced from platform) vs user-created + """ + isBuiltIn: Boolean! + + """Embedded secret requirements: array of (name, required) tuples""" + requiredSecrets: [FunctionRequirement]! + + """Embedded config requirements: array of (name, required) tuples""" + requiredConfigs: [FunctionRequirement]! + + """ + Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. + """ + requiredBuckets: [String]! + + """ + Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. + """ + requiredModels: [String]! + + """ + Data input ports: [{name, type, description?, optional?, multi?, schema?}] + """ + inputs: JSON! + + """ + Data output ports: [{name, type, description?, optional?, multi?, schema?}] + """ + outputs: JSON! + + """ + Configuration properties: [{name, type, default?, description?, required?, schema?}] + """ + props: JSON! + + """ + Whether this function has side effects and cannot be cached or memoized + """ + volatile: Boolean! + + """Icon identifier for UI palette rendering (e.g. mail, database, code)""" + icon: String + + """Palette grouping category (e.g. email, data, ai, custom)""" + category: String + + """Reads and enables pagination through a set of `FunctionApiBinding`.""" + functionApiBindings( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionApiBindingFilter + + """The method to use when ordering `FunctionApiBinding`.""" + orderBy: [FunctionApiBindingOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionApiBindingConnection! + + """Reads and enables pagination through a set of `FunctionDeployment`.""" + functionDeployments( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: FunctionDeploymentFilter + + """The method to use when ordering `FunctionDeployment`.""" + orderBy: [FunctionDeploymentOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionDeploymentConnection! +} + +type FunctionRequirement { + name: String + required: Boolean +} + +""" +A filter to be used against `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionApiBindingFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `functionDefinitionId` field.""" + functionDefinitionId: UUIDFilter + + """Filter by the object’s `apiId` field.""" + apiId: UUIDFilter + + """Filter by the object’s `alias` field.""" + alias: StringFilter + + """Filter by the object’s `config` field.""" + config: JSONFilter + + """Checks for all expressions in this list.""" + and: [FunctionApiBindingFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionApiBindingFilter!] + + """Negates the expression.""" + not: FunctionApiBindingFilter + + """Filter by the object’s `functionDefinition` relation.""" + functionDefinition: FunctionDefinitionFilter +} + +""" +A filter to be used against UUID fields. All fields are combined with a logical ‘and.’ +""" +input UUIDFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: UUID + + """Not equal to the specified value.""" + notEqualTo: UUID + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: UUID + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: UUID + + """Included in the specified list.""" + in: [UUID!] + + """Not included in the specified list.""" + notIn: [UUID!] + + """Less than the specified value.""" + lessThan: UUID + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: UUID + + """Greater than the specified value.""" + greaterThan: UUID + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: UUID +} + +""" +A filter to be used against String fields. All fields are combined with a logical ‘and.’ +""" +input StringFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: String + + """Not equal to the specified value.""" + notEqualTo: String + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: String + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: String + + """Included in the specified list.""" + in: [String!] + + """Not included in the specified list.""" + notIn: [String!] + + """Less than the specified value.""" + lessThan: String + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: String + + """Greater than the specified value.""" + greaterThan: String + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: String + + """Contains the specified string (case-sensitive).""" + includes: String + + """Does not contain the specified string (case-sensitive).""" + notIncludes: String + + """Contains the specified string (case-insensitive).""" + includesInsensitive: String + + """Does not contain the specified string (case-insensitive).""" + notIncludesInsensitive: String + + """Starts with the specified string (case-sensitive).""" + startsWith: String + + """Does not start with the specified string (case-sensitive).""" + notStartsWith: String + + """Starts with the specified string (case-insensitive).""" + startsWithInsensitive: String + + """Does not start with the specified string (case-insensitive).""" + notStartsWithInsensitive: String + + """Ends with the specified string (case-sensitive).""" + endsWith: String + + """Does not end with the specified string (case-sensitive).""" + notEndsWith: String + + """Ends with the specified string (case-insensitive).""" + endsWithInsensitive: String + + """Does not end with the specified string (case-insensitive).""" + notEndsWithInsensitive: String + + """ + Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + like: String + + """ + Does not match the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + notLike: String + + """ + Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + likeInsensitive: String + + """ + Does not match the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + notLikeInsensitive: String + + """Equal to the specified value (case-insensitive).""" + equalToInsensitive: String + + """Not equal to the specified value (case-insensitive).""" + notEqualToInsensitive: String + + """ + Not equal to the specified value, treating null like an ordinary value (case-insensitive). + """ + distinctFromInsensitive: String + + """ + Equal to the specified value, treating null like an ordinary value (case-insensitive). + """ + notDistinctFromInsensitive: String + + """Included in the specified list (case-insensitive).""" + inInsensitive: [String!] + + """Not included in the specified list (case-insensitive).""" + notInInsensitive: [String!] + + """Less than the specified value (case-insensitive).""" + lessThanInsensitive: String + + """Less than or equal to the specified value (case-insensitive).""" + lessThanOrEqualToInsensitive: String + + """Greater than the specified value (case-insensitive).""" + greaterThanInsensitive: String + + """Greater than or equal to the specified value (case-insensitive).""" + greaterThanOrEqualToInsensitive: String +} + +""" +A filter to be used against JSON fields. All fields are combined with a logical ‘and.’ +""" +input JSONFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: JSON + + """Not equal to the specified value.""" + notEqualTo: JSON + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: JSON + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: JSON + + """Included in the specified list.""" + in: [JSON!] + + """Not included in the specified list.""" + notIn: [JSON!] + + """Less than the specified value.""" + lessThan: JSON + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: JSON + + """Greater than the specified value.""" + greaterThan: JSON + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: JSON + + """Contains the specified JSON.""" + contains: JSON + + """Contains the specified key.""" + containsKey: String + + """Contains all of the specified keys.""" + containsAllKeys: [String!] + + """Contains any of the specified keys.""" + containsAnyKeys: [String!] + + """Contained by the specified JSON.""" + containedBy: JSON +} + +""" +A filter to be used against `FunctionDefinition` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionDefinitionFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `updatedAt` field.""" + updatedAt: DatetimeFilter + + """Filter by the object’s `scope` field.""" + scope: StringFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `taskIdentifier` field.""" + taskIdentifier: StringFilter + + """Filter by the object’s `description` field.""" + description: StringFilter + + """Filter by the object’s `isInvocable` field.""" + isInvocable: BooleanFilter + + """Filter by the object’s `maxAttempts` field.""" + maxAttempts: IntFilter + + """Filter by the object’s `priority` field.""" + priority: IntFilter + + """Filter by the object’s `queueName` field.""" + queueName: StringFilter + + """Filter by the object’s `runtime` field.""" + runtime: StringFilter + + """Filter by the object’s `image` field.""" + image: StringFilter + + """Filter by the object’s `concurrency` field.""" + concurrency: IntFilter + + """Filter by the object’s `scaleMin` field.""" + scaleMin: IntFilter + + """Filter by the object’s `scaleMax` field.""" + scaleMax: IntFilter + + """Filter by the object’s `timeoutSeconds` field.""" + timeoutSeconds: IntFilter + + """Filter by the object’s `resources` field.""" + resources: JSONFilter + + """Filter by the object’s `isBuiltIn` field.""" + isBuiltIn: BooleanFilter + + """Filter by the object’s `requiredBuckets` field.""" + requiredBuckets: StringListFilter + + """Filter by the object’s `requiredModels` field.""" + requiredModels: StringListFilter + + """Filter by the object’s `inputs` field.""" + inputs: JSONFilter + + """Filter by the object’s `outputs` field.""" + outputs: JSONFilter + + """Filter by the object’s `props` field.""" + props: JSONFilter + + """Filter by the object’s `volatile` field.""" + volatile: BooleanFilter + + """Filter by the object’s `icon` field.""" + icon: StringFilter + + """Filter by the object’s `category` field.""" + category: StringFilter + + """Checks for all expressions in this list.""" + and: [FunctionDefinitionFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionDefinitionFilter!] + + """Negates the expression.""" + not: FunctionDefinitionFilter + + """Filter by the object’s `functionApiBindings` relation.""" + functionApiBindings: FunctionDefinitionToManyFunctionApiBindingFilter + + """`functionApiBindings` exist.""" + functionApiBindingsExist: Boolean + + """Filter by the object’s `functionDeployments` relation.""" + functionDeployments: FunctionDefinitionToManyFunctionDeploymentFilter + + """`functionDeployments` exist.""" + functionDeploymentsExist: Boolean +} + +""" +A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ +""" +input DatetimeFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: Datetime + + """Not equal to the specified value.""" + notEqualTo: Datetime + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Datetime + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Datetime + + """Included in the specified list.""" + in: [Datetime!] + + """Not included in the specified list.""" + notIn: [Datetime!] + + """Less than the specified value.""" + lessThan: Datetime + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: Datetime + + """Greater than the specified value.""" + greaterThan: Datetime + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: Datetime +} + +""" +A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ +""" +input BooleanFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: Boolean + + """Not equal to the specified value.""" + notEqualTo: Boolean + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Boolean + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Boolean + + """Included in the specified list.""" + in: [Boolean!] + + """Not included in the specified list.""" + notIn: [Boolean!] + + """Less than the specified value.""" + lessThan: Boolean + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: Boolean + + """Greater than the specified value.""" + greaterThan: Boolean + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: Boolean +} + +""" +A filter to be used against Int fields. All fields are combined with a logical ‘and.’ +""" +input IntFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: Int + + """Not equal to the specified value.""" + notEqualTo: Int + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Int + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Int + + """Included in the specified list.""" + in: [Int!] + + """Not included in the specified list.""" + notIn: [Int!] + + """Less than the specified value.""" + lessThan: Int + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: Int + + """Greater than the specified value.""" + greaterThan: Int + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: Int +} + +""" +A filter to be used against String List fields. All fields are combined with a logical ‘and.’ +""" +input StringListFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: [String] + + """Not equal to the specified value.""" + notEqualTo: [String] + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: [String] + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: [String] + + """Less than the specified value.""" + lessThan: [String] + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: [String] + + """Greater than the specified value.""" + greaterThan: [String] + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: [String] + + """Contains the specified list of values.""" + contains: [String] + + """Contained by the specified list of values.""" + containedBy: [String] + + """Overlaps the specified list of values.""" + overlaps: [String] + + """Any array item is equal to the specified value.""" + anyEqualTo: String + + """Any array item is not equal to the specified value.""" + anyNotEqualTo: String + + """Any array item is less than the specified value.""" + anyLessThan: String + + """Any array item is less than or equal to the specified value.""" + anyLessThanOrEqualTo: String + + """Any array item is greater than the specified value.""" + anyGreaterThan: String + + """Any array item is greater than or equal to the specified value.""" + anyGreaterThanOrEqualTo: String +} + +""" +A filter to be used against many `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionDefinitionToManyFunctionApiBindingFilter { + """Filters to entities where at least one related entity matches.""" + some: FunctionApiBindingFilter + + """Filters to entities where every related entity matches.""" + every: FunctionApiBindingFilter + + """Filters to entities where no related entity matches.""" + none: FunctionApiBindingFilter +} + +""" +A filter to be used against many `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionDefinitionToManyFunctionDeploymentFilter { + """Filters to entities where at least one related entity matches.""" + some: FunctionDeploymentFilter + + """Filters to entities where every related entity matches.""" + every: FunctionDeploymentFilter + + """Filters to entities where no related entity matches.""" + none: FunctionDeploymentFilter +} + +""" +A filter to be used against `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionDeploymentFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `updatedAt` field.""" + updatedAt: DatetimeFilter + + """Filter by the object’s `functionDefinitionId` field.""" + functionDefinitionId: UUIDFilter + + """Filter by the object’s `namespaceId` field.""" + namespaceId: UUIDFilter + + """Filter by the object’s `status` field.""" + status: StringFilter + + """Filter by the object’s `serviceUrl` field.""" + serviceUrl: StringFilter + + """Filter by the object’s `serviceName` field.""" + serviceName: StringFilter + + """Filter by the object’s `revision` field.""" + revision: IntFilter + + """Filter by the object’s `image` field.""" + image: StringFilter + + """Filter by the object’s `concurrency` field.""" + concurrency: IntFilter + + """Filter by the object’s `scaleMin` field.""" + scaleMin: IntFilter + + """Filter by the object’s `scaleMax` field.""" + scaleMax: IntFilter + + """Filter by the object’s `timeoutSeconds` field.""" + timeoutSeconds: IntFilter + + """Filter by the object’s `resources` field.""" + resources: JSONFilter + + """Filter by the object’s `lastError` field.""" + lastError: StringFilter + + """Filter by the object’s `lastErrorAt` field.""" + lastErrorAt: DatetimeFilter + + """Filter by the object’s `errorCount` field.""" + errorCount: IntFilter + + """Filter by the object’s `labels` field.""" + labels: JSONFilter + + """Filter by the object’s `annotations` field.""" + annotations: JSONFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [FunctionDeploymentFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionDeploymentFilter!] + + """Negates the expression.""" + not: FunctionDeploymentFilter + + """Filter by the object’s `functionDefinition` relation.""" + functionDefinition: FunctionDefinitionFilter +} + +"""Methods to use when ordering `FunctionApiBinding`.""" +enum FunctionApiBindingOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + FUNCTION_DEFINITION_ID_ASC + FUNCTION_DEFINITION_ID_DESC + API_ID_ASC + API_ID_DESC + ALIAS_ASC + ALIAS_DESC + CONFIG_ASC + CONFIG_DESC +} + +"""A connection to a list of `FunctionDeployment` values.""" +type FunctionDeploymentConnection { + """A list of `FunctionDeployment` objects.""" + nodes: [FunctionDeployment]! + + """ + A list of edges which contains the `FunctionDeployment` and cursor to aid in pagination. + """ + edges: [FunctionDeploymentEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionDeployment` you could get from the connection. + """ + totalCount: Int! +} + +""" +Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing +""" +type FunctionDeployment { + id: UUID! + createdAt: Datetime + updatedAt: Datetime + + """Function definition being deployed to this namespace""" + functionDefinitionId: UUID! + + """Target namespace for this deployment (maps to a K8s namespace)""" + namespaceId: UUID! + + """ + Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated + """ + status: String! + + """ + Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning + """ + serviceUrl: String + + """Knative service name — derived from task_identifier at provision time""" + serviceName: String + + """Deployment revision number (incremented on each redeployment)""" + revision: Int! + + """Container image override (NULL = inherit from function definition)""" + image: String + + """Max concurrent requests per pod (NULL = inherit from definition)""" + concurrency: Int + + """ + Minimum replica count (NULL = inherit from definition or Knative default) + """ + scaleMin: Int + + """ + Maximum replica count (NULL = inherit from definition or Knative default) + """ + scaleMax: Int + + """Request timeout override in seconds (NULL = inherit from definition)""" + timeoutSeconds: Int + + """ + K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} + """ + resources: JSON + + """Most recent provisioning or runtime error message""" + lastError: String + + """Timestamp of the most recent error""" + lastErrorAt: Datetime + + """Cumulative error count for this deployment""" + errorCount: Int! + + """Key/value pairs for selecting and filtering deployments""" + labels: JSON! + + """Freeform metadata for tooling and operational notes""" + annotations: JSON! + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! + + """ + Reads a single `FunctionDefinition` that is related to this `FunctionDeployment`. + """ + functionDefinition: FunctionDefinition +} + +"""A `FunctionDeployment` edge in the connection.""" +type FunctionDeploymentEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionDeployment` at the end of the edge.""" + node: FunctionDeployment +} + +"""Methods to use when ordering `FunctionDeployment`.""" +enum FunctionDeploymentOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + FUNCTION_DEFINITION_ID_ASC + FUNCTION_DEFINITION_ID_DESC + NAMESPACE_ID_ASC + NAMESPACE_ID_DESC + STATUS_ASC + STATUS_DESC + SERVICE_URL_ASC + SERVICE_URL_DESC + SERVICE_NAME_ASC + SERVICE_NAME_DESC + REVISION_ASC + REVISION_DESC + IMAGE_ASC + IMAGE_DESC + CONCURRENCY_ASC + CONCURRENCY_DESC + SCALE_MIN_ASC + SCALE_MIN_DESC + SCALE_MAX_ASC + SCALE_MAX_DESC + TIMEOUT_SECONDS_ASC + TIMEOUT_SECONDS_DESC + RESOURCES_ASC + RESOURCES_DESC + LAST_ERROR_ASC + LAST_ERROR_DESC + LAST_ERROR_AT_ASC + LAST_ERROR_AT_DESC + ERROR_COUNT_ASC + ERROR_COUNT_DESC + LABELS_ASC + LABELS_DESC + ANNOTATIONS_ASC + ANNOTATIONS_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC +} + +"""A `FunctionApiBinding` edge in the connection.""" +type FunctionApiBindingEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionApiBinding` at the end of the edge.""" + node: FunctionApiBinding +} + +"""A connection to a list of `FunctionGraphRef` values.""" +type FunctionGraphRefConnection { + """A list of `FunctionGraphRef` objects.""" + nodes: [FunctionGraphRef]! + + """ + A list of edges which contains the `FunctionGraphRef` and cursor to aid in pagination. + """ + edges: [FunctionGraphRefEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionGraphRef` you could get from the connection. + """ + totalCount: Int! +} + +"""Branch heads — mutable pointers into the commit chain""" +type FunctionGraphRef { + """Unique ref identifier""" + id: UUID! + + """Ref name (e.g. HEAD, main)""" + name: String! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Store this ref belongs to""" + storeId: UUID! + + """Commit this ref points to""" + commitId: UUID +} + +"""A `FunctionGraphRef` edge in the connection.""" +type FunctionGraphRefEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraphRef` at the end of the edge.""" + node: FunctionGraphRef +} + +""" +A filter to be used against `FunctionGraphRef` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphRefFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `storeId` field.""" + storeId: UUIDFilter + + """Filter by the object’s `commitId` field.""" + commitId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphRefFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphRefFilter!] + + """Negates the expression.""" + not: FunctionGraphRefFilter +} + +"""Methods to use when ordering `FunctionGraphRef`.""" +enum FunctionGraphRefOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + NAME_ASC + NAME_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + STORE_ID_ASC + STORE_ID_DESC + COMMIT_ID_ASC + COMMIT_ID_DESC +} + +"""A connection to a list of `FunctionGraphStore` values.""" +type FunctionGraphStoreConnection { + """A list of `FunctionGraphStore` objects.""" + nodes: [FunctionGraphStore]! + + """ + A list of edges which contains the `FunctionGraphStore` and cursor to aid in pagination. + """ + edges: [FunctionGraphStoreEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionGraphStore` you could get from the connection. + """ + totalCount: Int! +} + +""" +Named stores — one per version-controlled tree (e.g. one graph, one definition set) +""" +type FunctionGraphStore { + """Unique store identifier""" + id: UUID! + + """Human-readable store name""" + name: String! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Current root object hash of this store""" + hash: UUID + + """Timestamp of store creation""" + createdAt: Datetime +} + +"""A `FunctionGraphStore` edge in the connection.""" +type FunctionGraphStoreEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraphStore` at the end of the edge.""" + node: FunctionGraphStore +} + +""" +A filter to be used against `FunctionGraphStore` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphStoreFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `hash` field.""" + hash: UUIDFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphStoreFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphStoreFilter!] + + """Negates the expression.""" + not: FunctionGraphStoreFilter +} + +"""Methods to use when ordering `FunctionGraphStore`.""" +enum FunctionGraphStoreOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + NAME_ASC + NAME_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + HASH_ASC + HASH_DESC + CREATED_AT_ASC + CREATED_AT_DESC +} + +"""A connection to a list of `FunctionGraphObject` values.""" +type FunctionGraphObjectConnection { + """A list of `FunctionGraphObject` objects.""" + nodes: [FunctionGraphObject]! + + """ + A list of edges which contains the `FunctionGraphObject` and cursor to aid in pagination. + """ + edges: [FunctionGraphObjectEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionGraphObject` you could get from the connection. + """ + totalCount: Int! +} + +"""A `FunctionGraphObject` edge in the connection.""" +type FunctionGraphObjectEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraphObject` at the end of the edge.""" + node: FunctionGraphObject +} + +""" +A filter to be used against `FunctionGraphObject` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphObjectFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `kids` field.""" + kids: UUIDListFilter + + """Filter by the object’s `ktree` field.""" + ktree: StringListFilter + + """Filter by the object’s `data` field.""" + data: JSONFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphObjectFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphObjectFilter!] + + """Negates the expression.""" + not: FunctionGraphObjectFilter +} + +""" +A filter to be used against UUID List fields. All fields are combined with a logical ‘and.’ +""" +input UUIDListFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: [UUID] + + """Not equal to the specified value.""" + notEqualTo: [UUID] + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: [UUID] + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: [UUID] + + """Less than the specified value.""" + lessThan: [UUID] + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: [UUID] + + """Greater than the specified value.""" + greaterThan: [UUID] + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: [UUID] + + """Contains the specified list of values.""" + contains: [UUID] + + """Contained by the specified list of values.""" + containedBy: [UUID] + + """Overlaps the specified list of values.""" + overlaps: [UUID] + + """Any array item is equal to the specified value.""" + anyEqualTo: UUID + + """Any array item is not equal to the specified value.""" + anyNotEqualTo: UUID + + """Any array item is less than the specified value.""" + anyLessThan: UUID + + """Any array item is less than or equal to the specified value.""" + anyLessThanOrEqualTo: UUID + + """Any array item is greater than the specified value.""" + anyGreaterThan: UUID + + """Any array item is greater than or equal to the specified value.""" + anyGreaterThanOrEqualTo: UUID +} + +"""Methods to use when ordering `FunctionGraphObject`.""" +enum FunctionGraphObjectOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + KIDS_ASC + KIDS_DESC + KTREE_ASC + KTREE_DESC + DATA_ASC + DATA_DESC + CREATED_AT_ASC + CREATED_AT_DESC +} + +"""A connection to a list of `FunctionDeploymentEvent` values.""" +type FunctionDeploymentEventConnection { + """A list of `FunctionDeploymentEvent` objects.""" + nodes: [FunctionDeploymentEvent]! + + """ + A list of edges which contains the `FunctionDeploymentEvent` and cursor to aid in pagination. + """ + edges: [FunctionDeploymentEventEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionDeploymentEvent` you could get from the connection. + """ + totalCount: Int! +} + +""" +Deployment lifecycle events — audit log of provisioning, scaling, and failure events +""" +type FunctionDeploymentEvent { + """Event timestamp (partition key)""" + createdAt: Datetime! + + """Unique event identifier""" + id: UUID! + + """Deployment this event belongs to""" + deploymentId: UUID! + + """ + Event type: provisioned, scaled, failed, deactivated, redeployed, health_check + """ + eventType: String! + + """User who triggered this event (NULL for system/automated)""" + actorId: UUID + + """Human-readable description of the event""" + message: String + + """Structured context (old/new values, error details, etc.)""" + metadata: JSON + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! +} + +"""A `FunctionDeploymentEvent` edge in the connection.""" +type FunctionDeploymentEventEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionDeploymentEvent` at the end of the edge.""" + node: FunctionDeploymentEvent +} + +""" +A filter to be used against `FunctionDeploymentEvent` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionDeploymentEventFilter { + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `deploymentId` field.""" + deploymentId: UUIDFilter + + """Filter by the object’s `eventType` field.""" + eventType: StringFilter + + """Filter by the object’s `actorId` field.""" + actorId: UUIDFilter + + """Filter by the object’s `message` field.""" + message: StringFilter + + """Filter by the object’s `metadata` field.""" + metadata: JSONFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [FunctionDeploymentEventFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionDeploymentEventFilter!] + + """Negates the expression.""" + not: FunctionDeploymentEventFilter +} + +"""Methods to use when ordering `FunctionDeploymentEvent`.""" +enum FunctionDeploymentEventOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + DEPLOYMENT_ID_ASC + DEPLOYMENT_ID_DESC + EVENT_TYPE_ASC + EVENT_TYPE_DESC + ACTOR_ID_ASC + ACTOR_ID_DESC + MESSAGE_ASC + MESSAGE_DESC + METADATA_ASC + METADATA_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC +} + +"""A connection to a list of `OrgFunctionExecutionLog` values.""" +type OrgFunctionExecutionLogConnection { + """A list of `OrgFunctionExecutionLog` objects.""" + nodes: [OrgFunctionExecutionLog]! + + """ + A list of edges which contains the `OrgFunctionExecutionLog` and cursor to aid in pagination. + """ + edges: [OrgFunctionExecutionLogEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `OrgFunctionExecutionLog` you could get from the connection. + """ + totalCount: Int! +} + +"""Function execution logs — structured console output per invocation""" +type OrgFunctionExecutionLog { + """Log entry timestamp (partition key)""" + createdAt: Datetime! + + """Unique log entry identifier""" + id: UUID! + + """Invocation this log entry belongs to (NULL for standalone job logs)""" + invocationId: UUID + + """Function routing key (NULL for generic job logs)""" + taskIdentifier: String + + """Log severity: debug, info, warn, error""" + logLevel: String! + + """Log message text""" + message: String! + + """Structured context (labels, trace data, extra fields)""" + metadata: JSON + + """User who triggered the execution (NULL for system/cron)""" + actorId: UUID +} + +"""A `OrgFunctionExecutionLog` edge in the connection.""" +type OrgFunctionExecutionLogEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `OrgFunctionExecutionLog` at the end of the edge.""" + node: OrgFunctionExecutionLog +} + +""" +A filter to be used against `OrgFunctionExecutionLog` object types. All fields are combined with a logical ‘and.’ +""" +input OrgFunctionExecutionLogFilter { + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `invocationId` field.""" + invocationId: UUIDFilter + + """Filter by the object’s `taskIdentifier` field.""" + taskIdentifier: StringFilter + + """Filter by the object’s `logLevel` field.""" + logLevel: StringFilter + + """Filter by the object’s `message` field.""" + message: StringFilter + + """Filter by the object’s `metadata` field.""" + metadata: JSONFilter + + """Filter by the object’s `actorId` field.""" + actorId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [OrgFunctionExecutionLogFilter!] + + """Checks for any expressions in this list.""" + or: [OrgFunctionExecutionLogFilter!] + + """Negates the expression.""" + not: OrgFunctionExecutionLogFilter +} + +"""Methods to use when ordering `OrgFunctionExecutionLog`.""" +enum OrgFunctionExecutionLogOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + INVOCATION_ID_ASC + INVOCATION_ID_DESC + TASK_IDENTIFIER_ASC + TASK_IDENTIFIER_DESC + LOG_LEVEL_ASC + LOG_LEVEL_DESC + MESSAGE_ASC + MESSAGE_DESC + METADATA_ASC + METADATA_DESC + ACTOR_ID_ASC + ACTOR_ID_DESC +} + +"""A connection to a list of `FunctionGraphExecutionOutput` values.""" +type FunctionGraphExecutionOutputConnection { + """A list of `FunctionGraphExecutionOutput` objects.""" + nodes: [FunctionGraphExecutionOutput]! + + """ + A list of edges which contains the `FunctionGraphExecutionOutput` and cursor to aid in pagination. + """ + edges: [FunctionGraphExecutionOutputEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionGraphExecutionOutput` you could get from the connection. + """ + totalCount: Int! +} + +""" +Content-addressed store for execution outputs — hash-referenced from node_outputs +""" +type FunctionGraphExecutionOutput { + """Timestamp of output creation""" + createdAt: Datetime! + + """Unique execution output identifier""" + id: UUID! + + """Scope for multi-tenant isolation""" + databaseId: UUID! + + """SHA-256 hash of the data JSONB — content-addressed deduplication""" + hash: Base64EncodedBinary! + + """The actual output payload from a completed node""" + data: JSON! +} + +"""Binary data encoded using Base64""" +scalar Base64EncodedBinary + +"""A `FunctionGraphExecutionOutput` edge in the connection.""" +type FunctionGraphExecutionOutputEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraphExecutionOutput` at the end of the edge.""" + node: FunctionGraphExecutionOutput +} + +""" +A filter to be used against `FunctionGraphExecutionOutput` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphExecutionOutputFilter { + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `hash` field.""" + hash: Base64EncodedBinaryFilter + + """Filter by the object’s `data` field.""" + data: JSONFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphExecutionOutputFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphExecutionOutputFilter!] + + """Negates the expression.""" + not: FunctionGraphExecutionOutputFilter +} + +""" +A filter to be used against Base64EncodedBinary fields. All fields are combined with a logical ‘and.’ +""" +input Base64EncodedBinaryFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: Base64EncodedBinary + + """Not equal to the specified value.""" + notEqualTo: Base64EncodedBinary + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Base64EncodedBinary + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Base64EncodedBinary + + """Included in the specified list.""" + in: [Base64EncodedBinary!] + + """Not included in the specified list.""" + notIn: [Base64EncodedBinary!] +} + +"""Methods to use when ordering `FunctionGraphExecutionOutput`.""" +enum FunctionGraphExecutionOutputOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + HASH_ASC + HASH_DESC + DATA_ASC + DATA_DESC +} + +"""A connection to a list of `FunctionGraphCommit` values.""" +type FunctionGraphCommitConnection { + """A list of `FunctionGraphCommit` objects.""" + nodes: [FunctionGraphCommit]! + + """ + A list of edges which contains the `FunctionGraphCommit` and cursor to aid in pagination. + """ + edges: [FunctionGraphCommitEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionGraphCommit` you could get from the connection. + """ + totalCount: Int! +} + +"""Commit history — each commit snapshots a tree root for a store""" +type FunctionGraphCommit { + """Unique commit identifier""" + id: UUID! + + """Optional commit message""" + message: String + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Store this commit belongs to""" + storeId: UUID! + + """Parent commit IDs (supports merge commits)""" + parentIds: [UUID] + + """User who authored the changes""" + authorId: UUID + + """User who committed (may differ from author)""" + committerId: UUID + + """Root object ID of the tree snapshot at this commit""" + treeId: UUID + + """Commit timestamp""" + date: Datetime! +} + +"""A `FunctionGraphCommit` edge in the connection.""" +type FunctionGraphCommitEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraphCommit` at the end of the edge.""" + node: FunctionGraphCommit +} + +""" +A filter to be used against `FunctionGraphCommit` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphCommitFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `message` field.""" + message: StringFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `storeId` field.""" + storeId: UUIDFilter + + """Filter by the object’s `parentIds` field.""" + parentIds: UUIDListFilter + + """Filter by the object’s `authorId` field.""" + authorId: UUIDFilter + + """Filter by the object’s `committerId` field.""" + committerId: UUIDFilter + + """Filter by the object’s `treeId` field.""" + treeId: UUIDFilter + + """Filter by the object’s `date` field.""" + date: DatetimeFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphCommitFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphCommitFilter!] + + """Negates the expression.""" + not: FunctionGraphCommitFilter +} + +"""Methods to use when ordering `FunctionGraphCommit`.""" +enum FunctionGraphCommitOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + MESSAGE_ASC + MESSAGE_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + STORE_ID_ASC + STORE_ID_DESC + PARENT_IDS_ASC + PARENT_IDS_DESC + AUTHOR_ID_ASC + AUTHOR_ID_DESC + COMMITTER_ID_ASC + COMMITTER_ID_DESC + TREE_ID_ASC + TREE_ID_DESC + DATE_ASC + DATE_DESC +} + +"""A connection to a list of `SecretDefinition` values.""" +type SecretDefinitionConnection { + """A list of `SecretDefinition` objects.""" + nodes: [SecretDefinition]! + + """ + A list of edges which contains the `SecretDefinition` and cursor to aid in pagination. + """ + edges: [SecretDefinitionEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `SecretDefinition` you could get from the connection. + """ + totalCount: Int! +} + +""" +Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. +""" +type SecretDefinition { + id: UUID! + createdAt: Datetime + updatedAt: Datetime + + """Secret name (must match app_secrets.name for resolution)""" + name: String! + + """Human-readable description of what this secret is used for""" + description: String + + """ + Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. + """ + isBuiltIn: Boolean! + + """Key-value metadata for filtering and grouping secret definitions""" + labels: JSON! + + """Freeform metadata annotations for secret definitions""" + annotations: JSON! + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! +} + +"""A `SecretDefinition` edge in the connection.""" +type SecretDefinitionEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `SecretDefinition` at the end of the edge.""" + node: SecretDefinition +} + +""" +A filter to be used against `SecretDefinition` object types. All fields are combined with a logical ‘and.’ +""" +input SecretDefinitionFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `updatedAt` field.""" + updatedAt: DatetimeFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `description` field.""" + description: StringFilter + + """Filter by the object’s `isBuiltIn` field.""" + isBuiltIn: BooleanFilter + + """Filter by the object’s `labels` field.""" + labels: JSONFilter + + """Filter by the object’s `annotations` field.""" + annotations: JSONFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [SecretDefinitionFilter!] + + """Checks for any expressions in this list.""" + or: [SecretDefinitionFilter!] + + """Negates the expression.""" + not: SecretDefinitionFilter +} + +"""Methods to use when ordering `SecretDefinition`.""" +enum SecretDefinitionOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + NAME_ASC + NAME_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + IS_BUILT_IN_ASC + IS_BUILT_IN_DESC + LABELS_ASC + LABELS_DESC + ANNOTATIONS_ASC + ANNOTATIONS_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC +} + +"""A connection to a list of `FunctionExecutionLog` values.""" +type FunctionExecutionLogConnection { + """A list of `FunctionExecutionLog` objects.""" + nodes: [FunctionExecutionLog]! + + """ + A list of edges which contains the `FunctionExecutionLog` and cursor to aid in pagination. + """ + edges: [FunctionExecutionLogEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionExecutionLog` you could get from the connection. + """ + totalCount: Int! +} + +"""Function execution logs — structured console output per invocation""" +type FunctionExecutionLog { + """Log entry timestamp (partition key)""" + createdAt: Datetime! + + """Unique log entry identifier""" + id: UUID! + + """Invocation this log entry belongs to (NULL for standalone job logs)""" + invocationId: UUID + + """Function routing key (NULL for generic job logs)""" + taskIdentifier: String + + """Log severity: debug, info, warn, error""" + logLevel: String! + + """Log message text""" + message: String! + + """Structured context (labels, trace data, extra fields)""" + metadata: JSON + + """User who triggered the execution (NULL for system/cron)""" + actorId: UUID + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! +} + +"""A `FunctionExecutionLog` edge in the connection.""" +type FunctionExecutionLogEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionExecutionLog` at the end of the edge.""" + node: FunctionExecutionLog +} + +""" +A filter to be used against `FunctionExecutionLog` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionExecutionLogFilter { + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `invocationId` field.""" + invocationId: UUIDFilter + + """Filter by the object’s `taskIdentifier` field.""" + taskIdentifier: StringFilter + + """Filter by the object’s `logLevel` field.""" + logLevel: StringFilter + + """Filter by the object’s `message` field.""" + message: StringFilter + + """Filter by the object’s `metadata` field.""" + metadata: JSONFilter + + """Filter by the object’s `actorId` field.""" + actorId: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [FunctionExecutionLogFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionExecutionLogFilter!] + + """Negates the expression.""" + not: FunctionExecutionLogFilter +} + +"""Methods to use when ordering `FunctionExecutionLog`.""" +enum FunctionExecutionLogOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + INVOCATION_ID_ASC + INVOCATION_ID_DESC + TASK_IDENTIFIER_ASC + TASK_IDENTIFIER_DESC + LOG_LEVEL_ASC + LOG_LEVEL_DESC + MESSAGE_ASC + MESSAGE_DESC + METADATA_ASC + METADATA_DESC + ACTOR_ID_ASC + ACTOR_ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC +} + +"""A connection to a list of `FunctionGraphExecutionNodeState` values.""" +type FunctionGraphExecutionNodeStateConnection { + """A list of `FunctionGraphExecutionNodeState` objects.""" + nodes: [FunctionGraphExecutionNodeState]! + + """ + A list of edges which contains the `FunctionGraphExecutionNodeState` and cursor to aid in pagination. + """ + edges: [FunctionGraphExecutionNodeStateEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionGraphExecutionNodeState` you could get from the connection. + """ + totalCount: Int! +} + +""" +Per-node execution state — tracks individual node lifecycle for debugging +""" +type FunctionGraphExecutionNodeState { + """Timestamp of node state creation (partition key)""" + createdAt: Datetime! + + """Unique node state identifier""" + id: UUID! + + """FK to the parent graph execution""" + executionId: UUID! + + """Scope for multi-tenant isolation""" + databaseId: UUID! + + """Name of the node within the graph (e.g. send-email1)""" + nodeName: String! + + """ + Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking + """ + nodePath: [String] + + """Node lifecycle: pending → queued → running → completed/failed""" + status: String! + + """Timestamp when the node began executing""" + startedAt: Datetime + + """Timestamp when the node finished (success or failure)""" + completedAt: Datetime + + """Machine-readable error code when status = failed""" + errorCode: String + + """Human-readable error description when status = failed""" + errorMessage: String + + """FK to execution_outputs — content-addressed output blob for this node""" + outputId: UUID +} + +"""A `FunctionGraphExecutionNodeState` edge in the connection.""" +type FunctionGraphExecutionNodeStateEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraphExecutionNodeState` at the end of the edge.""" + node: FunctionGraphExecutionNodeState +} + +""" +A filter to be used against `FunctionGraphExecutionNodeState` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphExecutionNodeStateFilter { + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `executionId` field.""" + executionId: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `nodeName` field.""" + nodeName: StringFilter + + """Filter by the object’s `nodePath` field.""" + nodePath: StringListFilter + + """Filter by the object’s `status` field.""" + status: StringFilter + + """Filter by the object’s `startedAt` field.""" + startedAt: DatetimeFilter + + """Filter by the object’s `completedAt` field.""" + completedAt: DatetimeFilter + + """Filter by the object’s `errorCode` field.""" + errorCode: StringFilter + + """Filter by the object’s `errorMessage` field.""" + errorMessage: StringFilter + + """Filter by the object’s `outputId` field.""" + outputId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphExecutionNodeStateFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphExecutionNodeStateFilter!] + + """Negates the expression.""" + not: FunctionGraphExecutionNodeStateFilter +} + +"""Methods to use when ordering `FunctionGraphExecutionNodeState`.""" +enum FunctionGraphExecutionNodeStateOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + EXECUTION_ID_ASC + EXECUTION_ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + NODE_NAME_ASC + NODE_NAME_DESC + NODE_PATH_ASC + NODE_PATH_DESC + STATUS_ASC + STATUS_DESC + STARTED_AT_ASC + STARTED_AT_DESC + COMPLETED_AT_ASC + COMPLETED_AT_DESC + ERROR_CODE_ASC + ERROR_CODE_DESC + ERROR_MESSAGE_ASC + ERROR_MESSAGE_DESC + OUTPUT_ID_ASC + OUTPUT_ID_DESC +} + +"""A connection to a list of `FunctionGraph` values.""" +type FunctionGraphConnection { + """A list of `FunctionGraph` objects.""" + nodes: [FunctionGraph]! + + """ + A list of edges which contains the `FunctionGraph` and cursor to aid in pagination. + """ + edges: [FunctionGraphEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `FunctionGraph` you could get from the connection.""" + totalCount: Int! +} + +""" +Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store +""" +type FunctionGraph { + """Unique graph identifier""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Graph store (Merkle store) holding the graph definition""" + storeId: UUID! + + """Entity context (org/team) for scoped billing""" + entityId: UUID + + """Evaluator/runtime context (function, js, sql, system)""" + context: String! + + """Graph name (unique per database)""" + name: String! + + """Human-readable description of the graph""" + description: String + + """Pinned definitions store commit for deterministic evaluation""" + definitionsCommitId: UUID + + """Whether graph passes structural validation""" + isValid: Boolean! + + """Array of validation error objects when is_valid = false""" + validationErrors: JSON + + """Actor who created this graph""" + createdBy: UUID + + """Timestamp of graph creation""" + createdAt: Datetime! + + """Timestamp of last modification""" + updatedAt: Datetime! +} + +"""A `FunctionGraph` edge in the connection.""" +type FunctionGraphEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraph` at the end of the edge.""" + node: FunctionGraph +} + +""" +A filter to be used against `FunctionGraph` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `storeId` field.""" + storeId: UUIDFilter + + """Filter by the object’s `entityId` field.""" + entityId: UUIDFilter + + """Filter by the object’s `context` field.""" + context: StringFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `description` field.""" + description: StringFilter + + """Filter by the object’s `definitionsCommitId` field.""" + definitionsCommitId: UUIDFilter + + """Filter by the object’s `isValid` field.""" + isValid: BooleanFilter + + """Filter by the object’s `validationErrors` field.""" + validationErrors: JSONFilter + + """Filter by the object’s `createdBy` field.""" + createdBy: UUIDFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `updatedAt` field.""" + updatedAt: DatetimeFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphFilter!] + + """Negates the expression.""" + not: FunctionGraphFilter +} + +"""Methods to use when ordering `FunctionGraph`.""" +enum FunctionGraphOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + STORE_ID_ASC + STORE_ID_DESC + ENTITY_ID_ASC + ENTITY_ID_DESC + CONTEXT_ASC + CONTEXT_DESC + NAME_ASC + NAME_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + DEFINITIONS_COMMIT_ID_ASC + DEFINITIONS_COMMIT_ID_DESC + IS_VALID_ASC + IS_VALID_DESC + VALIDATION_ERRORS_ASC + VALIDATION_ERRORS_DESC + CREATED_BY_ASC + CREATED_BY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC +} + +"""A connection to a list of `OrgFunctionInvocation` values.""" +type OrgFunctionInvocationConnection { + """A list of `OrgFunctionInvocation` objects.""" + nodes: [OrgFunctionInvocation]! + + """ + A list of edges which contains the `OrgFunctionInvocation` and cursor to aid in pagination. + """ + edges: [OrgFunctionInvocationEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `OrgFunctionInvocation` you could get from the connection. + """ + totalCount: Int! +} + +""" +Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. +""" +type OrgFunctionInvocation { + """Invocation creation timestamp (partition key)""" + createdAt: Datetime! + + """Unique invocation identifier""" + id: UUID! + + """Who triggered the invocation (NULL for system/cron)""" + actorId: UUID + + """ + Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. + """ + taskIdentifier: String! + + """Function input payload""" + payload: JSON + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String! + + """Function return value (success) or structured error (failure)""" + result: JSON + + """Error message when status is failed""" + error: String + + """Wall-clock execution time in milliseconds""" + durationMs: Int + + """FK to app_jobs.jobs — the underlying transport""" + jobId: BigInt + + """When execution started""" + startedAt: Datetime + + """When execution completed""" + completedAt: Datetime + + """Parent invocation when this is a child node of a flow graph execution""" + parentInvocationId: UUID + + """Groups all node invocations from a single flow graph execution""" + graphExecutionId: UUID +} + +""" +A signed eight-byte integer. The upper big integer values are greater than the +max value for a JavaScript number. Therefore all big integers will be output as +strings and not numbers. +""" +scalar BigInt + +"""A `OrgFunctionInvocation` edge in the connection.""" +type OrgFunctionInvocationEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `OrgFunctionInvocation` at the end of the edge.""" + node: OrgFunctionInvocation +} + +""" +A filter to be used against `OrgFunctionInvocation` object types. All fields are combined with a logical ‘and.’ +""" +input OrgFunctionInvocationFilter { + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `actorId` field.""" + actorId: UUIDFilter + + """Filter by the object’s `taskIdentifier` field.""" + taskIdentifier: StringFilter + + """Filter by the object’s `payload` field.""" + payload: JSONFilter + + """Filter by the object’s `status` field.""" + status: StringFilter + + """Filter by the object’s `result` field.""" + result: JSONFilter + + """Filter by the object’s `error` field.""" + error: StringFilter + + """Filter by the object’s `durationMs` field.""" + durationMs: IntFilter + + """Filter by the object’s `jobId` field.""" + jobId: BigIntFilter + + """Filter by the object’s `startedAt` field.""" + startedAt: DatetimeFilter + + """Filter by the object’s `completedAt` field.""" + completedAt: DatetimeFilter + + """Filter by the object’s `parentInvocationId` field.""" + parentInvocationId: UUIDFilter + + """Filter by the object’s `graphExecutionId` field.""" + graphExecutionId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [OrgFunctionInvocationFilter!] + + """Checks for any expressions in this list.""" + or: [OrgFunctionInvocationFilter!] + + """Negates the expression.""" + not: OrgFunctionInvocationFilter +} + +""" +A filter to be used against BigInt fields. All fields are combined with a logical ‘and.’ +""" +input BigIntFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: BigInt + + """Not equal to the specified value.""" + notEqualTo: BigInt + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: BigInt + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: BigInt + + """Included in the specified list.""" + in: [BigInt!] + + """Not included in the specified list.""" + notIn: [BigInt!] + + """Less than the specified value.""" + lessThan: BigInt + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: BigInt + + """Greater than the specified value.""" + greaterThan: BigInt + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: BigInt +} + +"""Methods to use when ordering `OrgFunctionInvocation`.""" +enum OrgFunctionInvocationOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + ACTOR_ID_ASC + ACTOR_ID_DESC + TASK_IDENTIFIER_ASC + TASK_IDENTIFIER_DESC + PAYLOAD_ASC + PAYLOAD_DESC + STATUS_ASC + STATUS_DESC + RESULT_ASC + RESULT_DESC + ERROR_ASC + ERROR_DESC + DURATION_MS_ASC + DURATION_MS_DESC + JOB_ID_ASC + JOB_ID_DESC + STARTED_AT_ASC + STARTED_AT_DESC + COMPLETED_AT_ASC + COMPLETED_AT_DESC + PARENT_INVOCATION_ID_ASC + PARENT_INVOCATION_ID_DESC + GRAPH_EXECUTION_ID_ASC + GRAPH_EXECUTION_ID_DESC +} + +"""A connection to a list of `FunctionInvocation` values.""" +type FunctionInvocationConnection { + """A list of `FunctionInvocation` objects.""" + nodes: [FunctionInvocation]! + + """ + A list of edges which contains the `FunctionInvocation` and cursor to aid in pagination. + """ + edges: [FunctionInvocationEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionInvocation` you could get from the connection. + """ + totalCount: Int! +} + +""" +Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. +""" +type FunctionInvocation { + """Invocation creation timestamp (partition key)""" + createdAt: Datetime! + + """Unique invocation identifier""" + id: UUID! + + """Who triggered the invocation (NULL for system/cron)""" + actorId: UUID + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! + + """ + Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. + """ + taskIdentifier: String! + + """Function input payload""" + payload: JSON + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String! + + """Function return value (success) or structured error (failure)""" + result: JSON + + """Error message when status is failed""" + error: String + + """Wall-clock execution time in milliseconds""" + durationMs: Int + + """FK to app_jobs.jobs — the underlying transport""" + jobId: BigInt + + """When execution started""" + startedAt: Datetime + + """When execution completed""" + completedAt: Datetime + + """Parent invocation when this is a child node of a flow graph execution""" + parentInvocationId: UUID + + """Groups all node invocations from a single flow graph execution""" + graphExecutionId: UUID +} + +"""A `FunctionInvocation` edge in the connection.""" +type FunctionInvocationEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionInvocation` at the end of the edge.""" + node: FunctionInvocation +} + +""" +A filter to be used against `FunctionInvocation` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionInvocationFilter { + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `actorId` field.""" + actorId: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `taskIdentifier` field.""" + taskIdentifier: StringFilter + + """Filter by the object’s `payload` field.""" + payload: JSONFilter + + """Filter by the object’s `status` field.""" + status: StringFilter + + """Filter by the object’s `result` field.""" + result: JSONFilter + + """Filter by the object’s `error` field.""" + error: StringFilter + + """Filter by the object’s `durationMs` field.""" + durationMs: IntFilter + + """Filter by the object’s `jobId` field.""" + jobId: BigIntFilter + + """Filter by the object’s `startedAt` field.""" + startedAt: DatetimeFilter + + """Filter by the object’s `completedAt` field.""" + completedAt: DatetimeFilter + + """Filter by the object’s `parentInvocationId` field.""" + parentInvocationId: UUIDFilter + + """Filter by the object’s `graphExecutionId` field.""" + graphExecutionId: UUIDFilter + + """Checks for all expressions in this list.""" + and: [FunctionInvocationFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionInvocationFilter!] + + """Negates the expression.""" + not: FunctionInvocationFilter +} + +"""Methods to use when ordering `FunctionInvocation`.""" +enum FunctionInvocationOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + ACTOR_ID_ASC + ACTOR_ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + TASK_IDENTIFIER_ASC + TASK_IDENTIFIER_DESC + PAYLOAD_ASC + PAYLOAD_DESC + STATUS_ASC + STATUS_DESC + RESULT_ASC + RESULT_DESC + ERROR_ASC + ERROR_DESC + DURATION_MS_ASC + DURATION_MS_DESC + JOB_ID_ASC + JOB_ID_DESC + STARTED_AT_ASC + STARTED_AT_DESC + COMPLETED_AT_ASC + COMPLETED_AT_DESC + PARENT_INVOCATION_ID_ASC + PARENT_INVOCATION_ID_DESC + GRAPH_EXECUTION_ID_ASC + GRAPH_EXECUTION_ID_DESC +} + +"""A connection to a list of `FunctionGraphExecution` values.""" +type FunctionGraphExecutionConnection { + """A list of `FunctionGraphExecution` objects.""" + nodes: [FunctionGraphExecution]! + + """ + A list of edges which contains the `FunctionGraphExecution` and cursor to aid in pagination. + """ + edges: [FunctionGraphExecutionEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionGraphExecution` you could get from the connection. + """ + totalCount: Int! +} + +"""Ephemeral execution state for flow graph evaluation""" +type FunctionGraphExecution { + """Execution start timestamp""" + startedAt: Datetime! + + """Unique execution identifier""" + id: UUID! + + """FK to the graph definition being executed""" + graphId: UUID! + + """Parent function_invocations row (for metering)""" + invocationId: UUID + + """Scope for multi-tenant isolation""" + databaseId: UUID! + + """Entity context (org/team) for scoped billing""" + entityId: UUID + + """Target output boundary node name to resolve""" + outputNode: String! + + """Target output port name (default: value)""" + outputPort: String! + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String! + + """Initial inputs provided at invocation time""" + inputPayload: JSON + + """Final result extracted from terminal output node""" + outputPayload: JSON + + """ + Map of node_name → execution output id (content-addressed hash reference) + """ + nodeOutputs: JSON! + + """Pre-computed topological sort as array of wave objects""" + executionPlan: JSON + + """Index into execution_plan — tick only processes this wave""" + currentWave: Int! + + """Parent execution when this is a sub-execution""" + parentExecutionId: UUID + + """Node name in parent execution that spawned this sub-execution""" + parentNodeName: String + + """Pinned definitions store commit for deterministic evaluation""" + definitionsCommitId: UUID + + """Number of evaluate_step ticks executed""" + tickCount: Int! + + """Execution completion timestamp""" + completedAt: Datetime + + """Maximum ticks before execution is failed (default 100)""" + maxTicks: Int! + + """Maximum pending jobs before execution is failed (default 50)""" + maxPendingJobs: Int! + + """Absolute deadline — execution fails if still running after this time""" + timeoutAt: Datetime! + + """Machine-readable error code when status = failed""" + errorCode: String + + """Human-readable error description when status = failed""" + errorMessage: String + + """ + Reads a single `FunctionGraph` that is related to this `FunctionGraphExecution`. + """ + graph: FunctionGraph +} + +"""A `FunctionGraphExecution` edge in the connection.""" +type FunctionGraphExecutionEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionGraphExecution` at the end of the edge.""" + node: FunctionGraphExecution +} + +""" +A filter to be used against `FunctionGraphExecution` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionGraphExecutionFilter { + """Filter by the object’s `startedAt` field.""" + startedAt: DatetimeFilter + + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `graphId` field.""" + graphId: UUIDFilter + + """Filter by the object’s `invocationId` field.""" + invocationId: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `entityId` field.""" + entityId: UUIDFilter + + """Filter by the object’s `outputNode` field.""" + outputNode: StringFilter + + """Filter by the object’s `outputPort` field.""" + outputPort: StringFilter + + """Filter by the object’s `status` field.""" + status: StringFilter + + """Filter by the object’s `inputPayload` field.""" + inputPayload: JSONFilter + + """Filter by the object’s `outputPayload` field.""" + outputPayload: JSONFilter + + """Filter by the object’s `nodeOutputs` field.""" + nodeOutputs: JSONFilter + + """Filter by the object’s `executionPlan` field.""" + executionPlan: JSONFilter + + """Filter by the object’s `currentWave` field.""" + currentWave: IntFilter + + """Filter by the object’s `parentExecutionId` field.""" + parentExecutionId: UUIDFilter + + """Filter by the object’s `parentNodeName` field.""" + parentNodeName: StringFilter + + """Filter by the object’s `definitionsCommitId` field.""" + definitionsCommitId: UUIDFilter + + """Filter by the object’s `tickCount` field.""" + tickCount: IntFilter + + """Filter by the object’s `completedAt` field.""" + completedAt: DatetimeFilter + + """Filter by the object’s `maxTicks` field.""" + maxTicks: IntFilter + + """Filter by the object’s `maxPendingJobs` field.""" + maxPendingJobs: IntFilter + + """Filter by the object’s `timeoutAt` field.""" + timeoutAt: DatetimeFilter + + """Filter by the object’s `errorCode` field.""" + errorCode: StringFilter + + """Filter by the object’s `errorMessage` field.""" + errorMessage: StringFilter + + """Checks for all expressions in this list.""" + and: [FunctionGraphExecutionFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionGraphExecutionFilter!] + + """Negates the expression.""" + not: FunctionGraphExecutionFilter + + """Filter by the object’s `graph` relation.""" + graph: FunctionGraphFilter +} + +"""Methods to use when ordering `FunctionGraphExecution`.""" +enum FunctionGraphExecutionOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + STARTED_AT_ASC + STARTED_AT_DESC + ID_ASC + ID_DESC + GRAPH_ID_ASC + GRAPH_ID_DESC + INVOCATION_ID_ASC + INVOCATION_ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + ENTITY_ID_ASC + ENTITY_ID_DESC + OUTPUT_NODE_ASC + OUTPUT_NODE_DESC + OUTPUT_PORT_ASC + OUTPUT_PORT_DESC + STATUS_ASC + STATUS_DESC + INPUT_PAYLOAD_ASC + INPUT_PAYLOAD_DESC + OUTPUT_PAYLOAD_ASC + OUTPUT_PAYLOAD_DESC + NODE_OUTPUTS_ASC + NODE_OUTPUTS_DESC + EXECUTION_PLAN_ASC + EXECUTION_PLAN_DESC + CURRENT_WAVE_ASC + CURRENT_WAVE_DESC + PARENT_EXECUTION_ID_ASC + PARENT_EXECUTION_ID_DESC + PARENT_NODE_NAME_ASC + PARENT_NODE_NAME_DESC + DEFINITIONS_COMMIT_ID_ASC + DEFINITIONS_COMMIT_ID_DESC + TICK_COUNT_ASC + TICK_COUNT_DESC + COMPLETED_AT_ASC + COMPLETED_AT_DESC + MAX_TICKS_ASC + MAX_TICKS_DESC + MAX_PENDING_JOBS_ASC + MAX_PENDING_JOBS_DESC + TIMEOUT_AT_ASC + TIMEOUT_AT_DESC + ERROR_CODE_ASC + ERROR_CODE_DESC + ERROR_MESSAGE_ASC + ERROR_MESSAGE_DESC +} + +"""A connection to a list of `FunctionDefinition` values.""" +type FunctionDefinitionConnection { + """A list of `FunctionDefinition` objects.""" + nodes: [FunctionDefinition]! + + """ + A list of edges which contains the `FunctionDefinition` and cursor to aid in pagination. + """ + edges: [FunctionDefinitionEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `FunctionDefinition` you could get from the connection. + """ + totalCount: Int! +} + +"""A `FunctionDefinition` edge in the connection.""" +type FunctionDefinitionEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionDefinition` at the end of the edge.""" + node: FunctionDefinition +} + +"""Methods to use when ordering `FunctionDefinition`.""" +enum FunctionDefinitionOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + SCOPE_ASC + SCOPE_DESC + NAME_ASC + NAME_DESC + TASK_IDENTIFIER_ASC + TASK_IDENTIFIER_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + IS_INVOCABLE_ASC + IS_INVOCABLE_DESC + MAX_ATTEMPTS_ASC + MAX_ATTEMPTS_DESC + PRIORITY_ASC + PRIORITY_DESC + QUEUE_NAME_ASC + QUEUE_NAME_DESC + RUNTIME_ASC + RUNTIME_DESC + IMAGE_ASC + IMAGE_DESC + CONCURRENCY_ASC + CONCURRENCY_DESC + SCALE_MIN_ASC + SCALE_MIN_DESC + SCALE_MAX_ASC + SCALE_MAX_DESC + TIMEOUT_SECONDS_ASC + TIMEOUT_SECONDS_DESC + RESOURCES_ASC + RESOURCES_DESC + IS_BUILT_IN_ASC + IS_BUILT_IN_DESC + REQUIRED_SECRETS_ASC + REQUIRED_SECRETS_DESC + REQUIRED_CONFIGS_ASC + REQUIRED_CONFIGS_DESC + REQUIRED_BUCKETS_ASC + REQUIRED_BUCKETS_DESC + REQUIRED_MODELS_ASC + REQUIRED_MODELS_DESC + INPUTS_ASC + INPUTS_DESC + OUTPUTS_ASC + OUTPUTS_DESC + PROPS_ASC + PROPS_DESC + VOLATILE_ASC + VOLATILE_DESC + ICON_ASC + ICON_DESC + CATEGORY_ASC + CATEGORY_DESC +} + +"""Root meta schema type""" +type MetaSchema { + tables: [MetaTable!]! +} + +"""Information about a database table""" +type MetaTable { + name: String! + schemaName: String! + fields: [MetaField!]! + indexes: [MetaIndex!]! + constraints: MetaConstraints! + foreignKeyConstraints: [MetaForeignKeyConstraint!]! + primaryKeyConstraints: [MetaPrimaryKeyConstraint!]! + uniqueConstraints: [MetaUniqueConstraint!]! + relations: MetaRelations! + inflection: MetaInflection! + query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime +} + +"""Information about a table field/column""" +type MetaField { + name: String! + type: MetaType! + isNotNull: Boolean! + hasDefault: Boolean! + isPrimaryKey: Boolean! + isForeignKey: Boolean! + description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum +} + +"""Information about a PostgreSQL type""" +type MetaType { + pgType: String! + gqlType: String! + isArray: Boolean! + isNotNull: Boolean + hasDefault: Boolean + subtype: String +} + +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + +"""Information about a database index""" +type MetaIndex { + name: String! + isUnique: Boolean! + isPrimary: Boolean! + columns: [String!]! + fields: [MetaField!] +} + +"""Table constraints""" +type MetaConstraints { + primaryKey: MetaPrimaryKeyConstraint + unique: [MetaUniqueConstraint!]! + foreignKey: [MetaForeignKeyConstraint!]! +} + +"""Information about a primary key constraint""" +type MetaPrimaryKeyConstraint { + name: String! + fields: [MetaField!]! +} + +"""Information about a unique constraint""" +type MetaUniqueConstraint { + name: String! + fields: [MetaField!]! +} + +"""Information about a foreign key constraint""" +type MetaForeignKeyConstraint { + name: String! + fields: [MetaField!]! + referencedTable: String! + referencedFields: [String!]! + refFields: [MetaField!] + refTable: MetaRefTable +} + +"""Reference to a related table""" +type MetaRefTable { + name: String! +} + +"""Table relations""" +type MetaRelations { + belongsTo: [MetaBelongsToRelation!]! + has: [MetaHasRelation!]! + hasOne: [MetaHasRelation!]! + hasMany: [MetaHasRelation!]! + manyToMany: [MetaManyToManyRelation!]! +} + +"""A belongs-to (forward FK) relation""" +type MetaBelongsToRelation { + fieldName: String + isUnique: Boolean! + type: String + keys: [MetaField!]! + references: MetaRefTable! +} + +"""A has-one or has-many (reverse FK) relation""" +type MetaHasRelation { + fieldName: String + isUnique: Boolean! + type: String + keys: [MetaField!]! + referencedBy: MetaRefTable! +} + +"""A many-to-many relation via junction table""" +type MetaManyToManyRelation { + fieldName: String + type: String + junctionTable: MetaRefTable! + junctionLeftConstraint: MetaForeignKeyConstraint! + junctionLeftKeyAttributes: [MetaField!]! + junctionRightConstraint: MetaForeignKeyConstraint! + junctionRightKeyAttributes: [MetaField!]! + leftKeyAttributes: [MetaField!]! + rightKeyAttributes: [MetaField!]! + rightTable: MetaRefTable! +} + +"""Table inflection names""" +type MetaInflection { + tableType: String! + allRows: String! + connection: String! + edge: String! + filterType: String + orderByType: String! + conditionType: String! + patchType: String + createInputType: String! + createPayloadType: String! + updatePayloadType: String + deletePayloadType: String! +} + +"""Table query/mutation names""" +type MetaQuery { + all: String! + one: String + create: String + update: String + delete: String +} + +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + +""" +The root mutation type which contains root level fields which mutate data. +""" +type Mutation { + validateFunctionGraph( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: ValidateFunctionGraphInput! + ): ValidateFunctionGraphPayload + initEmptyRepo( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: InitEmptyRepoInput! + ): InitEmptyRepoPayload + setDataAtPath( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: SetDataAtPathInput! + ): SetDataAtPathPayload + importDefinitions( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: ImportDefinitionsInput! + ): ImportDefinitionsPayload + copyGraph( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CopyGraphInput! + ): CopyGraphPayload + saveGraph( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: SaveGraphInput! + ): SaveGraphPayload + addEdgeAndSave( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: AddEdgeAndSaveInput! + ): AddEdgeAndSavePayload + addNodeAndSave( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: AddNodeAndSaveInput! + ): AddNodeAndSavePayload + createFunctionGraph( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphInput! + ): CreateFunctionGraphPayload + addEdge( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: AddEdgeInput! + ): AddEdgePayload + addNode( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: AddNodeInput! + ): AddNodePayload + importGraphJson( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: ImportGraphJsonInput! + ): ImportGraphJsonPayload + insertNodeAtPath( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: InsertNodeAtPathInput! + ): InsertNodeAtPathPayload + startExecution( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: StartExecutionInput! + ): StartExecutionPayload + + """Creates a single `FunctionApiBinding`.""" + createFunctionApiBinding( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionApiBindingInput! + ): CreateFunctionApiBindingPayload + + """Creates a single `FunctionGraphRef`.""" + createFunctionGraphRef( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphRefInput! + ): CreateFunctionGraphRefPayload + + """Creates a single `FunctionGraphStore`.""" + createFunctionGraphStore( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphStoreInput! + ): CreateFunctionGraphStorePayload + + """Creates a single `FunctionGraphObject`.""" + createFunctionGraphObject( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphObjectInput! + ): CreateFunctionGraphObjectPayload + + """Creates a single `FunctionDeploymentEvent`.""" + createFunctionDeploymentEvent( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionDeploymentEventInput! + ): CreateFunctionDeploymentEventPayload + + """Creates a single `OrgFunctionExecutionLog`.""" + createOrgFunctionExecutionLog( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateOrgFunctionExecutionLogInput! + ): CreateOrgFunctionExecutionLogPayload + + """Creates a single `FunctionGraphExecutionOutput`.""" + createFunctionGraphExecutionOutput( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphExecutionOutputInput! + ): CreateFunctionGraphExecutionOutputPayload + + """Creates a single `FunctionGraphCommit`.""" + createFunctionGraphCommit( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphCommitInput! + ): CreateFunctionGraphCommitPayload + + """Creates a single `SecretDefinition`.""" + createSecretDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateSecretDefinitionInput! + ): CreateSecretDefinitionPayload + + """Creates a single `FunctionExecutionLog`.""" + createFunctionExecutionLog( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionExecutionLogInput! + ): CreateFunctionExecutionLogPayload + + """Creates a single `FunctionGraphExecutionNodeState`.""" + createFunctionGraphExecutionNodeState( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphExecutionNodeStateInput! + ): CreateFunctionGraphExecutionNodeStatePayload + + """Creates a single `OrgFunctionInvocation`.""" + createOrgFunctionInvocation( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateOrgFunctionInvocationInput! + ): CreateOrgFunctionInvocationPayload + + """Creates a single `FunctionInvocation`.""" + createFunctionInvocation( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionInvocationInput! + ): CreateFunctionInvocationPayload + + """Creates a single `FunctionDeployment`.""" + createFunctionDeployment( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionDeploymentInput! + ): CreateFunctionDeploymentPayload + + """Creates a single `FunctionGraphExecution`.""" + createFunctionGraphExecution( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionGraphExecutionInput! + ): CreateFunctionGraphExecutionPayload + + """Creates a single `FunctionDefinition`.""" + createFunctionDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionDefinitionInput! + ): CreateFunctionDefinitionPayload + + """Updates a single `FunctionApiBinding` using a unique key and a patch.""" + updateFunctionApiBinding( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionApiBindingInput! + ): UpdateFunctionApiBindingPayload + + """Updates a single `FunctionGraphRef` using a unique key and a patch.""" + updateFunctionGraphRef( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphRefInput! + ): UpdateFunctionGraphRefPayload + + """Updates a single `FunctionGraphStore` using a unique key and a patch.""" + updateFunctionGraphStore( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphStoreInput! + ): UpdateFunctionGraphStorePayload + + """Updates a single `FunctionGraphObject` using a unique key and a patch.""" + updateFunctionGraphObject( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphObjectInput! + ): UpdateFunctionGraphObjectPayload + + """ + Updates a single `FunctionDeploymentEvent` using a unique key and a patch. + """ + updateFunctionDeploymentEvent( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionDeploymentEventInput! + ): UpdateFunctionDeploymentEventPayload + + """ + Updates a single `OrgFunctionExecutionLog` using a unique key and a patch. + """ + updateOrgFunctionExecutionLog( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateOrgFunctionExecutionLogInput! + ): UpdateOrgFunctionExecutionLogPayload + + """ + Updates a single `FunctionGraphExecutionOutput` using a unique key and a patch. + """ + updateFunctionGraphExecutionOutput( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphExecutionOutputInput! + ): UpdateFunctionGraphExecutionOutputPayload + + """Updates a single `FunctionGraphCommit` using a unique key and a patch.""" + updateFunctionGraphCommit( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphCommitInput! + ): UpdateFunctionGraphCommitPayload + + """Updates a single `SecretDefinition` using a unique key and a patch.""" + updateSecretDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateSecretDefinitionInput! + ): UpdateSecretDefinitionPayload + + """ + Updates a single `FunctionExecutionLog` using a unique key and a patch. + """ + updateFunctionExecutionLog( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionExecutionLogInput! + ): UpdateFunctionExecutionLogPayload + + """ + Updates a single `FunctionGraphExecutionNodeState` using a unique key and a patch. + """ + updateFunctionGraphExecutionNodeState( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphExecutionNodeStateInput! + ): UpdateFunctionGraphExecutionNodeStatePayload + + """Updates a single `FunctionGraph` using a unique key and a patch.""" + updateFunctionGraph( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphInput! + ): UpdateFunctionGraphPayload + + """ + Updates a single `OrgFunctionInvocation` using a unique key and a patch. + """ + updateOrgFunctionInvocation( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateOrgFunctionInvocationInput! + ): UpdateOrgFunctionInvocationPayload + + """Updates a single `FunctionInvocation` using a unique key and a patch.""" + updateFunctionInvocation( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionInvocationInput! + ): UpdateFunctionInvocationPayload + + """Updates a single `FunctionDeployment` using a unique key and a patch.""" + updateFunctionDeployment( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionDeploymentInput! + ): UpdateFunctionDeploymentPayload + + """ + Updates a single `FunctionGraphExecution` using a unique key and a patch. + """ + updateFunctionGraphExecution( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionGraphExecutionInput! + ): UpdateFunctionGraphExecutionPayload + + """Updates a single `FunctionDefinition` using a unique key and a patch.""" + updateFunctionDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionDefinitionInput! + ): UpdateFunctionDefinitionPayload + + """Deletes a single `FunctionApiBinding` using a unique key.""" + deleteFunctionApiBinding( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionApiBindingInput! + ): DeleteFunctionApiBindingPayload + + """Deletes a single `FunctionGraphRef` using a unique key.""" + deleteFunctionGraphRef( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphRefInput! + ): DeleteFunctionGraphRefPayload + + """Deletes a single `FunctionGraphStore` using a unique key.""" + deleteFunctionGraphStore( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphStoreInput! + ): DeleteFunctionGraphStorePayload + + """Deletes a single `FunctionGraphObject` using a unique key.""" + deleteFunctionGraphObject( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphObjectInput! + ): DeleteFunctionGraphObjectPayload + + """Deletes a single `FunctionDeploymentEvent` using a unique key.""" + deleteFunctionDeploymentEvent( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionDeploymentEventInput! + ): DeleteFunctionDeploymentEventPayload + + """Deletes a single `OrgFunctionExecutionLog` using a unique key.""" + deleteOrgFunctionExecutionLog( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteOrgFunctionExecutionLogInput! + ): DeleteOrgFunctionExecutionLogPayload + + """Deletes a single `FunctionGraphExecutionOutput` using a unique key.""" + deleteFunctionGraphExecutionOutput( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphExecutionOutputInput! + ): DeleteFunctionGraphExecutionOutputPayload + + """Deletes a single `FunctionGraphCommit` using a unique key.""" + deleteFunctionGraphCommit( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphCommitInput! + ): DeleteFunctionGraphCommitPayload + + """Deletes a single `SecretDefinition` using a unique key.""" + deleteSecretDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteSecretDefinitionInput! + ): DeleteSecretDefinitionPayload + + """Deletes a single `FunctionExecutionLog` using a unique key.""" + deleteFunctionExecutionLog( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionExecutionLogInput! + ): DeleteFunctionExecutionLogPayload + + """Deletes a single `FunctionGraphExecutionNodeState` using a unique key.""" + deleteFunctionGraphExecutionNodeState( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphExecutionNodeStateInput! + ): DeleteFunctionGraphExecutionNodeStatePayload + + """Deletes a single `FunctionGraph` using a unique key.""" + deleteFunctionGraph( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphInput! + ): DeleteFunctionGraphPayload + + """Deletes a single `OrgFunctionInvocation` using a unique key.""" + deleteOrgFunctionInvocation( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteOrgFunctionInvocationInput! + ): DeleteOrgFunctionInvocationPayload + + """Deletes a single `FunctionInvocation` using a unique key.""" + deleteFunctionInvocation( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionInvocationInput! + ): DeleteFunctionInvocationPayload + + """Deletes a single `FunctionDeployment` using a unique key.""" + deleteFunctionDeployment( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionDeploymentInput! + ): DeleteFunctionDeploymentPayload + + """Deletes a single `FunctionGraphExecution` using a unique key.""" + deleteFunctionGraphExecution( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionGraphExecutionInput! + ): DeleteFunctionGraphExecutionPayload + + """Deletes a single `FunctionDefinition` using a unique key.""" + deleteFunctionDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionDefinitionInput! + ): DeleteFunctionDefinitionPayload + + """ + Provision an S3 bucket for a logical bucket in the database. + Reads the bucket config via RLS, then creates and configures + the S3 bucket with the appropriate privacy policies, CORS rules, + and lifecycle settings. + """ + provisionBucket( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: ProvisionBucketInput! + ): ProvisionBucketPayload +} + +"""The output of our `validateFunctionGraph` mutation.""" +type ValidateFunctionGraphPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: Boolean + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `validateFunctionGraph` mutation.""" +input ValidateFunctionGraphInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + graphId: UUID +} + +"""The output of our `initEmptyRepo` mutation.""" +type InitEmptyRepoPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `initEmptyRepo` mutation.""" +input InitEmptyRepoInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + sId: UUID + storeId: UUID +} + +"""The output of our `setDataAtPath` mutation.""" +type SetDataAtPathPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `setDataAtPath` mutation.""" +input SetDataAtPathInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + sId: UUID + root: UUID + path: [String] + data: JSON +} + +"""The output of our `importDefinitions` mutation.""" +type ImportDefinitionsPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `importDefinitions` mutation.""" +input ImportDefinitionsInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + graphId: UUID + sourceScopeId: UUID + sourceCommitId: UUID + contexts: [String] +} + +"""The output of our `copyGraph` mutation.""" +type CopyGraphPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `copyGraph` mutation.""" +input CopyGraphInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + databaseId: UUID + graphId: UUID + name: String +} + +"""The output of our `saveGraph` mutation.""" +type SaveGraphPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `saveGraph` mutation.""" +input SaveGraphInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + graphId: UUID + rootHash: UUID + message: String +} + +"""The output of our `addEdgeAndSave` mutation.""" +type AddEdgeAndSavePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `addEdgeAndSave` mutation.""" +input AddEdgeAndSaveInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + graphId: UUID + srcNode: String + srcPort: String + dstNode: String + dstPort: String + message: String +} + +"""The output of our `addNodeAndSave` mutation.""" +type AddNodeAndSavePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `addNodeAndSave` mutation.""" +input AddNodeAndSaveInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + graphId: UUID + nodeName: String + nodeType: String + props: JSON + meta: JSON + message: String +} + +"""The output of our `createFunctionGraph` mutation.""" +type CreateFunctionGraphPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `createFunctionGraph` mutation.""" +input CreateFunctionGraphInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + databaseId: UUID + name: String + context: String + description: String + entityId: UUID + createdBy: UUID + definitionsCommitId: UUID +} + +"""The output of our `addEdge` mutation.""" +type AddEdgePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `addEdge` mutation.""" +input AddEdgeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + databaseId: UUID + rootHash: UUID + srcNode: String + srcPort: String + dstNode: String + dstPort: String + context: String + graphName: String +} + +"""The output of our `addNode` mutation.""" +type AddNodePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `addNode` mutation.""" +input AddNodeInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + databaseId: UUID + rootHash: UUID + nodeName: String + nodeType: String + context: String + graphName: String + props: JSON + meta: JSON +} + +"""The output of our `importGraphJson` mutation.""" +type ImportGraphJsonPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `importGraphJson` mutation.""" +input ImportGraphJsonInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + databaseId: UUID + name: String + graphJson: JSON + context: String + description: String + entityId: UUID + createdBy: UUID + definitionsCommitId: UUID +} + +"""The output of our `insertNodeAtPath` mutation.""" +type InsertNodeAtPathPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `insertNodeAtPath` mutation.""" +input InsertNodeAtPathInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + sId: UUID + root: UUID + path: [String] + data: JSON + kids: [UUID] + ktree: [String] +} + +"""The output of our `startExecution` mutation.""" +type StartExecutionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: UUID + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `startExecution` mutation.""" +input StartExecutionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + graphId: UUID + inputPayload: JSON + outputNode: String + outputPort: String + maxTicks: Int + maxPendingJobs: Int + timeoutInterval: IntervalInput + parentExecutionId: UUID + parentNodeName: String +} + +""" +An interval of time that has passed where the smallest distinct unit is a second. +""" +input IntervalInput { + """ + A quantity of seconds. This is the only non-integer field, as all the other + fields will dump their overflow into a smaller unit of time. Intervals don’t + have a smaller unit than seconds. + """ + seconds: Float + + """A quantity of minutes.""" + minutes: Int + + """A quantity of hours.""" + hours: Int + + """A quantity of days.""" + days: Int + + """A quantity of months.""" + months: Int + + """A quantity of years.""" + years: Int +} + +"""The output of our create `FunctionApiBinding` mutation.""" +type CreateFunctionApiBindingPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionApiBinding` that was created by this mutation.""" + functionApiBinding: FunctionApiBinding + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionApiBinding`. May be used by Relay 1.""" + functionApiBindingEdge( + """The method to use when ordering `FunctionApiBinding`.""" + orderBy: [FunctionApiBindingOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionApiBindingEdge +} + +"""All input for the create `FunctionApiBinding` mutation.""" +input CreateFunctionApiBindingInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionApiBinding` to be created by this mutation.""" + functionApiBinding: FunctionApiBindingInput! +} + +"""An input for mutations affecting `FunctionApiBinding`""" +input FunctionApiBindingInput { + id: UUID + + """Function definition this binding belongs to""" + functionDefinitionId: UUID! + + """API endpoint this function is bound to""" + apiId: UUID! + + """Binding alias (e.g. default, staging, production)""" + alias: String + + """Per-binding configuration (overrides, routing rules, etc.)""" + config: JSON +} + +"""The output of our create `FunctionGraphRef` mutation.""" +type CreateFunctionGraphRefPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphRef` that was created by this mutation.""" + functionGraphRef: FunctionGraphRef + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphRef`. May be used by Relay 1.""" + functionGraphRefEdge( + """The method to use when ordering `FunctionGraphRef`.""" + orderBy: [FunctionGraphRefOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphRefEdge +} + +"""All input for the create `FunctionGraphRef` mutation.""" +input CreateFunctionGraphRefInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionGraphRef` to be created by this mutation.""" + functionGraphRef: FunctionGraphRefInput! +} + +"""An input for mutations affecting `FunctionGraphRef`""" +input FunctionGraphRefInput { + """Unique ref identifier""" + id: UUID + + """Ref name (e.g. HEAD, main)""" + name: String! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Store this ref belongs to""" + storeId: UUID! + + """Commit this ref points to""" + commitId: UUID +} + +"""The output of our create `FunctionGraphStore` mutation.""" +type CreateFunctionGraphStorePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphStore` that was created by this mutation.""" + functionGraphStore: FunctionGraphStore + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphStore`. May be used by Relay 1.""" + functionGraphStoreEdge( + """The method to use when ordering `FunctionGraphStore`.""" + orderBy: [FunctionGraphStoreOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphStoreEdge +} + +"""All input for the create `FunctionGraphStore` mutation.""" +input CreateFunctionGraphStoreInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionGraphStore` to be created by this mutation.""" + functionGraphStore: FunctionGraphStoreInput! +} + +"""An input for mutations affecting `FunctionGraphStore`""" +input FunctionGraphStoreInput { + """Unique store identifier""" + id: UUID + + """Human-readable store name""" + name: String! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Current root object hash of this store""" + hash: UUID + + """Timestamp of store creation""" + createdAt: Datetime +} + +"""The output of our create `FunctionGraphObject` mutation.""" +type CreateFunctionGraphObjectPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphObject` that was created by this mutation.""" + functionGraphObject: FunctionGraphObject + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphObject`. May be used by Relay 1.""" + functionGraphObjectEdge( + """The method to use when ordering `FunctionGraphObject`.""" + orderBy: [FunctionGraphObjectOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphObjectEdge +} + +"""All input for the create `FunctionGraphObject` mutation.""" +input CreateFunctionGraphObjectInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionGraphObject` to be created by this mutation.""" + functionGraphObject: FunctionGraphObjectInput! +} + +"""An input for mutations affecting `FunctionGraphObject`""" +input FunctionGraphObjectInput { + """Content-addressed UUID v5 — deterministic hash of (data, kids, ktree)""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Ordered array of child object IDs""" + kids: [UUID] + + """Ordered array of child path names (parallel to kids)""" + ktree: [String] + + """Payload data for this object node""" + data: JSON + + """Timestamp of object creation""" + createdAt: Datetime +} + +"""The output of our create `FunctionDeploymentEvent` mutation.""" +type CreateFunctionDeploymentEventPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeploymentEvent` that was created by this mutation.""" + functionDeploymentEvent: FunctionDeploymentEvent + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeploymentEvent`. May be used by Relay 1.""" + functionDeploymentEventEdge( + """The method to use when ordering `FunctionDeploymentEvent`.""" + orderBy: [FunctionDeploymentEventOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentEventEdge +} + +"""All input for the create `FunctionDeploymentEvent` mutation.""" +input CreateFunctionDeploymentEventInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionDeploymentEvent` to be created by this mutation.""" + functionDeploymentEvent: FunctionDeploymentEventInput! +} + +"""An input for mutations affecting `FunctionDeploymentEvent`""" +input FunctionDeploymentEventInput { + """Event timestamp (partition key)""" + createdAt: Datetime + + """Unique event identifier""" + id: UUID + + """Deployment this event belongs to""" + deploymentId: UUID! + + """ + Event type: provisioned, scaled, failed, deactivated, redeployed, health_check + """ + eventType: String! + + """User who triggered this event (NULL for system/automated)""" + actorId: UUID + + """Human-readable description of the event""" + message: String + + """Structured context (old/new values, error details, etc.)""" + metadata: JSON + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! +} + +"""The output of our create `OrgFunctionExecutionLog` mutation.""" +type CreateOrgFunctionExecutionLogPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `OrgFunctionExecutionLog` that was created by this mutation.""" + orgFunctionExecutionLog: OrgFunctionExecutionLog + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `OrgFunctionExecutionLog`. May be used by Relay 1.""" + orgFunctionExecutionLogEdge( + """The method to use when ordering `OrgFunctionExecutionLog`.""" + orderBy: [OrgFunctionExecutionLogOrderBy!]! = [PRIMARY_KEY_ASC] + ): OrgFunctionExecutionLogEdge +} + +"""All input for the create `OrgFunctionExecutionLog` mutation.""" +input CreateOrgFunctionExecutionLogInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `OrgFunctionExecutionLog` to be created by this mutation.""" + orgFunctionExecutionLog: OrgFunctionExecutionLogInput! +} + +"""An input for mutations affecting `OrgFunctionExecutionLog`""" +input OrgFunctionExecutionLogInput { + """Log entry timestamp (partition key)""" + createdAt: Datetime + + """Unique log entry identifier""" + id: UUID + + """Invocation this log entry belongs to (NULL for standalone job logs)""" + invocationId: UUID + + """Function routing key (NULL for generic job logs)""" + taskIdentifier: String + + """Log severity: debug, info, warn, error""" + logLevel: String + + """Log message text""" + message: String! + + """Structured context (labels, trace data, extra fields)""" + metadata: JSON + + """User who triggered the execution (NULL for system/cron)""" + actorId: UUID +} + +"""The output of our create `FunctionGraphExecutionOutput` mutation.""" +type CreateFunctionGraphExecutionOutputPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphExecutionOutput` that was created by this mutation.""" + functionGraphExecutionOutput: FunctionGraphExecutionOutput + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """ + An edge for our `FunctionGraphExecutionOutput`. May be used by Relay 1. + """ + functionGraphExecutionOutputEdge( + """The method to use when ordering `FunctionGraphExecutionOutput`.""" + orderBy: [FunctionGraphExecutionOutputOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionOutputEdge +} + +"""All input for the create `FunctionGraphExecutionOutput` mutation.""" +input CreateFunctionGraphExecutionOutputInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionGraphExecutionOutput` to be created by this mutation.""" + functionGraphExecutionOutput: FunctionGraphExecutionOutputInput! +} + +"""An input for mutations affecting `FunctionGraphExecutionOutput`""" +input FunctionGraphExecutionOutputInput { + """Timestamp of output creation""" + createdAt: Datetime + + """Unique execution output identifier""" + id: UUID + + """Scope for multi-tenant isolation""" + databaseId: UUID! + + """SHA-256 hash of the data JSONB — content-addressed deduplication""" + hash: Base64EncodedBinary! + + """The actual output payload from a completed node""" + data: JSON! +} + +"""The output of our create `FunctionGraphCommit` mutation.""" +type CreateFunctionGraphCommitPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphCommit` that was created by this mutation.""" + functionGraphCommit: FunctionGraphCommit + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphCommit`. May be used by Relay 1.""" + functionGraphCommitEdge( + """The method to use when ordering `FunctionGraphCommit`.""" + orderBy: [FunctionGraphCommitOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphCommitEdge +} + +"""All input for the create `FunctionGraphCommit` mutation.""" +input CreateFunctionGraphCommitInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionGraphCommit` to be created by this mutation.""" + functionGraphCommit: FunctionGraphCommitInput! +} + +"""An input for mutations affecting `FunctionGraphCommit`""" +input FunctionGraphCommitInput { + """Unique commit identifier""" + id: UUID + + """Optional commit message""" + message: String + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """Store this commit belongs to""" + storeId: UUID! + + """Parent commit IDs (supports merge commits)""" + parentIds: [UUID] + + """User who authored the changes""" + authorId: UUID + + """User who committed (may differ from author)""" + committerId: UUID + + """Root object ID of the tree snapshot at this commit""" + treeId: UUID + + """Commit timestamp""" + date: Datetime +} + +"""The output of our create `SecretDefinition` mutation.""" +type CreateSecretDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `SecretDefinition` that was created by this mutation.""" + secretDefinition: SecretDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `SecretDefinition`. May be used by Relay 1.""" + secretDefinitionEdge( + """The method to use when ordering `SecretDefinition`.""" + orderBy: [SecretDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): SecretDefinitionEdge +} + +"""All input for the create `SecretDefinition` mutation.""" +input CreateSecretDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `SecretDefinition` to be created by this mutation.""" + secretDefinition: SecretDefinitionInput! +} + +"""An input for mutations affecting `SecretDefinition`""" +input SecretDefinitionInput { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Secret name (must match app_secrets.name for resolution)""" + name: String! + + """Human-readable description of what this secret is used for""" + description: String + + """ + Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. + """ + isBuiltIn: Boolean + + """Key-value metadata for filtering and grouping secret definitions""" + labels: JSON + + """Freeform metadata annotations for secret definitions""" + annotations: JSON + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! +} + +"""The output of our create `FunctionExecutionLog` mutation.""" +type CreateFunctionExecutionLogPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionExecutionLog` that was created by this mutation.""" + functionExecutionLog: FunctionExecutionLog + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionExecutionLog`. May be used by Relay 1.""" + functionExecutionLogEdge( + """The method to use when ordering `FunctionExecutionLog`.""" + orderBy: [FunctionExecutionLogOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionExecutionLogEdge +} + +"""All input for the create `FunctionExecutionLog` mutation.""" +input CreateFunctionExecutionLogInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionExecutionLog` to be created by this mutation.""" + functionExecutionLog: FunctionExecutionLogInput! +} + +"""An input for mutations affecting `FunctionExecutionLog`""" +input FunctionExecutionLogInput { + """Log entry timestamp (partition key)""" + createdAt: Datetime + + """Unique log entry identifier""" + id: UUID + + """Invocation this log entry belongs to (NULL for standalone job logs)""" + invocationId: UUID + + """Function routing key (NULL for generic job logs)""" + taskIdentifier: String + + """Log severity: debug, info, warn, error""" + logLevel: String + + """Log message text""" + message: String! + + """Structured context (labels, trace data, extra fields)""" + metadata: JSON + + """User who triggered the execution (NULL for system/cron)""" + actorId: UUID + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! +} + +"""The output of our create `FunctionGraphExecutionNodeState` mutation.""" +type CreateFunctionGraphExecutionNodeStatePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + The `FunctionGraphExecutionNodeState` that was created by this mutation. + """ + functionGraphExecutionNodeState: FunctionGraphExecutionNodeState + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """ + An edge for our `FunctionGraphExecutionNodeState`. May be used by Relay 1. + """ + functionGraphExecutionNodeStateEdge( + """The method to use when ordering `FunctionGraphExecutionNodeState`.""" + orderBy: [FunctionGraphExecutionNodeStateOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionNodeStateEdge +} + +"""All input for the create `FunctionGraphExecutionNodeState` mutation.""" +input CreateFunctionGraphExecutionNodeStateInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionGraphExecutionNodeState` to be created by this mutation.""" + functionGraphExecutionNodeState: FunctionGraphExecutionNodeStateInput! +} + +"""An input for mutations affecting `FunctionGraphExecutionNodeState`""" +input FunctionGraphExecutionNodeStateInput { + """Timestamp of node state creation (partition key)""" + createdAt: Datetime + + """Unique node state identifier""" + id: UUID + + """FK to the parent graph execution""" + executionId: UUID! + + """Scope for multi-tenant isolation""" + databaseId: UUID! + + """Name of the node within the graph (e.g. send-email1)""" + nodeName: String! + + """ + Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking + """ + nodePath: [String] + + """Node lifecycle: pending → queued → running → completed/failed""" + status: String + + """Timestamp when the node began executing""" + startedAt: Datetime + + """Timestamp when the node finished (success or failure)""" + completedAt: Datetime + + """Machine-readable error code when status = failed""" + errorCode: String + + """Human-readable error description when status = failed""" + errorMessage: String + + """FK to execution_outputs — content-addressed output blob for this node""" + outputId: UUID +} + +"""The output of our create `OrgFunctionInvocation` mutation.""" +type CreateOrgFunctionInvocationPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `OrgFunctionInvocation` that was created by this mutation.""" + orgFunctionInvocation: OrgFunctionInvocation + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `OrgFunctionInvocation`. May be used by Relay 1.""" + orgFunctionInvocationEdge( + """The method to use when ordering `OrgFunctionInvocation`.""" + orderBy: [OrgFunctionInvocationOrderBy!]! = [PRIMARY_KEY_ASC] + ): OrgFunctionInvocationEdge +} + +"""All input for the create `OrgFunctionInvocation` mutation.""" +input CreateOrgFunctionInvocationInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `OrgFunctionInvocation` to be created by this mutation.""" + orgFunctionInvocation: OrgFunctionInvocationInput! +} + +"""An input for mutations affecting `OrgFunctionInvocation`""" +input OrgFunctionInvocationInput { + """Invocation creation timestamp (partition key)""" + createdAt: Datetime + + """Unique invocation identifier""" + id: UUID + + """Who triggered the invocation (NULL for system/cron)""" + actorId: UUID + + """ + Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. + """ + taskIdentifier: String! + + """Function input payload""" + payload: JSON + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String + + """Function return value (success) or structured error (failure)""" + result: JSON + + """Error message when status is failed""" + error: String + + """Wall-clock execution time in milliseconds""" + durationMs: Int + + """FK to app_jobs.jobs — the underlying transport""" + jobId: BigInt + + """When execution started""" + startedAt: Datetime + + """When execution completed""" + completedAt: Datetime + + """Parent invocation when this is a child node of a flow graph execution""" + parentInvocationId: UUID + + """Groups all node invocations from a single flow graph execution""" + graphExecutionId: UUID +} + +"""The output of our create `FunctionInvocation` mutation.""" +type CreateFunctionInvocationPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionInvocation` that was created by this mutation.""" + functionInvocation: FunctionInvocation + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionInvocation`. May be used by Relay 1.""" + functionInvocationEdge( + """The method to use when ordering `FunctionInvocation`.""" + orderBy: [FunctionInvocationOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionInvocationEdge +} + +"""All input for the create `FunctionInvocation` mutation.""" +input CreateFunctionInvocationInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionInvocation` to be created by this mutation.""" + functionInvocation: FunctionInvocationInput! +} + +"""An input for mutations affecting `FunctionInvocation`""" +input FunctionInvocationInput { + """Invocation creation timestamp (partition key)""" + createdAt: Datetime + + """Unique invocation identifier""" + id: UUID + + """Who triggered the invocation (NULL for system/cron)""" + actorId: UUID + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! + + """ + Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. + """ + taskIdentifier: String! + + """Function input payload""" + payload: JSON + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String + + """Function return value (success) or structured error (failure)""" + result: JSON + + """Error message when status is failed""" + error: String + + """Wall-clock execution time in milliseconds""" + durationMs: Int + + """FK to app_jobs.jobs — the underlying transport""" + jobId: BigInt + + """When execution started""" + startedAt: Datetime + + """When execution completed""" + completedAt: Datetime + + """Parent invocation when this is a child node of a flow graph execution""" + parentInvocationId: UUID + + """Groups all node invocations from a single flow graph execution""" + graphExecutionId: UUID +} + +"""The output of our create `FunctionDeployment` mutation.""" +type CreateFunctionDeploymentPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeployment` that was created by this mutation.""" + functionDeployment: FunctionDeployment + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeployment`. May be used by Relay 1.""" + functionDeploymentEdge( + """The method to use when ordering `FunctionDeployment`.""" + orderBy: [FunctionDeploymentOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentEdge +} + +"""All input for the create `FunctionDeployment` mutation.""" +input CreateFunctionDeploymentInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionDeployment` to be created by this mutation.""" + functionDeployment: FunctionDeploymentInput! +} + +"""An input for mutations affecting `FunctionDeployment`""" +input FunctionDeploymentInput { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Function definition being deployed to this namespace""" + functionDefinitionId: UUID! + + """Target namespace for this deployment (maps to a K8s namespace)""" + namespaceId: UUID! + + """ + Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated + """ + status: String + + """ + Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning + """ + serviceUrl: String + + """Knative service name — derived from task_identifier at provision time""" + serviceName: String + + """Deployment revision number (incremented on each redeployment)""" + revision: Int + + """Container image override (NULL = inherit from function definition)""" + image: String + + """Max concurrent requests per pod (NULL = inherit from definition)""" + concurrency: Int + + """ + Minimum replica count (NULL = inherit from definition or Knative default) + """ + scaleMin: Int + + """ + Maximum replica count (NULL = inherit from definition or Knative default) + """ + scaleMax: Int + + """Request timeout override in seconds (NULL = inherit from definition)""" + timeoutSeconds: Int + + """ + K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} + """ + resources: JSON + + """Most recent provisioning or runtime error message""" + lastError: String + + """Timestamp of the most recent error""" + lastErrorAt: Datetime + + """Cumulative error count for this deployment""" + errorCount: Int + + """Key/value pairs for selecting and filtering deployments""" + labels: JSON + + """Freeform metadata for tooling and operational notes""" + annotations: JSON + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID! +} + +"""The output of our create `FunctionGraphExecution` mutation.""" +type CreateFunctionGraphExecutionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphExecution` that was created by this mutation.""" + functionGraphExecution: FunctionGraphExecution + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphExecution`. May be used by Relay 1.""" + functionGraphExecutionEdge( + """The method to use when ordering `FunctionGraphExecution`.""" + orderBy: [FunctionGraphExecutionOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionEdge +} + +"""All input for the create `FunctionGraphExecution` mutation.""" +input CreateFunctionGraphExecutionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionGraphExecution` to be created by this mutation.""" + functionGraphExecution: FunctionGraphExecutionInput! +} + +"""An input for mutations affecting `FunctionGraphExecution`""" +input FunctionGraphExecutionInput { + """Execution start timestamp""" + startedAt: Datetime + + """Unique execution identifier""" + id: UUID + + """FK to the graph definition being executed""" + graphId: UUID! + + """Parent function_invocations row (for metering)""" + invocationId: UUID + + """Scope for multi-tenant isolation""" + databaseId: UUID! + + """Entity context (org/team) for scoped billing""" + entityId: UUID + + """Target output boundary node name to resolve""" + outputNode: String! + + """Target output port name (default: value)""" + outputPort: String + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String + + """Initial inputs provided at invocation time""" + inputPayload: JSON + + """Final result extracted from terminal output node""" + outputPayload: JSON + + """ + Map of node_name → execution output id (content-addressed hash reference) + """ + nodeOutputs: JSON + + """Pre-computed topological sort as array of wave objects""" + executionPlan: JSON + + """Index into execution_plan — tick only processes this wave""" + currentWave: Int + + """Parent execution when this is a sub-execution""" + parentExecutionId: UUID + + """Node name in parent execution that spawned this sub-execution""" + parentNodeName: String + + """Pinned definitions store commit for deterministic evaluation""" + definitionsCommitId: UUID + + """Number of evaluate_step ticks executed""" + tickCount: Int + + """Execution completion timestamp""" + completedAt: Datetime + + """Maximum ticks before execution is failed (default 100)""" + maxTicks: Int + + """Maximum pending jobs before execution is failed (default 50)""" + maxPendingJobs: Int + + """Absolute deadline — execution fails if still running after this time""" + timeoutAt: Datetime + + """Machine-readable error code when status = failed""" + errorCode: String + + """Human-readable error description when status = failed""" + errorMessage: String +} + +"""The output of our create `FunctionDefinition` mutation.""" +type CreateFunctionDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDefinition` that was created by this mutation.""" + functionDefinition: FunctionDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDefinition`. May be used by Relay 1.""" + functionDefinitionEdge( + """The method to use when ordering `FunctionDefinition`.""" + orderBy: [FunctionDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDefinitionEdge +} + +"""All input for the create `FunctionDefinition` mutation.""" +input CreateFunctionDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionDefinition` to be created by this mutation.""" + functionDefinition: FunctionDefinitionInput! +} + +"""An input for mutations affecting `FunctionDefinition`""" +input FunctionDefinitionInput { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Function grouping scope (e.g. email, embed, chunk, custom)""" + scope: String! + + """ + Function name within scope (e.g. send_verification_link, process_file_embedding) + """ + name: String! + + """ + Computed routing slug: scope:name (used by Knative job worker for dispatch) + """ + taskIdentifier: String! + + """Human-readable description of what this function does""" + description: String + + """ + Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() + """ + isInvocable: Boolean + + """Maximum retry attempts for the underlying job""" + maxAttempts: Int + + """Job priority (lower = higher priority)""" + priority: Int + + """Job queue name for serialization (e.g. email, ai, default)""" + queueName: String + + """ + Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) + """ + runtime: String + + """ + Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. + """ + image: String + + """ + Knative containerConcurrency — max concurrent requests per pod instance + """ + concurrency: Int + + """Minimum pod count for Knative autoscaling (minScale)""" + scaleMin: Int + + """Maximum pod count for Knative autoscaling (maxScale)""" + scaleMax: Int + + """Knative request timeout in seconds""" + timeoutSeconds: Int + + """ + Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} + """ + resources: JSON + + """ + Whether this function is a built-in platform function (synced from platform) vs user-created + """ + isBuiltIn: Boolean + + """Embedded secret requirements: array of (name, required) tuples""" + requiredSecrets: [FunctionRequirementInput] + + """Embedded config requirements: array of (name, required) tuples""" + requiredConfigs: [FunctionRequirementInput] + + """ + Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. + """ + requiredBuckets: [String] + + """ + Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. + """ + requiredModels: [String] + + """ + Data input ports: [{name, type, description?, optional?, multi?, schema?}] + """ + inputs: JSON + + """ + Data output ports: [{name, type, description?, optional?, multi?, schema?}] + """ + outputs: JSON + + """ + Configuration properties: [{name, type, default?, description?, required?, schema?}] + """ + props: JSON + + """ + Whether this function has side effects and cannot be cached or memoized + """ + volatile: Boolean + + """Icon identifier for UI palette rendering (e.g. mail, database, code)""" + icon: String + + """Palette grouping category (e.g. email, data, ai, custom)""" + category: String +} + +"""An input for mutations affecting `FunctionRequirement`""" +input FunctionRequirementInput { + name: String + required: Boolean +} + +"""The output of our update `FunctionApiBinding` mutation.""" +type UpdateFunctionApiBindingPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionApiBinding` that was updated by this mutation.""" + functionApiBinding: FunctionApiBinding + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionApiBinding`. May be used by Relay 1.""" + functionApiBindingEdge( + """The method to use when ordering `FunctionApiBinding`.""" + orderBy: [FunctionApiBindingOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionApiBindingEdge +} + +"""All input for the `updateFunctionApiBinding` mutation.""" +input UpdateFunctionApiBindingInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionApiBinding` being updated. + """ + functionApiBindingPatch: FunctionApiBindingPatch! +} + +""" +Represents an update to a `FunctionApiBinding`. Fields that are set will be updated. +""" +input FunctionApiBindingPatch { + id: UUID + + """Function definition this binding belongs to""" + functionDefinitionId: UUID + + """API endpoint this function is bound to""" + apiId: UUID + + """Binding alias (e.g. default, staging, production)""" + alias: String + + """Per-binding configuration (overrides, routing rules, etc.)""" + config: JSON +} + +"""The output of our update `FunctionGraphRef` mutation.""" +type UpdateFunctionGraphRefPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphRef` that was updated by this mutation.""" + functionGraphRef: FunctionGraphRef + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphRef`. May be used by Relay 1.""" + functionGraphRefEdge( + """The method to use when ordering `FunctionGraphRef`.""" + orderBy: [FunctionGraphRefOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphRefEdge +} + +"""All input for the `updateFunctionGraphRef` mutation.""" +input UpdateFunctionGraphRefInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique ref identifier""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraphRef` being updated. + """ + functionGraphRefPatch: FunctionGraphRefPatch! +} + +""" +Represents an update to a `FunctionGraphRef`. Fields that are set will be updated. +""" +input FunctionGraphRefPatch { + """Unique ref identifier""" + id: UUID + + """Ref name (e.g. HEAD, main)""" + name: String + + """Database scope for multi-tenant isolation""" + databaseId: UUID + + """Store this ref belongs to""" + storeId: UUID + + """Commit this ref points to""" + commitId: UUID +} + +"""The output of our update `FunctionGraphStore` mutation.""" +type UpdateFunctionGraphStorePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphStore` that was updated by this mutation.""" + functionGraphStore: FunctionGraphStore + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphStore`. May be used by Relay 1.""" + functionGraphStoreEdge( + """The method to use when ordering `FunctionGraphStore`.""" + orderBy: [FunctionGraphStoreOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphStoreEdge +} + +"""All input for the `updateFunctionGraphStore` mutation.""" +input UpdateFunctionGraphStoreInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique store identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraphStore` being updated. + """ + functionGraphStorePatch: FunctionGraphStorePatch! +} + +""" +Represents an update to a `FunctionGraphStore`. Fields that are set will be updated. +""" +input FunctionGraphStorePatch { + """Unique store identifier""" + id: UUID + + """Human-readable store name""" + name: String + + """Database scope for multi-tenant isolation""" + databaseId: UUID + + """Current root object hash of this store""" + hash: UUID + + """Timestamp of store creation""" + createdAt: Datetime +} + +"""The output of our update `FunctionGraphObject` mutation.""" +type UpdateFunctionGraphObjectPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphObject` that was updated by this mutation.""" + functionGraphObject: FunctionGraphObject + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphObject`. May be used by Relay 1.""" + functionGraphObjectEdge( + """The method to use when ordering `FunctionGraphObject`.""" + orderBy: [FunctionGraphObjectOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphObjectEdge +} + +"""All input for the `updateFunctionGraphObject` mutation.""" +input UpdateFunctionGraphObjectInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Content-addressed UUID v5 — deterministic hash of (data, kids, ktree)""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraphObject` being updated. + """ + functionGraphObjectPatch: FunctionGraphObjectPatch! +} + +""" +Represents an update to a `FunctionGraphObject`. Fields that are set will be updated. +""" +input FunctionGraphObjectPatch { + """Content-addressed UUID v5 — deterministic hash of (data, kids, ktree)""" + id: UUID + + """Database scope for multi-tenant isolation""" + databaseId: UUID + + """Ordered array of child object IDs""" + kids: [UUID] + + """Ordered array of child path names (parallel to kids)""" + ktree: [String] + + """Payload data for this object node""" + data: JSON + + """Timestamp of object creation""" + createdAt: Datetime +} + +"""The output of our update `FunctionDeploymentEvent` mutation.""" +type UpdateFunctionDeploymentEventPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeploymentEvent` that was updated by this mutation.""" + functionDeploymentEvent: FunctionDeploymentEvent + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeploymentEvent`. May be used by Relay 1.""" + functionDeploymentEventEdge( + """The method to use when ordering `FunctionDeploymentEvent`.""" + orderBy: [FunctionDeploymentEventOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentEventEdge +} + +"""All input for the `updateFunctionDeploymentEvent` mutation.""" +input UpdateFunctionDeploymentEventInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Event timestamp (partition key)""" + createdAt: Datetime! + + """Unique event identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionDeploymentEvent` being updated. + """ + functionDeploymentEventPatch: FunctionDeploymentEventPatch! +} + +""" +Represents an update to a `FunctionDeploymentEvent`. Fields that are set will be updated. +""" +input FunctionDeploymentEventPatch { + """Event timestamp (partition key)""" + createdAt: Datetime + + """Unique event identifier""" + id: UUID + + """Deployment this event belongs to""" + deploymentId: UUID + + """ + Event type: provisioned, scaled, failed, deactivated, redeployed, health_check + """ + eventType: String + + """User who triggered this event (NULL for system/automated)""" + actorId: UUID + + """Human-readable description of the event""" + message: String + + """Structured context (old/new values, error details, etc.)""" + metadata: JSON + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID +} + +"""The output of our update `OrgFunctionExecutionLog` mutation.""" +type UpdateOrgFunctionExecutionLogPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `OrgFunctionExecutionLog` that was updated by this mutation.""" + orgFunctionExecutionLog: OrgFunctionExecutionLog + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `OrgFunctionExecutionLog`. May be used by Relay 1.""" + orgFunctionExecutionLogEdge( + """The method to use when ordering `OrgFunctionExecutionLog`.""" + orderBy: [OrgFunctionExecutionLogOrderBy!]! = [PRIMARY_KEY_ASC] + ): OrgFunctionExecutionLogEdge +} + +"""All input for the `updateOrgFunctionExecutionLog` mutation.""" +input UpdateOrgFunctionExecutionLogInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Log entry timestamp (partition key)""" + createdAt: Datetime! + + """Unique log entry identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `OrgFunctionExecutionLog` being updated. + """ + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch! +} + +""" +Represents an update to a `OrgFunctionExecutionLog`. Fields that are set will be updated. +""" +input OrgFunctionExecutionLogPatch { + """Log entry timestamp (partition key)""" + createdAt: Datetime + + """Unique log entry identifier""" + id: UUID + + """Invocation this log entry belongs to (NULL for standalone job logs)""" + invocationId: UUID + + """Function routing key (NULL for generic job logs)""" + taskIdentifier: String + + """Log severity: debug, info, warn, error""" + logLevel: String + + """Log message text""" + message: String + + """Structured context (labels, trace data, extra fields)""" + metadata: JSON + + """User who triggered the execution (NULL for system/cron)""" + actorId: UUID +} + +"""The output of our update `FunctionGraphExecutionOutput` mutation.""" +type UpdateFunctionGraphExecutionOutputPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphExecutionOutput` that was updated by this mutation.""" + functionGraphExecutionOutput: FunctionGraphExecutionOutput + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """ + An edge for our `FunctionGraphExecutionOutput`. May be used by Relay 1. + """ + functionGraphExecutionOutputEdge( + """The method to use when ordering `FunctionGraphExecutionOutput`.""" + orderBy: [FunctionGraphExecutionOutputOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionOutputEdge +} + +"""All input for the `updateFunctionGraphExecutionOutput` mutation.""" +input UpdateFunctionGraphExecutionOutputInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Timestamp of output creation""" + createdAt: Datetime! + + """Unique execution output identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraphExecutionOutput` being updated. + """ + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch! +} + +""" +Represents an update to a `FunctionGraphExecutionOutput`. Fields that are set will be updated. +""" +input FunctionGraphExecutionOutputPatch { + """Timestamp of output creation""" + createdAt: Datetime + + """Unique execution output identifier""" + id: UUID + + """Scope for multi-tenant isolation""" + databaseId: UUID + + """SHA-256 hash of the data JSONB — content-addressed deduplication""" + hash: Base64EncodedBinary + + """The actual output payload from a completed node""" + data: JSON +} + +"""The output of our update `FunctionGraphCommit` mutation.""" +type UpdateFunctionGraphCommitPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphCommit` that was updated by this mutation.""" + functionGraphCommit: FunctionGraphCommit + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphCommit`. May be used by Relay 1.""" + functionGraphCommitEdge( + """The method to use when ordering `FunctionGraphCommit`.""" + orderBy: [FunctionGraphCommitOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphCommitEdge +} + +"""All input for the `updateFunctionGraphCommit` mutation.""" +input UpdateFunctionGraphCommitInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique commit identifier""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraphCommit` being updated. + """ + functionGraphCommitPatch: FunctionGraphCommitPatch! +} + +""" +Represents an update to a `FunctionGraphCommit`. Fields that are set will be updated. +""" +input FunctionGraphCommitPatch { + """Unique commit identifier""" + id: UUID + + """Optional commit message""" + message: String + + """Database scope for multi-tenant isolation""" + databaseId: UUID + + """Store this commit belongs to""" + storeId: UUID + + """Parent commit IDs (supports merge commits)""" + parentIds: [UUID] + + """User who authored the changes""" + authorId: UUID + + """User who committed (may differ from author)""" + committerId: UUID + + """Root object ID of the tree snapshot at this commit""" + treeId: UUID + + """Commit timestamp""" + date: Datetime +} + +"""The output of our update `SecretDefinition` mutation.""" +type UpdateSecretDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `SecretDefinition` that was updated by this mutation.""" + secretDefinition: SecretDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `SecretDefinition`. May be used by Relay 1.""" + secretDefinitionEdge( + """The method to use when ordering `SecretDefinition`.""" + orderBy: [SecretDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): SecretDefinitionEdge +} + +"""All input for the `updateSecretDefinition` mutation.""" +input UpdateSecretDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `SecretDefinition` being updated. + """ + secretDefinitionPatch: SecretDefinitionPatch! +} + +""" +Represents an update to a `SecretDefinition`. Fields that are set will be updated. +""" +input SecretDefinitionPatch { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Secret name (must match app_secrets.name for resolution)""" + name: String + + """Human-readable description of what this secret is used for""" + description: String + + """ + Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. + """ + isBuiltIn: Boolean + + """Key-value metadata for filtering and grouping secret definitions""" + labels: JSON + + """Freeform metadata annotations for secret definitions""" + annotations: JSON + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID +} + +"""The output of our update `FunctionExecutionLog` mutation.""" +type UpdateFunctionExecutionLogPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionExecutionLog` that was updated by this mutation.""" + functionExecutionLog: FunctionExecutionLog + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionExecutionLog`. May be used by Relay 1.""" + functionExecutionLogEdge( + """The method to use when ordering `FunctionExecutionLog`.""" + orderBy: [FunctionExecutionLogOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionExecutionLogEdge +} + +"""All input for the `updateFunctionExecutionLog` mutation.""" +input UpdateFunctionExecutionLogInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Log entry timestamp (partition key)""" + createdAt: Datetime! + + """Unique log entry identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionExecutionLog` being updated. + """ + functionExecutionLogPatch: FunctionExecutionLogPatch! +} + +""" +Represents an update to a `FunctionExecutionLog`. Fields that are set will be updated. +""" +input FunctionExecutionLogPatch { + """Log entry timestamp (partition key)""" + createdAt: Datetime + + """Unique log entry identifier""" + id: UUID + + """Invocation this log entry belongs to (NULL for standalone job logs)""" + invocationId: UUID + + """Function routing key (NULL for generic job logs)""" + taskIdentifier: String + + """Log severity: debug, info, warn, error""" + logLevel: String + + """Log message text""" + message: String + + """Structured context (labels, trace data, extra fields)""" + metadata: JSON + + """User who triggered the execution (NULL for system/cron)""" + actorId: UUID + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID +} + +"""The output of our update `FunctionGraphExecutionNodeState` mutation.""" +type UpdateFunctionGraphExecutionNodeStatePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + The `FunctionGraphExecutionNodeState` that was updated by this mutation. + """ + functionGraphExecutionNodeState: FunctionGraphExecutionNodeState + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """ + An edge for our `FunctionGraphExecutionNodeState`. May be used by Relay 1. + """ + functionGraphExecutionNodeStateEdge( + """The method to use when ordering `FunctionGraphExecutionNodeState`.""" + orderBy: [FunctionGraphExecutionNodeStateOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionNodeStateEdge +} + +"""All input for the `updateFunctionGraphExecutionNodeState` mutation.""" +input UpdateFunctionGraphExecutionNodeStateInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Timestamp of node state creation (partition key)""" + createdAt: Datetime! + + """Unique node state identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraphExecutionNodeState` being updated. + """ + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch! +} + +""" +Represents an update to a `FunctionGraphExecutionNodeState`. Fields that are set will be updated. +""" +input FunctionGraphExecutionNodeStatePatch { + """Timestamp of node state creation (partition key)""" + createdAt: Datetime + + """Unique node state identifier""" + id: UUID + + """FK to the parent graph execution""" + executionId: UUID + + """Scope for multi-tenant isolation""" + databaseId: UUID + + """Name of the node within the graph (e.g. send-email1)""" + nodeName: String + + """ + Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking + """ + nodePath: [String] + + """Node lifecycle: pending → queued → running → completed/failed""" + status: String + + """Timestamp when the node began executing""" + startedAt: Datetime + + """Timestamp when the node finished (success or failure)""" + completedAt: Datetime + + """Machine-readable error code when status = failed""" + errorCode: String + + """Human-readable error description when status = failed""" + errorMessage: String + + """FK to execution_outputs — content-addressed output blob for this node""" + outputId: UUID +} + +"""The output of our update `FunctionGraph` mutation.""" +type UpdateFunctionGraphPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraph` that was updated by this mutation.""" + functionGraph: FunctionGraph + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraph`. May be used by Relay 1.""" + functionGraphEdge( + """The method to use when ordering `FunctionGraph`.""" + orderBy: [FunctionGraphOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphEdge +} + +"""All input for the `updateFunctionGraph` mutation.""" +input UpdateFunctionGraphInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique graph identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraph` being updated. + """ + functionGraphPatch: FunctionGraphPatch! +} + +""" +Represents an update to a `FunctionGraph`. Fields that are set will be updated. +""" +input FunctionGraphPatch { + """Unique graph identifier""" + id: UUID + + """Database scope for multi-tenant isolation""" + databaseId: UUID + + """Graph store (Merkle store) holding the graph definition""" + storeId: UUID + + """Entity context (org/team) for scoped billing""" + entityId: UUID + + """Evaluator/runtime context (function, js, sql, system)""" + context: String + + """Graph name (unique per database)""" + name: String + + """Human-readable description of the graph""" + description: String + + """Pinned definitions store commit for deterministic evaluation""" + definitionsCommitId: UUID + + """Whether graph passes structural validation""" + isValid: Boolean + + """Array of validation error objects when is_valid = false""" + validationErrors: JSON + + """Actor who created this graph""" + createdBy: UUID + + """Timestamp of graph creation""" + createdAt: Datetime + + """Timestamp of last modification""" + updatedAt: Datetime +} + +"""The output of our update `OrgFunctionInvocation` mutation.""" +type UpdateOrgFunctionInvocationPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `OrgFunctionInvocation` that was updated by this mutation.""" + orgFunctionInvocation: OrgFunctionInvocation + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `OrgFunctionInvocation`. May be used by Relay 1.""" + orgFunctionInvocationEdge( + """The method to use when ordering `OrgFunctionInvocation`.""" + orderBy: [OrgFunctionInvocationOrderBy!]! = [PRIMARY_KEY_ASC] + ): OrgFunctionInvocationEdge +} + +"""All input for the `updateOrgFunctionInvocation` mutation.""" +input UpdateOrgFunctionInvocationInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Invocation creation timestamp (partition key)""" + createdAt: Datetime! + + """Unique invocation identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `OrgFunctionInvocation` being updated. + """ + orgFunctionInvocationPatch: OrgFunctionInvocationPatch! +} + +""" +Represents an update to a `OrgFunctionInvocation`. Fields that are set will be updated. +""" +input OrgFunctionInvocationPatch { + """Invocation creation timestamp (partition key)""" + createdAt: Datetime + + """Unique invocation identifier""" + id: UUID + + """Who triggered the invocation (NULL for system/cron)""" + actorId: UUID + + """ + Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. + """ + taskIdentifier: String + + """Function input payload""" + payload: JSON + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String + + """Function return value (success) or structured error (failure)""" + result: JSON + + """Error message when status is failed""" + error: String + + """Wall-clock execution time in milliseconds""" + durationMs: Int + + """FK to app_jobs.jobs — the underlying transport""" + jobId: BigInt + + """When execution started""" + startedAt: Datetime + + """When execution completed""" + completedAt: Datetime + + """Parent invocation when this is a child node of a flow graph execution""" + parentInvocationId: UUID + + """Groups all node invocations from a single flow graph execution""" + graphExecutionId: UUID +} + +"""The output of our update `FunctionInvocation` mutation.""" +type UpdateFunctionInvocationPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionInvocation` that was updated by this mutation.""" + functionInvocation: FunctionInvocation + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionInvocation`. May be used by Relay 1.""" + functionInvocationEdge( + """The method to use when ordering `FunctionInvocation`.""" + orderBy: [FunctionInvocationOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionInvocationEdge +} + +"""All input for the `updateFunctionInvocation` mutation.""" +input UpdateFunctionInvocationInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Invocation creation timestamp (partition key)""" + createdAt: Datetime! + + """Unique invocation identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionInvocation` being updated. + """ + functionInvocationPatch: FunctionInvocationPatch! +} + +""" +Represents an update to a `FunctionInvocation`. Fields that are set will be updated. +""" +input FunctionInvocationPatch { + """Invocation creation timestamp (partition key)""" + createdAt: Datetime + + """Unique invocation identifier""" + id: UUID + + """Who triggered the invocation (NULL for system/cron)""" + actorId: UUID + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID + + """ + Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. + """ + taskIdentifier: String + + """Function input payload""" + payload: JSON + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String + + """Function return value (success) or structured error (failure)""" + result: JSON + + """Error message when status is failed""" + error: String + + """Wall-clock execution time in milliseconds""" + durationMs: Int + + """FK to app_jobs.jobs — the underlying transport""" + jobId: BigInt + + """When execution started""" + startedAt: Datetime + + """When execution completed""" + completedAt: Datetime + + """Parent invocation when this is a child node of a flow graph execution""" + parentInvocationId: UUID + + """Groups all node invocations from a single flow graph execution""" + graphExecutionId: UUID +} + +"""The output of our update `FunctionDeployment` mutation.""" +type UpdateFunctionDeploymentPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeployment` that was updated by this mutation.""" + functionDeployment: FunctionDeployment + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeployment`. May be used by Relay 1.""" + functionDeploymentEdge( + """The method to use when ordering `FunctionDeployment`.""" + orderBy: [FunctionDeploymentOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentEdge +} + +"""All input for the `updateFunctionDeployment` mutation.""" +input UpdateFunctionDeploymentInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionDeployment` being updated. + """ + functionDeploymentPatch: FunctionDeploymentPatch! +} + +""" +Represents an update to a `FunctionDeployment`. Fields that are set will be updated. +""" +input FunctionDeploymentPatch { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Function definition being deployed to this namespace""" + functionDefinitionId: UUID + + """Target namespace for this deployment (maps to a K8s namespace)""" + namespaceId: UUID + + """ + Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated + """ + status: String + + """ + Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning + """ + serviceUrl: String + + """Knative service name — derived from task_identifier at provision time""" + serviceName: String + + """Deployment revision number (incremented on each redeployment)""" + revision: Int + + """Container image override (NULL = inherit from function definition)""" + image: String + + """Max concurrent requests per pod (NULL = inherit from definition)""" + concurrency: Int + + """ + Minimum replica count (NULL = inherit from definition or Knative default) + """ + scaleMin: Int + + """ + Maximum replica count (NULL = inherit from definition or Knative default) + """ + scaleMax: Int + + """Request timeout override in seconds (NULL = inherit from definition)""" + timeoutSeconds: Int + + """ + K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} + """ + resources: JSON + + """Most recent provisioning or runtime error message""" + lastError: String + + """Timestamp of the most recent error""" + lastErrorAt: Datetime + + """Cumulative error count for this deployment""" + errorCount: Int + + """Key/value pairs for selecting and filtering deployments""" + labels: JSON + + """Freeform metadata for tooling and operational notes""" + annotations: JSON + + """Database that owns this resource (database-scoped isolation)""" + databaseId: UUID +} + +"""The output of our update `FunctionGraphExecution` mutation.""" +type UpdateFunctionGraphExecutionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphExecution` that was updated by this mutation.""" + functionGraphExecution: FunctionGraphExecution + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphExecution`. May be used by Relay 1.""" + functionGraphExecutionEdge( + """The method to use when ordering `FunctionGraphExecution`.""" + orderBy: [FunctionGraphExecutionOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionEdge +} + +"""All input for the `updateFunctionGraphExecution` mutation.""" +input UpdateFunctionGraphExecutionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Execution start timestamp""" + startedAt: Datetime! + + """Unique execution identifier""" + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionGraphExecution` being updated. + """ + functionGraphExecutionPatch: FunctionGraphExecutionPatch! +} + +""" +Represents an update to a `FunctionGraphExecution`. Fields that are set will be updated. +""" +input FunctionGraphExecutionPatch { + """Execution start timestamp""" + startedAt: Datetime + + """Unique execution identifier""" + id: UUID + + """FK to the graph definition being executed""" + graphId: UUID + + """Parent function_invocations row (for metering)""" + invocationId: UUID + + """Scope for multi-tenant isolation""" + databaseId: UUID + + """Entity context (org/team) for scoped billing""" + entityId: UUID + + """Target output boundary node name to resolve""" + outputNode: String + + """Target output port name (default: value)""" + outputPort: String + + """Lifecycle: pending → running → completed/failed/cancelled""" + status: String + + """Initial inputs provided at invocation time""" + inputPayload: JSON + + """Final result extracted from terminal output node""" + outputPayload: JSON + + """ + Map of node_name → execution output id (content-addressed hash reference) + """ + nodeOutputs: JSON + + """Pre-computed topological sort as array of wave objects""" + executionPlan: JSON + + """Index into execution_plan — tick only processes this wave""" + currentWave: Int + + """Parent execution when this is a sub-execution""" + parentExecutionId: UUID + + """Node name in parent execution that spawned this sub-execution""" + parentNodeName: String + + """Pinned definitions store commit for deterministic evaluation""" + definitionsCommitId: UUID + + """Number of evaluate_step ticks executed""" + tickCount: Int + + """Execution completion timestamp""" + completedAt: Datetime + + """Maximum ticks before execution is failed (default 100)""" + maxTicks: Int + + """Maximum pending jobs before execution is failed (default 50)""" + maxPendingJobs: Int + + """Absolute deadline — execution fails if still running after this time""" + timeoutAt: Datetime + + """Machine-readable error code when status = failed""" + errorCode: String + + """Human-readable error description when status = failed""" + errorMessage: String +} + +"""The output of our update `FunctionDefinition` mutation.""" +type UpdateFunctionDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDefinition` that was updated by this mutation.""" + functionDefinition: FunctionDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDefinition`. May be used by Relay 1.""" + functionDefinitionEdge( + """The method to use when ordering `FunctionDefinition`.""" + orderBy: [FunctionDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDefinitionEdge +} + +"""All input for the `updateFunctionDefinition` mutation.""" +input UpdateFunctionDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionDefinition` being updated. + """ + functionDefinitionPatch: FunctionDefinitionPatch! +} + +""" +Represents an update to a `FunctionDefinition`. Fields that are set will be updated. +""" +input FunctionDefinitionPatch { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Function grouping scope (e.g. email, embed, chunk, custom)""" + scope: String + + """ + Function name within scope (e.g. send_verification_link, process_file_embedding) + """ + name: String + + """ + Computed routing slug: scope:name (used by Knative job worker for dispatch) + """ + taskIdentifier: String + + """Human-readable description of what this function does""" + description: String + + """ + Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() + """ + isInvocable: Boolean + + """Maximum retry attempts for the underlying job""" + maxAttempts: Int + + """Job priority (lower = higher priority)""" + priority: Int + + """Job queue name for serialization (e.g. email, ai, default)""" + queueName: String + + """ + Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) + """ + runtime: String + + """ + Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. + """ + image: String + + """ + Knative containerConcurrency — max concurrent requests per pod instance + """ + concurrency: Int + + """Minimum pod count for Knative autoscaling (minScale)""" + scaleMin: Int + + """Maximum pod count for Knative autoscaling (maxScale)""" + scaleMax: Int + + """Knative request timeout in seconds""" + timeoutSeconds: Int + + """ + Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} + """ + resources: JSON + + """ + Whether this function is a built-in platform function (synced from platform) vs user-created + """ + isBuiltIn: Boolean + + """Embedded secret requirements: array of (name, required) tuples""" + requiredSecrets: [FunctionRequirementInput] + + """Embedded config requirements: array of (name, required) tuples""" + requiredConfigs: [FunctionRequirementInput] + + """ + Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. + """ + requiredBuckets: [String] + + """ + Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. + """ + requiredModels: [String] + + """ + Data input ports: [{name, type, description?, optional?, multi?, schema?}] + """ + inputs: JSON + + """ + Data output ports: [{name, type, description?, optional?, multi?, schema?}] + """ + outputs: JSON + + """ + Configuration properties: [{name, type, default?, description?, required?, schema?}] + """ + props: JSON + + """ + Whether this function has side effects and cannot be cached or memoized + """ + volatile: Boolean + + """Icon identifier for UI palette rendering (e.g. mail, database, code)""" + icon: String + + """Palette grouping category (e.g. email, data, ai, custom)""" + category: String +} + +"""The output of our delete `FunctionApiBinding` mutation.""" +type DeleteFunctionApiBindingPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionApiBinding` that was deleted by this mutation.""" + functionApiBinding: FunctionApiBinding + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionApiBinding`. May be used by Relay 1.""" + functionApiBindingEdge( + """The method to use when ordering `FunctionApiBinding`.""" + orderBy: [FunctionApiBindingOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionApiBindingEdge +} + +"""All input for the `deleteFunctionApiBinding` mutation.""" +input DeleteFunctionApiBindingInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + +"""The output of our delete `FunctionGraphRef` mutation.""" +type DeleteFunctionGraphRefPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphRef` that was deleted by this mutation.""" + functionGraphRef: FunctionGraphRef + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphRef`. May be used by Relay 1.""" + functionGraphRefEdge( + """The method to use when ordering `FunctionGraphRef`.""" + orderBy: [FunctionGraphRefOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphRefEdge +} + +"""All input for the `deleteFunctionGraphRef` mutation.""" +input DeleteFunctionGraphRefInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique ref identifier""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! +} + +"""The output of our delete `FunctionGraphStore` mutation.""" +type DeleteFunctionGraphStorePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphStore` that was deleted by this mutation.""" + functionGraphStore: FunctionGraphStore + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphStore`. May be used by Relay 1.""" + functionGraphStoreEdge( + """The method to use when ordering `FunctionGraphStore`.""" + orderBy: [FunctionGraphStoreOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphStoreEdge +} + +"""All input for the `deleteFunctionGraphStore` mutation.""" +input DeleteFunctionGraphStoreInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique store identifier""" + id: UUID! +} + +"""The output of our delete `FunctionGraphObject` mutation.""" +type DeleteFunctionGraphObjectPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphObject` that was deleted by this mutation.""" + functionGraphObject: FunctionGraphObject + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphObject`. May be used by Relay 1.""" + functionGraphObjectEdge( + """The method to use when ordering `FunctionGraphObject`.""" + orderBy: [FunctionGraphObjectOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphObjectEdge +} + +"""All input for the `deleteFunctionGraphObject` mutation.""" +input DeleteFunctionGraphObjectInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Content-addressed UUID v5 — deterministic hash of (data, kids, ktree)""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! +} + +"""The output of our delete `FunctionDeploymentEvent` mutation.""" +type DeleteFunctionDeploymentEventPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeploymentEvent` that was deleted by this mutation.""" + functionDeploymentEvent: FunctionDeploymentEvent + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeploymentEvent`. May be used by Relay 1.""" + functionDeploymentEventEdge( + """The method to use when ordering `FunctionDeploymentEvent`.""" + orderBy: [FunctionDeploymentEventOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentEventEdge +} + +"""All input for the `deleteFunctionDeploymentEvent` mutation.""" +input DeleteFunctionDeploymentEventInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Event timestamp (partition key)""" + createdAt: Datetime! + + """Unique event identifier""" + id: UUID! +} + +"""The output of our delete `OrgFunctionExecutionLog` mutation.""" +type DeleteOrgFunctionExecutionLogPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `OrgFunctionExecutionLog` that was deleted by this mutation.""" + orgFunctionExecutionLog: OrgFunctionExecutionLog + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `OrgFunctionExecutionLog`. May be used by Relay 1.""" + orgFunctionExecutionLogEdge( + """The method to use when ordering `OrgFunctionExecutionLog`.""" + orderBy: [OrgFunctionExecutionLogOrderBy!]! = [PRIMARY_KEY_ASC] + ): OrgFunctionExecutionLogEdge +} + +"""All input for the `deleteOrgFunctionExecutionLog` mutation.""" +input DeleteOrgFunctionExecutionLogInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Log entry timestamp (partition key)""" + createdAt: Datetime! + + """Unique log entry identifier""" + id: UUID! +} + +"""The output of our delete `FunctionGraphExecutionOutput` mutation.""" +type DeleteFunctionGraphExecutionOutputPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphExecutionOutput` that was deleted by this mutation.""" + functionGraphExecutionOutput: FunctionGraphExecutionOutput + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """ + An edge for our `FunctionGraphExecutionOutput`. May be used by Relay 1. + """ + functionGraphExecutionOutputEdge( + """The method to use when ordering `FunctionGraphExecutionOutput`.""" + orderBy: [FunctionGraphExecutionOutputOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionOutputEdge +} + +"""All input for the `deleteFunctionGraphExecutionOutput` mutation.""" +input DeleteFunctionGraphExecutionOutputInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Timestamp of output creation""" + createdAt: Datetime! + + """Unique execution output identifier""" + id: UUID! +} + +"""The output of our delete `FunctionGraphCommit` mutation.""" +type DeleteFunctionGraphCommitPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphCommit` that was deleted by this mutation.""" + functionGraphCommit: FunctionGraphCommit + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphCommit`. May be used by Relay 1.""" + functionGraphCommitEdge( + """The method to use when ordering `FunctionGraphCommit`.""" + orderBy: [FunctionGraphCommitOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphCommitEdge +} + +"""All input for the `deleteFunctionGraphCommit` mutation.""" +input DeleteFunctionGraphCommitInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique commit identifier""" + id: UUID! + + """Database scope for multi-tenant isolation""" + databaseId: UUID! +} + +"""The output of our delete `SecretDefinition` mutation.""" +type DeleteSecretDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `SecretDefinition` that was deleted by this mutation.""" + secretDefinition: SecretDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `SecretDefinition`. May be used by Relay 1.""" + secretDefinitionEdge( + """The method to use when ordering `SecretDefinition`.""" + orderBy: [SecretDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): SecretDefinitionEdge +} + +"""All input for the `deleteSecretDefinition` mutation.""" +input DeleteSecretDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + +"""The output of our delete `FunctionExecutionLog` mutation.""" +type DeleteFunctionExecutionLogPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionExecutionLog` that was deleted by this mutation.""" + functionExecutionLog: FunctionExecutionLog + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionExecutionLog`. May be used by Relay 1.""" + functionExecutionLogEdge( + """The method to use when ordering `FunctionExecutionLog`.""" + orderBy: [FunctionExecutionLogOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionExecutionLogEdge +} + +"""All input for the `deleteFunctionExecutionLog` mutation.""" +input DeleteFunctionExecutionLogInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Log entry timestamp (partition key)""" + createdAt: Datetime! + + """Unique log entry identifier""" + id: UUID! +} + +"""The output of our delete `FunctionGraphExecutionNodeState` mutation.""" +type DeleteFunctionGraphExecutionNodeStatePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + The `FunctionGraphExecutionNodeState` that was deleted by this mutation. + """ + functionGraphExecutionNodeState: FunctionGraphExecutionNodeState + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """ + An edge for our `FunctionGraphExecutionNodeState`. May be used by Relay 1. + """ + functionGraphExecutionNodeStateEdge( + """The method to use when ordering `FunctionGraphExecutionNodeState`.""" + orderBy: [FunctionGraphExecutionNodeStateOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionNodeStateEdge +} + +"""All input for the `deleteFunctionGraphExecutionNodeState` mutation.""" +input DeleteFunctionGraphExecutionNodeStateInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Timestamp of node state creation (partition key)""" + createdAt: Datetime! + + """Unique node state identifier""" + id: UUID! +} + +"""The output of our delete `FunctionGraph` mutation.""" +type DeleteFunctionGraphPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraph` that was deleted by this mutation.""" + functionGraph: FunctionGraph + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraph`. May be used by Relay 1.""" + functionGraphEdge( + """The method to use when ordering `FunctionGraph`.""" + orderBy: [FunctionGraphOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphEdge +} + +"""All input for the `deleteFunctionGraph` mutation.""" +input DeleteFunctionGraphInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique graph identifier""" + id: UUID! +} + +"""The output of our delete `OrgFunctionInvocation` mutation.""" +type DeleteOrgFunctionInvocationPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `OrgFunctionInvocation` that was deleted by this mutation.""" + orgFunctionInvocation: OrgFunctionInvocation + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `OrgFunctionInvocation`. May be used by Relay 1.""" + orgFunctionInvocationEdge( + """The method to use when ordering `OrgFunctionInvocation`.""" + orderBy: [OrgFunctionInvocationOrderBy!]! = [PRIMARY_KEY_ASC] + ): OrgFunctionInvocationEdge +} + +"""All input for the `deleteOrgFunctionInvocation` mutation.""" +input DeleteOrgFunctionInvocationInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Invocation creation timestamp (partition key)""" + createdAt: Datetime! + + """Unique invocation identifier""" + id: UUID! +} + +"""The output of our delete `FunctionInvocation` mutation.""" +type DeleteFunctionInvocationPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionInvocation` that was deleted by this mutation.""" + functionInvocation: FunctionInvocation + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionInvocation`. May be used by Relay 1.""" + functionInvocationEdge( + """The method to use when ordering `FunctionInvocation`.""" + orderBy: [FunctionInvocationOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionInvocationEdge +} + +"""All input for the `deleteFunctionInvocation` mutation.""" +input DeleteFunctionInvocationInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Invocation creation timestamp (partition key)""" + createdAt: Datetime! + + """Unique invocation identifier""" + id: UUID! +} + +"""The output of our delete `FunctionDeployment` mutation.""" +type DeleteFunctionDeploymentPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeployment` that was deleted by this mutation.""" + functionDeployment: FunctionDeployment + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeployment`. May be used by Relay 1.""" + functionDeploymentEdge( + """The method to use when ordering `FunctionDeployment`.""" + orderBy: [FunctionDeploymentOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentEdge +} + +"""All input for the `deleteFunctionDeployment` mutation.""" +input DeleteFunctionDeploymentInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + +"""The output of our delete `FunctionGraphExecution` mutation.""" +type DeleteFunctionGraphExecutionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionGraphExecution` that was deleted by this mutation.""" + functionGraphExecution: FunctionGraphExecution + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionGraphExecution`. May be used by Relay 1.""" + functionGraphExecutionEdge( + """The method to use when ordering `FunctionGraphExecution`.""" + orderBy: [FunctionGraphExecutionOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionEdge +} + +"""All input for the `deleteFunctionGraphExecution` mutation.""" +input DeleteFunctionGraphExecutionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Execution start timestamp""" + startedAt: Datetime! + + """Unique execution identifier""" + id: UUID! +} + +"""The output of our delete `FunctionDefinition` mutation.""" +type DeleteFunctionDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDefinition` that was deleted by this mutation.""" + functionDefinition: FunctionDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDefinition`. May be used by Relay 1.""" + functionDefinitionEdge( + """The method to use when ordering `FunctionDefinition`.""" + orderBy: [FunctionDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDefinitionEdge +} + +"""All input for the `deleteFunctionDefinition` mutation.""" +input DeleteFunctionDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + +input ProvisionBucketInput { + """The logical bucket key (e.g., "public", "private")""" + bucketKey: String! + + """ + Owner entity ID for entity-scoped bucket provisioning. + Omit for app-level (database-wide) storage. + """ + ownerId: UUID +} + +type ProvisionBucketPayload { + """Whether provisioning succeeded""" + success: Boolean! + + """The S3 bucket name that was provisioned""" + bucketName: String! + + """The access type applied""" + accessType: String! + + """The storage provider used""" + provider: String! + + """The S3 endpoint (null for AWS S3 default)""" + endpoint: String + + """Error message if provisioning failed""" + error: String +} \ No newline at end of file diff --git a/sdk/constructive-sdk/schemas/config.graphql b/sdk/constructive-sdk/schemas/config.graphql new file mode 100644 index 0000000000..27a11484ea --- /dev/null +++ b/sdk/constructive-sdk/schemas/config.graphql @@ -0,0 +1,1613 @@ +"""The root query type which gives access points into the data universe.""" +type Query { + """ + Reads and enables pagination through a set of `PlatformConfigDefinition`. + """ + platformConfigDefinitions( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: PlatformConfigDefinitionFilter + + """The method to use when ordering `PlatformConfigDefinition`.""" + orderBy: [PlatformConfigDefinitionOrderBy!] = [PRIMARY_KEY_ASC] + ): PlatformConfigDefinitionConnection + + """Reads and enables pagination through a set of `PlatformConfig`.""" + platformConfigs( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: PlatformConfigFilter + + """The method to use when ordering `PlatformConfig`.""" + orderBy: [PlatformConfigOrderBy!] = [PRIMARY_KEY_ASC] + ): PlatformConfigConnection + + """ + Metadata about the database schema, including tables, fields, indexes, and constraints. Useful for code generation tools. + """ + _meta: MetaSchema +} + +"""A connection to a list of `PlatformConfigDefinition` values.""" +type PlatformConfigDefinitionConnection { + """A list of `PlatformConfigDefinition` objects.""" + nodes: [PlatformConfigDefinition]! + + """ + A list of edges which contains the `PlatformConfigDefinition` and cursor to aid in pagination. + """ + edges: [PlatformConfigDefinitionEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `PlatformConfigDefinition` you could get from the connection. + """ + totalCount: Int! +} + +""" +Registry of valid config keys — declares which config entries the platform recognizes +""" +type PlatformConfigDefinition { + """Unique identifier for this config definition""" + id: UUID! + createdAt: Datetime + updatedAt: Datetime + + """Config key name (must match config table name for resolution)""" + name: String! + + """Human-readable description of what this config key controls""" + description: String + + """Default value used when no config entry exists for a namespace""" + defaultValue: String + + """Whether this row was seeded as a built-in config definition""" + isBuiltIn: Boolean! + + """Key-value metadata for filtering and grouping config definitions""" + labels: JSON! + + """Freeform metadata annotations for config definitions""" + annotations: JSON! +} + +""" +A universally unique identifier as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). +""" +scalar UUID + +""" +A point in time as described by the [ISO +8601](https://en.wikipedia.org/wiki/ISO_8601) and, if it has a timezone, [RFC +3339](https://datatracker.ietf.org/doc/html/rfc3339) standards. Input values +that do not conform to both ISO 8601 and RFC 3339 may be coerced, which may lead +to unexpected results. +""" +scalar Datetime + +""" +Represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON + +"""A `PlatformConfigDefinition` edge in the connection.""" +type PlatformConfigDefinitionEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `PlatformConfigDefinition` at the end of the edge.""" + node: PlatformConfigDefinition +} + +"""A location in a connection that can be used for resuming pagination.""" +scalar Cursor + +"""Information about pagination in a connection.""" +type PageInfo { + """When paginating forwards, are there more items?""" + hasNextPage: Boolean! + + """When paginating backwards, are there more items?""" + hasPreviousPage: Boolean! + + """When paginating backwards, the cursor to continue.""" + startCursor: Cursor + + """When paginating forwards, the cursor to continue.""" + endCursor: Cursor +} + +""" +A filter to be used against `PlatformConfigDefinition` object types. All fields are combined with a logical ‘and.’ +""" +input PlatformConfigDefinitionFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `updatedAt` field.""" + updatedAt: DatetimeFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `description` field.""" + description: StringFilter + + """Filter by the object’s `defaultValue` field.""" + defaultValue: StringFilter + + """Filter by the object’s `isBuiltIn` field.""" + isBuiltIn: BooleanFilter + + """Filter by the object’s `labels` field.""" + labels: JSONFilter + + """Filter by the object’s `annotations` field.""" + annotations: JSONFilter + + """Checks for all expressions in this list.""" + and: [PlatformConfigDefinitionFilter!] + + """Checks for any expressions in this list.""" + or: [PlatformConfigDefinitionFilter!] + + """Negates the expression.""" + not: PlatformConfigDefinitionFilter +} + +""" +A filter to be used against UUID fields. All fields are combined with a logical ‘and.’ +""" +input UUIDFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: UUID + + """Not equal to the specified value.""" + notEqualTo: UUID + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: UUID + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: UUID + + """Included in the specified list.""" + in: [UUID!] + + """Not included in the specified list.""" + notIn: [UUID!] + + """Less than the specified value.""" + lessThan: UUID + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: UUID + + """Greater than the specified value.""" + greaterThan: UUID + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: UUID +} + +""" +A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ +""" +input DatetimeFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: Datetime + + """Not equal to the specified value.""" + notEqualTo: Datetime + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Datetime + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Datetime + + """Included in the specified list.""" + in: [Datetime!] + + """Not included in the specified list.""" + notIn: [Datetime!] + + """Less than the specified value.""" + lessThan: Datetime + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: Datetime + + """Greater than the specified value.""" + greaterThan: Datetime + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: Datetime +} + +""" +A filter to be used against String fields. All fields are combined with a logical ‘and.’ +""" +input StringFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: String + + """Not equal to the specified value.""" + notEqualTo: String + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: String + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: String + + """Included in the specified list.""" + in: [String!] + + """Not included in the specified list.""" + notIn: [String!] + + """Less than the specified value.""" + lessThan: String + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: String + + """Greater than the specified value.""" + greaterThan: String + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: String + + """Contains the specified string (case-sensitive).""" + includes: String + + """Does not contain the specified string (case-sensitive).""" + notIncludes: String + + """Contains the specified string (case-insensitive).""" + includesInsensitive: String + + """Does not contain the specified string (case-insensitive).""" + notIncludesInsensitive: String + + """Starts with the specified string (case-sensitive).""" + startsWith: String + + """Does not start with the specified string (case-sensitive).""" + notStartsWith: String + + """Starts with the specified string (case-insensitive).""" + startsWithInsensitive: String + + """Does not start with the specified string (case-insensitive).""" + notStartsWithInsensitive: String + + """Ends with the specified string (case-sensitive).""" + endsWith: String + + """Does not end with the specified string (case-sensitive).""" + notEndsWith: String + + """Ends with the specified string (case-insensitive).""" + endsWithInsensitive: String + + """Does not end with the specified string (case-insensitive).""" + notEndsWithInsensitive: String + + """ + Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + like: String + + """ + Does not match the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + notLike: String + + """ + Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + likeInsensitive: String + + """ + Does not match the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + notLikeInsensitive: String + + """Equal to the specified value (case-insensitive).""" + equalToInsensitive: String + + """Not equal to the specified value (case-insensitive).""" + notEqualToInsensitive: String + + """ + Not equal to the specified value, treating null like an ordinary value (case-insensitive). + """ + distinctFromInsensitive: String + + """ + Equal to the specified value, treating null like an ordinary value (case-insensitive). + """ + notDistinctFromInsensitive: String + + """Included in the specified list (case-insensitive).""" + inInsensitive: [String!] + + """Not included in the specified list (case-insensitive).""" + notInInsensitive: [String!] + + """Less than the specified value (case-insensitive).""" + lessThanInsensitive: String + + """Less than or equal to the specified value (case-insensitive).""" + lessThanOrEqualToInsensitive: String + + """Greater than the specified value (case-insensitive).""" + greaterThanInsensitive: String + + """Greater than or equal to the specified value (case-insensitive).""" + greaterThanOrEqualToInsensitive: String +} + +""" +A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ +""" +input BooleanFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: Boolean + + """Not equal to the specified value.""" + notEqualTo: Boolean + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Boolean + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Boolean + + """Included in the specified list.""" + in: [Boolean!] + + """Not included in the specified list.""" + notIn: [Boolean!] + + """Less than the specified value.""" + lessThan: Boolean + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: Boolean + + """Greater than the specified value.""" + greaterThan: Boolean + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: Boolean +} + +""" +A filter to be used against JSON fields. All fields are combined with a logical ‘and.’ +""" +input JSONFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: JSON + + """Not equal to the specified value.""" + notEqualTo: JSON + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: JSON + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: JSON + + """Included in the specified list.""" + in: [JSON!] + + """Not included in the specified list.""" + notIn: [JSON!] + + """Less than the specified value.""" + lessThan: JSON + + """Less than or equal to the specified value.""" + lessThanOrEqualTo: JSON + + """Greater than the specified value.""" + greaterThan: JSON + + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: JSON + + """Contains the specified JSON.""" + contains: JSON + + """Contains the specified key.""" + containsKey: String + + """Contains all of the specified keys.""" + containsAllKeys: [String!] + + """Contains any of the specified keys.""" + containsAnyKeys: [String!] + + """Contained by the specified JSON.""" + containedBy: JSON +} + +"""Methods to use when ordering `PlatformConfigDefinition`.""" +enum PlatformConfigDefinitionOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + NAME_ASC + NAME_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + DEFAULT_VALUE_ASC + DEFAULT_VALUE_DESC + IS_BUILT_IN_ASC + IS_BUILT_IN_DESC + LABELS_ASC + LABELS_DESC + ANNOTATIONS_ASC + ANNOTATIONS_DESC +} + +"""A connection to a list of `PlatformConfig` values.""" +type PlatformConfigConnection { + """A list of `PlatformConfig` objects.""" + nodes: [PlatformConfig]! + + """ + A list of edges which contains the `PlatformConfig` and cursor to aid in pagination. + """ + edges: [PlatformConfigEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `PlatformConfig` you could get from the connection.""" + totalCount: Int! +} + +""" +App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed +""" +type PlatformConfig { + """Unique identifier for this config entry""" + id: UUID! + + """FK to namespaces — logical grouping for config entries""" + namespaceId: UUID! + + """Key name identifying the config entry""" + name: String! + + """Plaintext config value""" + value: String + + """Key/value pairs for selecting/filtering config entries""" + labels: JSON! + + """Freeform metadata for tooling and operational notes""" + annotations: JSON! + + """Human-readable note about this config entry""" + description: String + createdAt: Datetime + updatedAt: Datetime + + """Optional expiration timestamp for time-limited config entries""" + expiresAt: Datetime +} + +"""A `PlatformConfig` edge in the connection.""" +type PlatformConfigEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `PlatformConfig` at the end of the edge.""" + node: PlatformConfig +} + +""" +A filter to be used against `PlatformConfig` object types. All fields are combined with a logical ‘and.’ +""" +input PlatformConfigFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `namespaceId` field.""" + namespaceId: UUIDFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `value` field.""" + value: StringFilter + + """Filter by the object’s `labels` field.""" + labels: JSONFilter + + """Filter by the object’s `annotations` field.""" + annotations: JSONFilter + + """Filter by the object’s `description` field.""" + description: StringFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Filter by the object’s `updatedAt` field.""" + updatedAt: DatetimeFilter + + """Filter by the object’s `expiresAt` field.""" + expiresAt: DatetimeFilter + + """Checks for all expressions in this list.""" + and: [PlatformConfigFilter!] + + """Checks for any expressions in this list.""" + or: [PlatformConfigFilter!] + + """Negates the expression.""" + not: PlatformConfigFilter +} + +"""Methods to use when ordering `PlatformConfig`.""" +enum PlatformConfigOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + NAMESPACE_ID_ASC + NAMESPACE_ID_DESC + NAME_ASC + NAME_DESC + VALUE_ASC + VALUE_DESC + LABELS_ASC + LABELS_DESC + ANNOTATIONS_ASC + ANNOTATIONS_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + EXPIRES_AT_ASC + EXPIRES_AT_DESC +} + +"""Root meta schema type""" +type MetaSchema { + tables: [MetaTable!]! +} + +"""Information about a database table""" +type MetaTable { + name: String! + schemaName: String! + fields: [MetaField!]! + indexes: [MetaIndex!]! + constraints: MetaConstraints! + foreignKeyConstraints: [MetaForeignKeyConstraint!]! + primaryKeyConstraints: [MetaPrimaryKeyConstraint!]! + uniqueConstraints: [MetaUniqueConstraint!]! + relations: MetaRelations! + inflection: MetaInflection! + query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime +} + +"""Information about a table field/column""" +type MetaField { + name: String! + type: MetaType! + isNotNull: Boolean! + hasDefault: Boolean! + isPrimaryKey: Boolean! + isForeignKey: Boolean! + description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum +} + +"""Information about a PostgreSQL type""" +type MetaType { + pgType: String! + gqlType: String! + isArray: Boolean! + isNotNull: Boolean + hasDefault: Boolean + subtype: String +} + +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + +"""Information about a database index""" +type MetaIndex { + name: String! + isUnique: Boolean! + isPrimary: Boolean! + columns: [String!]! + fields: [MetaField!] +} + +"""Table constraints""" +type MetaConstraints { + primaryKey: MetaPrimaryKeyConstraint + unique: [MetaUniqueConstraint!]! + foreignKey: [MetaForeignKeyConstraint!]! +} + +"""Information about a primary key constraint""" +type MetaPrimaryKeyConstraint { + name: String! + fields: [MetaField!]! +} + +"""Information about a unique constraint""" +type MetaUniqueConstraint { + name: String! + fields: [MetaField!]! +} + +"""Information about a foreign key constraint""" +type MetaForeignKeyConstraint { + name: String! + fields: [MetaField!]! + referencedTable: String! + referencedFields: [String!]! + refFields: [MetaField!] + refTable: MetaRefTable +} + +"""Reference to a related table""" +type MetaRefTable { + name: String! +} + +"""Table relations""" +type MetaRelations { + belongsTo: [MetaBelongsToRelation!]! + has: [MetaHasRelation!]! + hasOne: [MetaHasRelation!]! + hasMany: [MetaHasRelation!]! + manyToMany: [MetaManyToManyRelation!]! +} + +"""A belongs-to (forward FK) relation""" +type MetaBelongsToRelation { + fieldName: String + isUnique: Boolean! + type: String + keys: [MetaField!]! + references: MetaRefTable! +} + +"""A has-one or has-many (reverse FK) relation""" +type MetaHasRelation { + fieldName: String + isUnique: Boolean! + type: String + keys: [MetaField!]! + referencedBy: MetaRefTable! +} + +"""A many-to-many relation via junction table""" +type MetaManyToManyRelation { + fieldName: String + type: String + junctionTable: MetaRefTable! + junctionLeftConstraint: MetaForeignKeyConstraint! + junctionLeftKeyAttributes: [MetaField!]! + junctionRightConstraint: MetaForeignKeyConstraint! + junctionRightKeyAttributes: [MetaField!]! + leftKeyAttributes: [MetaField!]! + rightKeyAttributes: [MetaField!]! + rightTable: MetaRefTable! +} + +"""Table inflection names""" +type MetaInflection { + tableType: String! + allRows: String! + connection: String! + edge: String! + filterType: String + orderByType: String! + conditionType: String! + patchType: String + createInputType: String! + createPayloadType: String! + updatePayloadType: String + deletePayloadType: String! +} + +"""Table query/mutation names""" +type MetaQuery { + all: String! + one: String + create: String + update: String + delete: String +} + +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + +""" +The root mutation type which contains root level fields which mutate data. +""" +type Mutation { + platformSecretsDel( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PlatformSecretsDelInput! + ): PlatformSecretsDelPayload + orgSecretsDel( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: OrgSecretsDelInput! + ): OrgSecretsDelPayload + platformSecretsRemoveArray( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PlatformSecretsRemoveArrayInput! + ): PlatformSecretsRemoveArrayPayload + orgSecretsRemoveArray( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: OrgSecretsRemoveArrayInput! + ): OrgSecretsRemoveArrayPayload + platformSecretsRotate( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PlatformSecretsRotateInput! + ): PlatformSecretsRotatePayload + platformSecretsSet( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: PlatformSecretsSetInput! + ): PlatformSecretsSetPayload + orgSecretsRotate( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: OrgSecretsRotateInput! + ): OrgSecretsRotatePayload + orgSecretsSet( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: OrgSecretsSetInput! + ): OrgSecretsSetPayload + + """Creates a single `PlatformConfigDefinition`.""" + createPlatformConfigDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreatePlatformConfigDefinitionInput! + ): CreatePlatformConfigDefinitionPayload + + """Creates a single `PlatformConfig`.""" + createPlatformConfig( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreatePlatformConfigInput! + ): CreatePlatformConfigPayload + + """ + Updates a single `PlatformConfigDefinition` using a unique key and a patch. + """ + updatePlatformConfigDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdatePlatformConfigDefinitionInput! + ): UpdatePlatformConfigDefinitionPayload + + """Updates a single `PlatformConfig` using a unique key and a patch.""" + updatePlatformConfig( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdatePlatformConfigInput! + ): UpdatePlatformConfigPayload + + """Deletes a single `PlatformConfigDefinition` using a unique key.""" + deletePlatformConfigDefinition( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeletePlatformConfigDefinitionInput! + ): DeletePlatformConfigDefinitionPayload + + """Deletes a single `PlatformConfig` using a unique key.""" + deletePlatformConfig( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeletePlatformConfigInput! + ): DeletePlatformConfigPayload + + """ + Provision an S3 bucket for a logical bucket in the database. + Reads the bucket config via RLS, then creates and configures + the S3 bucket with the appropriate privacy policies, CORS rules, + and lifecycle settings. + """ + provisionBucket( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: ProvisionBucketInput! + ): ProvisionBucketPayload +} + +"""The output of our `platformSecretsDel` mutation.""" +type PlatformSecretsDelPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `platformSecretsDel` mutation.""" +input PlatformSecretsDelInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + secretName: String + namespaceId: UUID +} + +"""The output of our `orgSecretsDel` mutation.""" +type OrgSecretsDelPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `orgSecretsDel` mutation.""" +input OrgSecretsDelInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + ownerId: UUID + secretName: String + namespaceId: UUID +} + +"""The output of our `platformSecretsRemoveArray` mutation.""" +type PlatformSecretsRemoveArrayPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `platformSecretsRemoveArray` mutation.""" +input PlatformSecretsRemoveArrayInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + secretNames: [String] + namespaceId: UUID +} + +"""The output of our `orgSecretsRemoveArray` mutation.""" +type OrgSecretsRemoveArrayPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `orgSecretsRemoveArray` mutation.""" +input OrgSecretsRemoveArrayInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + ownerId: UUID + secretNames: [String] + namespaceId: UUID +} + +"""The output of our `platformSecretsRotate` mutation.""" +type PlatformSecretsRotatePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: Boolean + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `platformSecretsRotate` mutation.""" +input PlatformSecretsRotateInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + secretName: String + secretValue: String + namespaceId: UUID + algo: String +} + +"""The output of our `platformSecretsSet` mutation.""" +type PlatformSecretsSetPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: Boolean + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `platformSecretsSet` mutation.""" +input PlatformSecretsSetInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + secretName: String + secretValue: String + secretNamespaceId: UUID + algo: String +} + +"""The output of our `orgSecretsRotate` mutation.""" +type OrgSecretsRotatePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: Boolean + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `orgSecretsRotate` mutation.""" +input OrgSecretsRotateInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + ownerId: UUID + secretName: String + secretValue: String + namespaceId: UUID + algo: String +} + +"""The output of our `orgSecretsSet` mutation.""" +type OrgSecretsSetPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + result: Boolean + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the `orgSecretsSet` mutation.""" +input OrgSecretsSetInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + scopeOwnerId: UUID + secretName: String + secretValue: String + secretNamespaceId: UUID + algo: String +} + +"""The output of our create `PlatformConfigDefinition` mutation.""" +type CreatePlatformConfigDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `PlatformConfigDefinition` that was created by this mutation.""" + platformConfigDefinition: PlatformConfigDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PlatformConfigDefinition`. May be used by Relay 1.""" + platformConfigDefinitionEdge( + """The method to use when ordering `PlatformConfigDefinition`.""" + orderBy: [PlatformConfigDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): PlatformConfigDefinitionEdge +} + +"""All input for the create `PlatformConfigDefinition` mutation.""" +input CreatePlatformConfigDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `PlatformConfigDefinition` to be created by this mutation.""" + platformConfigDefinition: PlatformConfigDefinitionInput! +} + +"""An input for mutations affecting `PlatformConfigDefinition`""" +input PlatformConfigDefinitionInput { + """Unique identifier for this config definition""" + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Config key name (must match config table name for resolution)""" + name: String! + + """Human-readable description of what this config key controls""" + description: String + + """Default value used when no config entry exists for a namespace""" + defaultValue: String + + """Whether this row was seeded as a built-in config definition""" + isBuiltIn: Boolean + + """Key-value metadata for filtering and grouping config definitions""" + labels: JSON + + """Freeform metadata annotations for config definitions""" + annotations: JSON +} + +"""The output of our create `PlatformConfig` mutation.""" +type CreatePlatformConfigPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `PlatformConfig` that was created by this mutation.""" + platformConfig: PlatformConfig + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PlatformConfig`. May be used by Relay 1.""" + platformConfigEdge( + """The method to use when ordering `PlatformConfig`.""" + orderBy: [PlatformConfigOrderBy!]! = [PRIMARY_KEY_ASC] + ): PlatformConfigEdge +} + +"""All input for the create `PlatformConfig` mutation.""" +input CreatePlatformConfigInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `PlatformConfig` to be created by this mutation.""" + platformConfig: PlatformConfigInput! +} + +"""An input for mutations affecting `PlatformConfig`""" +input PlatformConfigInput { + """Unique identifier for this config entry""" + id: UUID + + """FK to namespaces — logical grouping for config entries""" + namespaceId: UUID! + + """Key name identifying the config entry""" + name: String! + + """Plaintext config value""" + value: String + + """Key/value pairs for selecting/filtering config entries""" + labels: JSON + + """Freeform metadata for tooling and operational notes""" + annotations: JSON + + """Human-readable note about this config entry""" + description: String + createdAt: Datetime + updatedAt: Datetime + + """Optional expiration timestamp for time-limited config entries""" + expiresAt: Datetime +} + +"""The output of our update `PlatformConfigDefinition` mutation.""" +type UpdatePlatformConfigDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `PlatformConfigDefinition` that was updated by this mutation.""" + platformConfigDefinition: PlatformConfigDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PlatformConfigDefinition`. May be used by Relay 1.""" + platformConfigDefinitionEdge( + """The method to use when ordering `PlatformConfigDefinition`.""" + orderBy: [PlatformConfigDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): PlatformConfigDefinitionEdge +} + +"""All input for the `updatePlatformConfigDefinition` mutation.""" +input UpdatePlatformConfigDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique identifier for this config definition""" + id: UUID! + + """ + An object where the defined keys will be set on the `PlatformConfigDefinition` being updated. + """ + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch! +} + +""" +Represents an update to a `PlatformConfigDefinition`. Fields that are set will be updated. +""" +input PlatformConfigDefinitionPatch { + """Unique identifier for this config definition""" + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """Config key name (must match config table name for resolution)""" + name: String + + """Human-readable description of what this config key controls""" + description: String + + """Default value used when no config entry exists for a namespace""" + defaultValue: String + + """Whether this row was seeded as a built-in config definition""" + isBuiltIn: Boolean + + """Key-value metadata for filtering and grouping config definitions""" + labels: JSON + + """Freeform metadata annotations for config definitions""" + annotations: JSON +} + +"""The output of our update `PlatformConfig` mutation.""" +type UpdatePlatformConfigPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `PlatformConfig` that was updated by this mutation.""" + platformConfig: PlatformConfig + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PlatformConfig`. May be used by Relay 1.""" + platformConfigEdge( + """The method to use when ordering `PlatformConfig`.""" + orderBy: [PlatformConfigOrderBy!]! = [PRIMARY_KEY_ASC] + ): PlatformConfigEdge +} + +"""All input for the `updatePlatformConfig` mutation.""" +input UpdatePlatformConfigInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique identifier for this config entry""" + id: UUID! + + """ + An object where the defined keys will be set on the `PlatformConfig` being updated. + """ + platformConfigPatch: PlatformConfigPatch! +} + +""" +Represents an update to a `PlatformConfig`. Fields that are set will be updated. +""" +input PlatformConfigPatch { + """Unique identifier for this config entry""" + id: UUID + + """FK to namespaces — logical grouping for config entries""" + namespaceId: UUID + + """Key name identifying the config entry""" + name: String + + """Plaintext config value""" + value: String + + """Key/value pairs for selecting/filtering config entries""" + labels: JSON + + """Freeform metadata for tooling and operational notes""" + annotations: JSON + + """Human-readable note about this config entry""" + description: String + createdAt: Datetime + updatedAt: Datetime + + """Optional expiration timestamp for time-limited config entries""" + expiresAt: Datetime +} + +"""The output of our delete `PlatformConfigDefinition` mutation.""" +type DeletePlatformConfigDefinitionPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `PlatformConfigDefinition` that was deleted by this mutation.""" + platformConfigDefinition: PlatformConfigDefinition + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PlatformConfigDefinition`. May be used by Relay 1.""" + platformConfigDefinitionEdge( + """The method to use when ordering `PlatformConfigDefinition`.""" + orderBy: [PlatformConfigDefinitionOrderBy!]! = [PRIMARY_KEY_ASC] + ): PlatformConfigDefinitionEdge +} + +"""All input for the `deletePlatformConfigDefinition` mutation.""" +input DeletePlatformConfigDefinitionInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique identifier for this config definition""" + id: UUID! +} + +"""The output of our delete `PlatformConfig` mutation.""" +type DeletePlatformConfigPayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `PlatformConfig` that was deleted by this mutation.""" + platformConfig: PlatformConfig + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PlatformConfig`. May be used by Relay 1.""" + platformConfigEdge( + """The method to use when ordering `PlatformConfig`.""" + orderBy: [PlatformConfigOrderBy!]! = [PRIMARY_KEY_ASC] + ): PlatformConfigEdge +} + +"""All input for the `deletePlatformConfig` mutation.""" +input DeletePlatformConfigInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """Unique identifier for this config entry""" + id: UUID! +} + +input ProvisionBucketInput { + """The logical bucket key (e.g., "public", "private")""" + bucketKey: String! + + """ + Owner entity ID for entity-scoped bucket provisioning. + Omit for app-level (database-wide) storage. + """ + ownerId: UUID +} + +type ProvisionBucketPayload { + """Whether provisioning succeeded""" + success: Boolean! + + """The S3 bucket name that was provisioned""" + bucketName: String! + + """The access type applied""" + accessType: String! + + """The storage provider used""" + provider: String! + + """The S3 endpoint (null for AWS S3 default)""" + endpoint: String + + """Error message if provisioning failed""" + error: String +} \ No newline at end of file diff --git a/sdk/constructive-sdk/schemas/modules.graphql b/sdk/constructive-sdk/schemas/modules.graphql index b9932db782..750d6b37ec 100644 --- a/sdk/constructive-sdk/schemas/modules.graphql +++ b/sdk/constructive-sdk/schemas/modules.graphql @@ -836,6 +836,35 @@ type Query { orderBy: [ConfigSecretsModuleOrderBy!] = [PRIMARY_KEY_ASC] ): ConfigSecretsModuleConnection + """Reads and enables pagination through a set of `GraphModule`.""" + graphModules( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: GraphModuleFilter + + """The method to use when ordering `GraphModule`.""" + orderBy: [GraphModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): GraphModuleConnection + """Reads and enables pagination through a set of `RateLimitMetersModule`.""" rateLimitMetersModules( """Only read the first `n` values of the set.""" @@ -1012,8 +1041,8 @@ type Query { orderBy: [InvitesModuleOrderBy!] = [PRIMARY_KEY_ASC] ): InvitesModuleConnection - """Reads and enables pagination through a set of `NamespaceModule`.""" - namespaceModules( + """Reads and enables pagination through a set of `ComputeLogModule`.""" + computeLogModules( """Only read the first `n` values of the set.""" first: Int @@ -1035,14 +1064,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: NamespaceModuleFilter + where: ComputeLogModuleFilter - """The method to use when ordering `NamespaceModule`.""" - orderBy: [NamespaceModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): NamespaceModuleConnection + """The method to use when ordering `ComputeLogModule`.""" + orderBy: [ComputeLogModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): ComputeLogModuleConnection - """Reads and enables pagination through a set of `ComputeLogModule`.""" - computeLogModules( + """Reads and enables pagination through a set of `InferenceLogModule`.""" + inferenceLogModules( """Only read the first `n` values of the set.""" first: Int @@ -1064,14 +1093,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: ComputeLogModuleFilter + where: InferenceLogModuleFilter - """The method to use when ordering `ComputeLogModule`.""" - orderBy: [ComputeLogModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): ComputeLogModuleConnection + """The method to use when ordering `InferenceLogModule`.""" + orderBy: [InferenceLogModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): InferenceLogModuleConnection - """Reads and enables pagination through a set of `GraphModule`.""" - graphModules( + """Reads and enables pagination through a set of `NamespaceModule`.""" + namespaceModules( """Only read the first `n` values of the set.""" first: Int @@ -1093,14 +1122,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: GraphModuleFilter + where: NamespaceModuleFilter - """The method to use when ordering `GraphModule`.""" - orderBy: [GraphModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): GraphModuleConnection + """The method to use when ordering `NamespaceModule`.""" + orderBy: [NamespaceModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): NamespaceModuleConnection - """Reads and enables pagination through a set of `InferenceLogModule`.""" - inferenceLogModules( + """Reads and enables pagination through a set of `StorageLogModule`.""" + storageLogModules( """Only read the first `n` values of the set.""" first: Int @@ -1122,14 +1151,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: InferenceLogModuleFilter + where: StorageLogModuleFilter - """The method to use when ordering `InferenceLogModule`.""" - orderBy: [InferenceLogModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): InferenceLogModuleConnection + """The method to use when ordering `StorageLogModule`.""" + orderBy: [StorageLogModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): StorageLogModuleConnection - """Reads and enables pagination through a set of `StorageLogModule`.""" - storageLogModules( + """Reads and enables pagination through a set of `TransferLogModule`.""" + transferLogModules( """Only read the first `n` values of the set.""" first: Int @@ -1151,14 +1180,16 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: StorageLogModuleFilter + where: TransferLogModuleFilter - """The method to use when ordering `StorageLogModule`.""" - orderBy: [StorageLogModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): StorageLogModuleConnection + """The method to use when ordering `TransferLogModule`.""" + orderBy: [TransferLogModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): TransferLogModuleConnection - """Reads and enables pagination through a set of `TransferLogModule`.""" - transferLogModules( + """ + Reads and enables pagination through a set of `FunctionDeploymentModule`. + """ + functionDeploymentModules( """Only read the first `n` values of the set.""" first: Int @@ -1180,11 +1211,11 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: TransferLogModuleFilter + where: FunctionDeploymentModuleFilter - """The method to use when ordering `TransferLogModule`.""" - orderBy: [TransferLogModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): TransferLogModuleConnection + """The method to use when ordering `FunctionDeploymentModule`.""" + orderBy: [FunctionDeploymentModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionDeploymentModuleConnection """Reads and enables pagination through a set of `PlansModule`.""" plansModules( @@ -1273,6 +1304,35 @@ type Query { orderBy: [DbUsageModuleOrderBy!] = [PRIMARY_KEY_ASC] ): DbUsageModuleConnection + """Reads and enables pagination through a set of `GraphExecutionModule`.""" + graphExecutionModules( + """Only read the first `n` values of the set.""" + first: Int + + """Only read the last `n` values of the set.""" + last: Int + + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: GraphExecutionModuleFilter + + """The method to use when ordering `GraphExecutionModule`.""" + orderBy: [GraphExecutionModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): GraphExecutionModuleConnection + """Reads and enables pagination through a set of `HierarchyModule`.""" hierarchyModules( """Only read the first `n` values of the set.""" @@ -5646,8 +5706,6 @@ type GraphModule { prefix: String! merkleStoreModuleId: UUID! graphsTableId: UUID! - executionsTableId: UUID! - outputsTableId: UUID! apiName: String privateApiName: String entityTableId: UUID @@ -5705,12 +5763,6 @@ input GraphModuleFilter { """Filter by the object’s `graphsTableId` field.""" graphsTableId: UUIDFilter - """Filter by the object’s `executionsTableId` field.""" - executionsTableId: UUIDFilter - - """Filter by the object’s `outputsTableId` field.""" - outputsTableId: UUIDFilter - """Filter by the object’s `apiName` field.""" apiName: StringFilter @@ -5852,10 +5904,6 @@ enum GraphModuleOrderBy { MERKLE_STORE_MODULE_ID_DESC GRAPHS_TABLE_ID_ASC GRAPHS_TABLE_ID_DESC - EXECUTIONS_TABLE_ID_ASC - EXECUTIONS_TABLE_ID_DESC - OUTPUTS_TABLE_ID_ASC - OUTPUTS_TABLE_ID_DESC API_NAME_ASC API_NAME_DESC PRIVATE_API_NAME_ASC @@ -7154,59 +7202,60 @@ enum InvitesModuleOrderBy { PRIVATE_API_NAME_DESC } -"""A connection to a list of `NamespaceModule` values.""" -type NamespaceModuleConnection { - """A list of `NamespaceModule` objects.""" - nodes: [NamespaceModule]! +"""A connection to a list of `ComputeLogModule` values.""" +type ComputeLogModuleConnection { + """A list of `ComputeLogModule` objects.""" + nodes: [ComputeLogModule]! """ - A list of edges which contains the `NamespaceModule` and cursor to aid in pagination. + A list of edges which contains the `ComputeLogModule` and cursor to aid in pagination. """ - edges: [NamespaceModuleEdge]! + edges: [ComputeLogModuleEdge]! """Information to aid in pagination.""" pageInfo: PageInfo! """ - The count of *all* `NamespaceModule` you could get from the connection. + The count of *all* `ComputeLogModule` you could get from the connection. """ totalCount: Int! } -type NamespaceModule { +type ComputeLogModule { id: UUID! databaseId: UUID! schemaId: UUID! privateSchemaId: UUID! publicSchemaName: String privateSchemaName: String - namespacesTableId: UUID! - namespaceEventsTableId: UUID! - namespacesTableName: String! - namespaceEventsTableName: String! - apiName: String - privateApiName: String + computeLogTableId: UUID! + computeLogTableName: String! + usageDailyTableId: UUID! + usageDailyTableName: String! + interval: String! + retention: String! + premake: Int! scope: String! + actorFkTableId: UUID + entityFkTableId: UUID prefix: String! - entityTableId: UUID - policies: JSON - provisions: JSON - defaultPermissions: [String] + apiName: String + privateApiName: String } -"""A `NamespaceModule` edge in the connection.""" -type NamespaceModuleEdge { +"""A `ComputeLogModule` edge in the connection.""" +type ComputeLogModuleEdge { """A cursor for use in pagination.""" cursor: Cursor - """The `NamespaceModule` at the end of the edge.""" - node: NamespaceModule + """The `ComputeLogModule` at the end of the edge.""" + node: ComputeLogModule } """ -A filter to be used against `NamespaceModule` object types. All fields are combined with a logical ‘and.’ +A filter to be used against `ComputeLogModule` object types. All fields are combined with a logical ‘and.’ """ -input NamespaceModuleFilter { +input ComputeLogModuleFilter { """Filter by the object’s `id` field.""" id: UUIDFilter @@ -7225,54 +7274,57 @@ input NamespaceModuleFilter { """Filter by the object’s `privateSchemaName` field.""" privateSchemaName: StringFilter - """Filter by the object’s `namespacesTableId` field.""" - namespacesTableId: UUIDFilter + """Filter by the object’s `computeLogTableId` field.""" + computeLogTableId: UUIDFilter - """Filter by the object’s `namespaceEventsTableId` field.""" - namespaceEventsTableId: UUIDFilter + """Filter by the object’s `computeLogTableName` field.""" + computeLogTableName: StringFilter - """Filter by the object’s `namespacesTableName` field.""" - namespacesTableName: StringFilter + """Filter by the object’s `usageDailyTableId` field.""" + usageDailyTableId: UUIDFilter - """Filter by the object’s `namespaceEventsTableName` field.""" - namespaceEventsTableName: StringFilter + """Filter by the object’s `usageDailyTableName` field.""" + usageDailyTableName: StringFilter - """Filter by the object’s `apiName` field.""" - apiName: StringFilter + """Filter by the object’s `interval` field.""" + interval: StringFilter - """Filter by the object’s `privateApiName` field.""" - privateApiName: StringFilter + """Filter by the object’s `retention` field.""" + retention: StringFilter + + """Filter by the object’s `premake` field.""" + premake: IntFilter """Filter by the object’s `scope` field.""" scope: StringFilter - """Filter by the object’s `prefix` field.""" - prefix: StringFilter + """Filter by the object’s `actorFkTableId` field.""" + actorFkTableId: UUIDFilter - """Filter by the object’s `entityTableId` field.""" - entityTableId: UUIDFilter + """Filter by the object’s `entityFkTableId` field.""" + entityFkTableId: UUIDFilter - """Filter by the object’s `policies` field.""" - policies: JSONFilter + """Filter by the object’s `prefix` field.""" + prefix: StringFilter - """Filter by the object’s `provisions` field.""" - provisions: JSONFilter + """Filter by the object’s `apiName` field.""" + apiName: StringFilter - """Filter by the object’s `defaultPermissions` field.""" - defaultPermissions: StringListFilter + """Filter by the object’s `privateApiName` field.""" + privateApiName: StringFilter """Checks for all expressions in this list.""" - and: [NamespaceModuleFilter!] + and: [ComputeLogModuleFilter!] """Checks for any expressions in this list.""" - or: [NamespaceModuleFilter!] + or: [ComputeLogModuleFilter!] """Negates the expression.""" - not: NamespaceModuleFilter + not: ComputeLogModuleFilter } -"""Methods to use when ordering `NamespaceModule`.""" -enum NamespaceModuleOrderBy { +"""Methods to use when ordering `ComputeLogModule`.""" +enum ComputeLogModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC @@ -7288,60 +7340,62 @@ enum NamespaceModuleOrderBy { PUBLIC_SCHEMA_NAME_DESC PRIVATE_SCHEMA_NAME_ASC PRIVATE_SCHEMA_NAME_DESC - NAMESPACES_TABLE_ID_ASC - NAMESPACES_TABLE_ID_DESC - NAMESPACE_EVENTS_TABLE_ID_ASC - NAMESPACE_EVENTS_TABLE_ID_DESC - NAMESPACES_TABLE_NAME_ASC - NAMESPACES_TABLE_NAME_DESC - NAMESPACE_EVENTS_TABLE_NAME_ASC - NAMESPACE_EVENTS_TABLE_NAME_DESC - API_NAME_ASC - API_NAME_DESC - PRIVATE_API_NAME_ASC - PRIVATE_API_NAME_DESC - SCOPE_ASC - SCOPE_DESC - PREFIX_ASC - PREFIX_DESC - ENTITY_TABLE_ID_ASC - ENTITY_TABLE_ID_DESC - POLICIES_ASC - POLICIES_DESC - PROVISIONS_ASC - PROVISIONS_DESC - DEFAULT_PERMISSIONS_ASC - DEFAULT_PERMISSIONS_DESC + COMPUTE_LOG_TABLE_ID_ASC + COMPUTE_LOG_TABLE_ID_DESC + COMPUTE_LOG_TABLE_NAME_ASC + COMPUTE_LOG_TABLE_NAME_DESC + USAGE_DAILY_TABLE_ID_ASC + USAGE_DAILY_TABLE_ID_DESC + USAGE_DAILY_TABLE_NAME_ASC + USAGE_DAILY_TABLE_NAME_DESC + INTERVAL_ASC + INTERVAL_DESC + RETENTION_ASC + RETENTION_DESC + PREMAKE_ASC + PREMAKE_DESC + SCOPE_ASC + SCOPE_DESC + ACTOR_FK_TABLE_ID_ASC + ACTOR_FK_TABLE_ID_DESC + ENTITY_FK_TABLE_ID_ASC + ENTITY_FK_TABLE_ID_DESC + PREFIX_ASC + PREFIX_DESC + API_NAME_ASC + API_NAME_DESC + PRIVATE_API_NAME_ASC + PRIVATE_API_NAME_DESC } -"""A connection to a list of `ComputeLogModule` values.""" -type ComputeLogModuleConnection { - """A list of `ComputeLogModule` objects.""" - nodes: [ComputeLogModule]! +"""A connection to a list of `InferenceLogModule` values.""" +type InferenceLogModuleConnection { + """A list of `InferenceLogModule` objects.""" + nodes: [InferenceLogModule]! """ - A list of edges which contains the `ComputeLogModule` and cursor to aid in pagination. + A list of edges which contains the `InferenceLogModule` and cursor to aid in pagination. """ - edges: [ComputeLogModuleEdge]! + edges: [InferenceLogModuleEdge]! """Information to aid in pagination.""" pageInfo: PageInfo! """ - The count of *all* `ComputeLogModule` you could get from the connection. + The count of *all* `InferenceLogModule` you could get from the connection. """ totalCount: Int! } -type ComputeLogModule { +type InferenceLogModule { id: UUID! databaseId: UUID! schemaId: UUID! privateSchemaId: UUID! publicSchemaName: String privateSchemaName: String - computeLogTableId: UUID! - computeLogTableName: String! + inferenceLogTableId: UUID! + inferenceLogTableName: String! usageDailyTableId: UUID! usageDailyTableName: String! interval: String! @@ -7355,19 +7409,19 @@ type ComputeLogModule { privateApiName: String } -"""A `ComputeLogModule` edge in the connection.""" -type ComputeLogModuleEdge { +"""A `InferenceLogModule` edge in the connection.""" +type InferenceLogModuleEdge { """A cursor for use in pagination.""" cursor: Cursor - """The `ComputeLogModule` at the end of the edge.""" - node: ComputeLogModule + """The `InferenceLogModule` at the end of the edge.""" + node: InferenceLogModule } """ -A filter to be used against `ComputeLogModule` object types. All fields are combined with a logical ‘and.’ +A filter to be used against `InferenceLogModule` object types. All fields are combined with a logical ‘and.’ """ -input ComputeLogModuleFilter { +input InferenceLogModuleFilter { """Filter by the object’s `id` field.""" id: UUIDFilter @@ -7386,11 +7440,11 @@ input ComputeLogModuleFilter { """Filter by the object’s `privateSchemaName` field.""" privateSchemaName: StringFilter - """Filter by the object’s `computeLogTableId` field.""" - computeLogTableId: UUIDFilter + """Filter by the object’s `inferenceLogTableId` field.""" + inferenceLogTableId: UUIDFilter - """Filter by the object’s `computeLogTableName` field.""" - computeLogTableName: StringFilter + """Filter by the object’s `inferenceLogTableName` field.""" + inferenceLogTableName: StringFilter """Filter by the object’s `usageDailyTableId` field.""" usageDailyTableId: UUIDFilter @@ -7426,17 +7480,17 @@ input ComputeLogModuleFilter { privateApiName: StringFilter """Checks for all expressions in this list.""" - and: [ComputeLogModuleFilter!] + and: [InferenceLogModuleFilter!] """Checks for any expressions in this list.""" - or: [ComputeLogModuleFilter!] + or: [InferenceLogModuleFilter!] """Negates the expression.""" - not: ComputeLogModuleFilter + not: InferenceLogModuleFilter } -"""Methods to use when ordering `ComputeLogModule`.""" -enum ComputeLogModuleOrderBy { +"""Methods to use when ordering `InferenceLogModule`.""" +enum InferenceLogModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC @@ -7452,10 +7506,10 @@ enum ComputeLogModuleOrderBy { PUBLIC_SCHEMA_NAME_DESC PRIVATE_SCHEMA_NAME_ASC PRIVATE_SCHEMA_NAME_DESC - COMPUTE_LOG_TABLE_ID_ASC - COMPUTE_LOG_TABLE_ID_DESC - COMPUTE_LOG_TABLE_NAME_ASC - COMPUTE_LOG_TABLE_NAME_DESC + INFERENCE_LOG_TABLE_ID_ASC + INFERENCE_LOG_TABLE_ID_DESC + INFERENCE_LOG_TABLE_NAME_ASC + INFERENCE_LOG_TABLE_NAME_DESC USAGE_DAILY_TABLE_ID_ASC USAGE_DAILY_TABLE_ID_DESC USAGE_DAILY_TABLE_NAME_ASC @@ -7480,60 +7534,60 @@ enum ComputeLogModuleOrderBy { PRIVATE_API_NAME_DESC } -"""A connection to a list of `InferenceLogModule` values.""" -type InferenceLogModuleConnection { - """A list of `InferenceLogModule` objects.""" - nodes: [InferenceLogModule]! +"""A connection to a list of `NamespaceModule` values.""" +type NamespaceModuleConnection { + """A list of `NamespaceModule` objects.""" + nodes: [NamespaceModule]! """ - A list of edges which contains the `InferenceLogModule` and cursor to aid in pagination. + A list of edges which contains the `NamespaceModule` and cursor to aid in pagination. """ - edges: [InferenceLogModuleEdge]! + edges: [NamespaceModuleEdge]! """Information to aid in pagination.""" pageInfo: PageInfo! """ - The count of *all* `InferenceLogModule` you could get from the connection. + The count of *all* `NamespaceModule` you could get from the connection. """ totalCount: Int! } -type InferenceLogModule { +type NamespaceModule { id: UUID! databaseId: UUID! schemaId: UUID! privateSchemaId: UUID! publicSchemaName: String privateSchemaName: String - inferenceLogTableId: UUID! - inferenceLogTableName: String! - usageDailyTableId: UUID! - usageDailyTableName: String! - interval: String! - retention: String! - premake: Int! - scope: String! - actorFkTableId: UUID - entityFkTableId: UUID - prefix: String! + namespacesTableId: UUID! + namespaceEventsTableId: UUID! + namespacesTableName: String! + namespaceEventsTableName: String! apiName: String privateApiName: String + scope: String! + prefix: String! + entityTableId: UUID + platformNamespacesTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] } -"""A `InferenceLogModule` edge in the connection.""" -type InferenceLogModuleEdge { +"""A `NamespaceModule` edge in the connection.""" +type NamespaceModuleEdge { """A cursor for use in pagination.""" cursor: Cursor - """The `InferenceLogModule` at the end of the edge.""" - node: InferenceLogModule + """The `NamespaceModule` at the end of the edge.""" + node: NamespaceModule } """ -A filter to be used against `InferenceLogModule` object types. All fields are combined with a logical ‘and.’ +A filter to be used against `NamespaceModule` object types. All fields are combined with a logical ‘and.’ """ -input InferenceLogModuleFilter { +input NamespaceModuleFilter { """Filter by the object’s `id` field.""" id: UUIDFilter @@ -7552,57 +7606,57 @@ input InferenceLogModuleFilter { """Filter by the object’s `privateSchemaName` field.""" privateSchemaName: StringFilter - """Filter by the object’s `inferenceLogTableId` field.""" - inferenceLogTableId: UUIDFilter - - """Filter by the object’s `inferenceLogTableName` field.""" - inferenceLogTableName: StringFilter + """Filter by the object’s `namespacesTableId` field.""" + namespacesTableId: UUIDFilter - """Filter by the object’s `usageDailyTableId` field.""" - usageDailyTableId: UUIDFilter + """Filter by the object’s `namespaceEventsTableId` field.""" + namespaceEventsTableId: UUIDFilter - """Filter by the object’s `usageDailyTableName` field.""" - usageDailyTableName: StringFilter + """Filter by the object’s `namespacesTableName` field.""" + namespacesTableName: StringFilter - """Filter by the object’s `interval` field.""" - interval: StringFilter + """Filter by the object’s `namespaceEventsTableName` field.""" + namespaceEventsTableName: StringFilter - """Filter by the object’s `retention` field.""" - retention: StringFilter + """Filter by the object’s `apiName` field.""" + apiName: StringFilter - """Filter by the object’s `premake` field.""" - premake: IntFilter + """Filter by the object’s `privateApiName` field.""" + privateApiName: StringFilter """Filter by the object’s `scope` field.""" scope: StringFilter - """Filter by the object’s `actorFkTableId` field.""" - actorFkTableId: UUIDFilter - - """Filter by the object’s `entityFkTableId` field.""" - entityFkTableId: UUIDFilter - """Filter by the object’s `prefix` field.""" prefix: StringFilter - """Filter by the object’s `apiName` field.""" - apiName: StringFilter + """Filter by the object’s `entityTableId` field.""" + entityTableId: UUIDFilter - """Filter by the object’s `privateApiName` field.""" - privateApiName: StringFilter + """Filter by the object’s `platformNamespacesTableId` field.""" + platformNamespacesTableId: UUIDFilter + + """Filter by the object’s `policies` field.""" + policies: JSONFilter + + """Filter by the object’s `provisions` field.""" + provisions: JSONFilter + + """Filter by the object’s `defaultPermissions` field.""" + defaultPermissions: StringListFilter """Checks for all expressions in this list.""" - and: [InferenceLogModuleFilter!] + and: [NamespaceModuleFilter!] """Checks for any expressions in this list.""" - or: [InferenceLogModuleFilter!] + or: [NamespaceModuleFilter!] """Negates the expression.""" - not: InferenceLogModuleFilter + not: NamespaceModuleFilter } -"""Methods to use when ordering `InferenceLogModule`.""" -enum InferenceLogModuleOrderBy { +"""Methods to use when ordering `NamespaceModule`.""" +enum NamespaceModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC @@ -7618,32 +7672,32 @@ enum InferenceLogModuleOrderBy { PUBLIC_SCHEMA_NAME_DESC PRIVATE_SCHEMA_NAME_ASC PRIVATE_SCHEMA_NAME_DESC - INFERENCE_LOG_TABLE_ID_ASC - INFERENCE_LOG_TABLE_ID_DESC - INFERENCE_LOG_TABLE_NAME_ASC - INFERENCE_LOG_TABLE_NAME_DESC - USAGE_DAILY_TABLE_ID_ASC - USAGE_DAILY_TABLE_ID_DESC - USAGE_DAILY_TABLE_NAME_ASC - USAGE_DAILY_TABLE_NAME_DESC - INTERVAL_ASC - INTERVAL_DESC - RETENTION_ASC - RETENTION_DESC - PREMAKE_ASC - PREMAKE_DESC - SCOPE_ASC - SCOPE_DESC - ACTOR_FK_TABLE_ID_ASC - ACTOR_FK_TABLE_ID_DESC - ENTITY_FK_TABLE_ID_ASC - ENTITY_FK_TABLE_ID_DESC - PREFIX_ASC - PREFIX_DESC + NAMESPACES_TABLE_ID_ASC + NAMESPACES_TABLE_ID_DESC + NAMESPACE_EVENTS_TABLE_ID_ASC + NAMESPACE_EVENTS_TABLE_ID_DESC + NAMESPACES_TABLE_NAME_ASC + NAMESPACES_TABLE_NAME_DESC + NAMESPACE_EVENTS_TABLE_NAME_ASC + NAMESPACE_EVENTS_TABLE_NAME_DESC API_NAME_ASC API_NAME_DESC PRIVATE_API_NAME_ASC PRIVATE_API_NAME_DESC + SCOPE_ASC + SCOPE_DESC + PREFIX_ASC + PREFIX_DESC + ENTITY_TABLE_ID_ASC + ENTITY_TABLE_ID_DESC + PLATFORM_NAMESPACES_TABLE_ID_ASC + PLATFORM_NAMESPACES_TABLE_ID_DESC + POLICIES_ASC + POLICIES_DESC + PROVISIONS_ASC + PROVISIONS_DESC + DEFAULT_PERMISSIONS_ASC + DEFAULT_PERMISSIONS_DESC } """A connection to a list of `StorageLogModule` values.""" @@ -7978,37 +8032,231 @@ enum TransferLogModuleOrderBy { PRIVATE_API_NAME_DESC } -"""A connection to a list of `PlansModule` values.""" -type PlansModuleConnection { - """A list of `PlansModule` objects.""" - nodes: [PlansModule]! +"""A connection to a list of `FunctionDeploymentModule` values.""" +type FunctionDeploymentModuleConnection { + """A list of `FunctionDeploymentModule` objects.""" + nodes: [FunctionDeploymentModule]! """ - A list of edges which contains the `PlansModule` and cursor to aid in pagination. + A list of edges which contains the `FunctionDeploymentModule` and cursor to aid in pagination. """ - edges: [PlansModuleEdge]! + edges: [FunctionDeploymentModuleEdge]! """Information to aid in pagination.""" pageInfo: PageInfo! - """The count of *all* `PlansModule` you could get from the connection.""" + """ + The count of *all* `FunctionDeploymentModule` you could get from the connection. + """ totalCount: Int! } -type PlansModule { +type FunctionDeploymentModule { id: UUID! databaseId: UUID! schemaId: UUID! privateSchemaId: UUID! publicSchemaName: String privateSchemaName: String - plansTableId: UUID! - plansTableName: String! - planLimitsTableId: UUID! - planLimitsTableName: String! - planPricingTableId: UUID - planOverridesTableId: UUID - planMeterLimitsTableId: UUID + deploymentsTableId: UUID! + deploymentEventsTableId: UUID! + deploymentsTableName: String! + deploymentEventsTableName: String! + apiName: String + privateApiName: String + scope: String! + prefix: String! + entityTableId: UUID + functionModuleId: UUID + namespaceModuleId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] + + """ + Reads a single `FunctionModule` that is related to this `FunctionDeploymentModule`. + """ + functionModule: FunctionModule + + """ + Reads a single `NamespaceModule` that is related to this `FunctionDeploymentModule`. + """ + namespaceModule: NamespaceModule +} + +"""A `FunctionDeploymentModule` edge in the connection.""" +type FunctionDeploymentModuleEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `FunctionDeploymentModule` at the end of the edge.""" + node: FunctionDeploymentModule +} + +""" +A filter to be used against `FunctionDeploymentModule` object types. All fields are combined with a logical ‘and.’ +""" +input FunctionDeploymentModuleFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `schemaId` field.""" + schemaId: UUIDFilter + + """Filter by the object’s `privateSchemaId` field.""" + privateSchemaId: UUIDFilter + + """Filter by the object’s `publicSchemaName` field.""" + publicSchemaName: StringFilter + + """Filter by the object’s `privateSchemaName` field.""" + privateSchemaName: StringFilter + + """Filter by the object’s `deploymentsTableId` field.""" + deploymentsTableId: UUIDFilter + + """Filter by the object’s `deploymentEventsTableId` field.""" + deploymentEventsTableId: UUIDFilter + + """Filter by the object’s `deploymentsTableName` field.""" + deploymentsTableName: StringFilter + + """Filter by the object’s `deploymentEventsTableName` field.""" + deploymentEventsTableName: StringFilter + + """Filter by the object’s `apiName` field.""" + apiName: StringFilter + + """Filter by the object’s `privateApiName` field.""" + privateApiName: StringFilter + + """Filter by the object’s `scope` field.""" + scope: StringFilter + + """Filter by the object’s `prefix` field.""" + prefix: StringFilter + + """Filter by the object’s `entityTableId` field.""" + entityTableId: UUIDFilter + + """Filter by the object’s `functionModuleId` field.""" + functionModuleId: UUIDFilter + + """Filter by the object’s `namespaceModuleId` field.""" + namespaceModuleId: UUIDFilter + + """Filter by the object’s `policies` field.""" + policies: JSONFilter + + """Filter by the object’s `provisions` field.""" + provisions: JSONFilter + + """Filter by the object’s `defaultPermissions` field.""" + defaultPermissions: StringListFilter + + """Checks for all expressions in this list.""" + and: [FunctionDeploymentModuleFilter!] + + """Checks for any expressions in this list.""" + or: [FunctionDeploymentModuleFilter!] + + """Negates the expression.""" + not: FunctionDeploymentModuleFilter + + """Filter by the object’s `functionModule` relation.""" + functionModule: FunctionModuleFilter + + """A related `functionModule` exists.""" + functionModuleExists: Boolean + + """Filter by the object’s `namespaceModule` relation.""" + namespaceModule: NamespaceModuleFilter + + """A related `namespaceModule` exists.""" + namespaceModuleExists: Boolean +} + +"""Methods to use when ordering `FunctionDeploymentModule`.""" +enum FunctionDeploymentModuleOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + SCHEMA_ID_ASC + SCHEMA_ID_DESC + PRIVATE_SCHEMA_ID_ASC + PRIVATE_SCHEMA_ID_DESC + PUBLIC_SCHEMA_NAME_ASC + PUBLIC_SCHEMA_NAME_DESC + PRIVATE_SCHEMA_NAME_ASC + PRIVATE_SCHEMA_NAME_DESC + DEPLOYMENTS_TABLE_ID_ASC + DEPLOYMENTS_TABLE_ID_DESC + DEPLOYMENT_EVENTS_TABLE_ID_ASC + DEPLOYMENT_EVENTS_TABLE_ID_DESC + DEPLOYMENTS_TABLE_NAME_ASC + DEPLOYMENTS_TABLE_NAME_DESC + DEPLOYMENT_EVENTS_TABLE_NAME_ASC + DEPLOYMENT_EVENTS_TABLE_NAME_DESC + API_NAME_ASC + API_NAME_DESC + PRIVATE_API_NAME_ASC + PRIVATE_API_NAME_DESC + SCOPE_ASC + SCOPE_DESC + PREFIX_ASC + PREFIX_DESC + ENTITY_TABLE_ID_ASC + ENTITY_TABLE_ID_DESC + FUNCTION_MODULE_ID_ASC + FUNCTION_MODULE_ID_DESC + NAMESPACE_MODULE_ID_ASC + NAMESPACE_MODULE_ID_DESC + POLICIES_ASC + POLICIES_DESC + PROVISIONS_ASC + PROVISIONS_DESC + DEFAULT_PERMISSIONS_ASC + DEFAULT_PERMISSIONS_DESC +} + +"""A connection to a list of `PlansModule` values.""" +type PlansModuleConnection { + """A list of `PlansModule` objects.""" + nodes: [PlansModule]! + + """ + A list of edges which contains the `PlansModule` and cursor to aid in pagination. + """ + edges: [PlansModuleEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `PlansModule` you could get from the connection.""" + totalCount: Int! +} + +type PlansModule { + id: UUID! + databaseId: UUID! + schemaId: UUID! + privateSchemaId: UUID! + publicSchemaName: String + privateSchemaName: String + plansTableId: UUID! + plansTableName: String! + planLimitsTableId: UUID! + planLimitsTableName: String! + planPricingTableId: UUID + planOverridesTableId: UUID + planMeterLimitsTableId: UUID planCapsTableId: UUID applyPlanFunction: String! applyPlanAggregateFunction: String! @@ -8463,14 +8711,206 @@ input DbUsageModuleFilter { and: [DbUsageModuleFilter!] """Checks for any expressions in this list.""" - or: [DbUsageModuleFilter!] + or: [DbUsageModuleFilter!] + + """Negates the expression.""" + not: DbUsageModuleFilter +} + +"""Methods to use when ordering `DbUsageModule`.""" +enum DbUsageModuleOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + SCHEMA_ID_ASC + SCHEMA_ID_DESC + PRIVATE_SCHEMA_ID_ASC + PRIVATE_SCHEMA_ID_DESC + PUBLIC_SCHEMA_NAME_ASC + PUBLIC_SCHEMA_NAME_DESC + PRIVATE_SCHEMA_NAME_ASC + PRIVATE_SCHEMA_NAME_DESC + TABLE_STATS_LOG_TABLE_ID_ASC + TABLE_STATS_LOG_TABLE_ID_DESC + TABLE_STATS_LOG_TABLE_NAME_ASC + TABLE_STATS_LOG_TABLE_NAME_DESC + TABLE_STATS_DAILY_TABLE_ID_ASC + TABLE_STATS_DAILY_TABLE_ID_DESC + TABLE_STATS_DAILY_TABLE_NAME_ASC + TABLE_STATS_DAILY_TABLE_NAME_DESC + QUERY_STATS_LOG_TABLE_ID_ASC + QUERY_STATS_LOG_TABLE_ID_DESC + QUERY_STATS_LOG_TABLE_NAME_ASC + QUERY_STATS_LOG_TABLE_NAME_DESC + QUERY_STATS_DAILY_TABLE_ID_ASC + QUERY_STATS_DAILY_TABLE_ID_DESC + QUERY_STATS_DAILY_TABLE_NAME_ASC + QUERY_STATS_DAILY_TABLE_NAME_DESC + INTERVAL_ASC + INTERVAL_DESC + RETENTION_ASC + RETENTION_DESC + PREMAKE_ASC + PREMAKE_DESC + SCOPE_ASC + SCOPE_DESC + PREFIX_ASC + PREFIX_DESC + DEFAULT_PERMISSIONS_ASC + DEFAULT_PERMISSIONS_DESC + API_NAME_ASC + API_NAME_DESC + PRIVATE_API_NAME_ASC + PRIVATE_API_NAME_DESC +} + +"""A connection to a list of `GraphExecutionModule` values.""" +type GraphExecutionModuleConnection { + """A list of `GraphExecutionModule` objects.""" + nodes: [GraphExecutionModule]! + + """ + A list of edges which contains the `GraphExecutionModule` and cursor to aid in pagination. + """ + edges: [GraphExecutionModuleEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `GraphExecutionModule` you could get from the connection. + """ + totalCount: Int! +} + +type GraphExecutionModule { + id: UUID! + databaseId: UUID! + schemaId: UUID! + privateSchemaId: UUID! + publicSchemaName: String + privateSchemaName: String + graphModuleId: UUID! + scope: String! + prefix: String! + executionsTableId: UUID! + outputsTableId: UUID! + nodeStatesTableId: UUID! + executionsTableName: String! + outputsTableName: String! + nodeStatesTableName: String! + apiName: String + privateApiName: String + entityTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] + createdAt: Datetime! + + """ + Reads a single `GraphModule` that is related to this `GraphExecutionModule`. + """ + graphModule: GraphModule +} + +"""A `GraphExecutionModule` edge in the connection.""" +type GraphExecutionModuleEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `GraphExecutionModule` at the end of the edge.""" + node: GraphExecutionModule +} + +""" +A filter to be used against `GraphExecutionModule` object types. All fields are combined with a logical ‘and.’ +""" +input GraphExecutionModuleFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter + + """Filter by the object’s `schemaId` field.""" + schemaId: UUIDFilter + + """Filter by the object’s `privateSchemaId` field.""" + privateSchemaId: UUIDFilter + + """Filter by the object’s `publicSchemaName` field.""" + publicSchemaName: StringFilter + + """Filter by the object’s `privateSchemaName` field.""" + privateSchemaName: StringFilter + + """Filter by the object’s `graphModuleId` field.""" + graphModuleId: UUIDFilter + + """Filter by the object’s `scope` field.""" + scope: StringFilter + + """Filter by the object’s `prefix` field.""" + prefix: StringFilter + + """Filter by the object’s `executionsTableId` field.""" + executionsTableId: UUIDFilter + + """Filter by the object’s `outputsTableId` field.""" + outputsTableId: UUIDFilter + + """Filter by the object’s `nodeStatesTableId` field.""" + nodeStatesTableId: UUIDFilter + + """Filter by the object’s `executionsTableName` field.""" + executionsTableName: StringFilter + + """Filter by the object’s `outputsTableName` field.""" + outputsTableName: StringFilter + + """Filter by the object’s `nodeStatesTableName` field.""" + nodeStatesTableName: StringFilter + + """Filter by the object’s `apiName` field.""" + apiName: StringFilter + + """Filter by the object’s `privateApiName` field.""" + privateApiName: StringFilter + + """Filter by the object’s `entityTableId` field.""" + entityTableId: UUIDFilter + + """Filter by the object’s `policies` field.""" + policies: JSONFilter + + """Filter by the object’s `provisions` field.""" + provisions: JSONFilter + + """Filter by the object’s `defaultPermissions` field.""" + defaultPermissions: StringListFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter + + """Checks for all expressions in this list.""" + and: [GraphExecutionModuleFilter!] + + """Checks for any expressions in this list.""" + or: [GraphExecutionModuleFilter!] """Negates the expression.""" - not: DbUsageModuleFilter + not: GraphExecutionModuleFilter + + """Filter by the object’s `graphModule` relation.""" + graphModule: GraphModuleFilter } -"""Methods to use when ordering `DbUsageModule`.""" -enum DbUsageModuleOrderBy { +"""Methods to use when ordering `GraphExecutionModule`.""" +enum GraphExecutionModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC @@ -8486,38 +8926,38 @@ enum DbUsageModuleOrderBy { PUBLIC_SCHEMA_NAME_DESC PRIVATE_SCHEMA_NAME_ASC PRIVATE_SCHEMA_NAME_DESC - TABLE_STATS_LOG_TABLE_ID_ASC - TABLE_STATS_LOG_TABLE_ID_DESC - TABLE_STATS_LOG_TABLE_NAME_ASC - TABLE_STATS_LOG_TABLE_NAME_DESC - TABLE_STATS_DAILY_TABLE_ID_ASC - TABLE_STATS_DAILY_TABLE_ID_DESC - TABLE_STATS_DAILY_TABLE_NAME_ASC - TABLE_STATS_DAILY_TABLE_NAME_DESC - QUERY_STATS_LOG_TABLE_ID_ASC - QUERY_STATS_LOG_TABLE_ID_DESC - QUERY_STATS_LOG_TABLE_NAME_ASC - QUERY_STATS_LOG_TABLE_NAME_DESC - QUERY_STATS_DAILY_TABLE_ID_ASC - QUERY_STATS_DAILY_TABLE_ID_DESC - QUERY_STATS_DAILY_TABLE_NAME_ASC - QUERY_STATS_DAILY_TABLE_NAME_DESC - INTERVAL_ASC - INTERVAL_DESC - RETENTION_ASC - RETENTION_DESC - PREMAKE_ASC - PREMAKE_DESC + GRAPH_MODULE_ID_ASC + GRAPH_MODULE_ID_DESC SCOPE_ASC SCOPE_DESC PREFIX_ASC PREFIX_DESC - DEFAULT_PERMISSIONS_ASC - DEFAULT_PERMISSIONS_DESC + EXECUTIONS_TABLE_ID_ASC + EXECUTIONS_TABLE_ID_DESC + OUTPUTS_TABLE_ID_ASC + OUTPUTS_TABLE_ID_DESC + NODE_STATES_TABLE_ID_ASC + NODE_STATES_TABLE_ID_DESC + EXECUTIONS_TABLE_NAME_ASC + EXECUTIONS_TABLE_NAME_DESC + OUTPUTS_TABLE_NAME_ASC + OUTPUTS_TABLE_NAME_DESC + NODE_STATES_TABLE_NAME_ASC + NODE_STATES_TABLE_NAME_DESC API_NAME_ASC API_NAME_DESC PRIVATE_API_NAME_ASC PRIVATE_API_NAME_DESC + ENTITY_TABLE_ID_ASC + ENTITY_TABLE_ID_DESC + POLICIES_ASC + POLICIES_DESC + PROVISIONS_ASC + PROVISIONS_DESC + DEFAULT_PERMISSIONS_ASC + DEFAULT_PERMISSIONS_DESC + CREATED_AT_ASC + CREATED_AT_DESC } """A connection to a list of `HierarchyModule` values.""" @@ -12072,6 +12512,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -12083,6 +12535,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -12095,6 +12550,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -12204,6 +12668,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ @@ -12522,6 +13058,14 @@ type Mutation { input: CreateConfigSecretsModuleInput! ): CreateConfigSecretsModulePayload + """Creates a single `GraphModule`.""" + createGraphModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateGraphModuleInput! + ): CreateGraphModulePayload + """Creates a single `RateLimitMetersModule`.""" createRateLimitMetersModule( """ @@ -12570,14 +13114,6 @@ type Mutation { input: CreateInvitesModuleInput! ): CreateInvitesModulePayload - """Creates a single `NamespaceModule`.""" - createNamespaceModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateNamespaceModuleInput! - ): CreateNamespaceModulePayload - """Creates a single `ComputeLogModule`.""" createComputeLogModule( """ @@ -12586,14 +13122,6 @@ type Mutation { input: CreateComputeLogModuleInput! ): CreateComputeLogModulePayload - """Creates a single `GraphModule`.""" - createGraphModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateGraphModuleInput! - ): CreateGraphModulePayload - """Creates a single `InferenceLogModule`.""" createInferenceLogModule( """ @@ -12602,6 +13130,14 @@ type Mutation { input: CreateInferenceLogModuleInput! ): CreateInferenceLogModulePayload + """Creates a single `NamespaceModule`.""" + createNamespaceModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateNamespaceModuleInput! + ): CreateNamespaceModulePayload + """Creates a single `StorageLogModule`.""" createStorageLogModule( """ @@ -12618,6 +13154,14 @@ type Mutation { input: CreateTransferLogModuleInput! ): CreateTransferLogModulePayload + """Creates a single `FunctionDeploymentModule`.""" + createFunctionDeploymentModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateFunctionDeploymentModuleInput! + ): CreateFunctionDeploymentModulePayload + """Creates a single `PlansModule`.""" createPlansModule( """ @@ -12642,6 +13186,14 @@ type Mutation { input: CreateDbUsageModuleInput! ): CreateDbUsageModulePayload + """Creates a single `GraphExecutionModule`.""" + createGraphExecutionModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateGraphExecutionModuleInput! + ): CreateGraphExecutionModulePayload + """Creates a single `HierarchyModule`.""" createHierarchyModule( """ @@ -13004,6 +13556,14 @@ type Mutation { input: UpdateConfigSecretsModuleInput! ): UpdateConfigSecretsModulePayload + """Updates a single `GraphModule` using a unique key and a patch.""" + updateGraphModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateGraphModuleInput! + ): UpdateGraphModulePayload + """ Updates a single `RateLimitMetersModule` using a unique key and a patch. """ @@ -13056,14 +13616,6 @@ type Mutation { input: UpdateInvitesModuleInput! ): UpdateInvitesModulePayload - """Updates a single `NamespaceModule` using a unique key and a patch.""" - updateNamespaceModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateNamespaceModuleInput! - ): UpdateNamespaceModulePayload - """Updates a single `ComputeLogModule` using a unique key and a patch.""" updateComputeLogModule( """ @@ -13072,14 +13624,6 @@ type Mutation { input: UpdateComputeLogModuleInput! ): UpdateComputeLogModulePayload - """Updates a single `GraphModule` using a unique key and a patch.""" - updateGraphModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateGraphModuleInput! - ): UpdateGraphModulePayload - """Updates a single `InferenceLogModule` using a unique key and a patch.""" updateInferenceLogModule( """ @@ -13088,6 +13632,14 @@ type Mutation { input: UpdateInferenceLogModuleInput! ): UpdateInferenceLogModulePayload + """Updates a single `NamespaceModule` using a unique key and a patch.""" + updateNamespaceModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateNamespaceModuleInput! + ): UpdateNamespaceModulePayload + """Updates a single `StorageLogModule` using a unique key and a patch.""" updateStorageLogModule( """ @@ -13104,6 +13656,16 @@ type Mutation { input: UpdateTransferLogModuleInput! ): UpdateTransferLogModulePayload + """ + Updates a single `FunctionDeploymentModule` using a unique key and a patch. + """ + updateFunctionDeploymentModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateFunctionDeploymentModuleInput! + ): UpdateFunctionDeploymentModulePayload + """Updates a single `PlansModule` using a unique key and a patch.""" updatePlansModule( """ @@ -13130,6 +13692,16 @@ type Mutation { input: UpdateDbUsageModuleInput! ): UpdateDbUsageModulePayload + """ + Updates a single `GraphExecutionModule` using a unique key and a patch. + """ + updateGraphExecutionModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateGraphExecutionModuleInput! + ): UpdateGraphExecutionModulePayload + """Updates a single `HierarchyModule` using a unique key and a patch.""" updateHierarchyModule( """ @@ -13466,6 +14038,14 @@ type Mutation { input: DeleteConfigSecretsModuleInput! ): DeleteConfigSecretsModulePayload + """Deletes a single `GraphModule` using a unique key.""" + deleteGraphModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteGraphModuleInput! + ): DeleteGraphModulePayload + """Deletes a single `RateLimitMetersModule` using a unique key.""" deleteRateLimitMetersModule( """ @@ -13514,14 +14094,6 @@ type Mutation { input: DeleteInvitesModuleInput! ): DeleteInvitesModulePayload - """Deletes a single `NamespaceModule` using a unique key.""" - deleteNamespaceModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteNamespaceModuleInput! - ): DeleteNamespaceModulePayload - """Deletes a single `ComputeLogModule` using a unique key.""" deleteComputeLogModule( """ @@ -13530,14 +14102,6 @@ type Mutation { input: DeleteComputeLogModuleInput! ): DeleteComputeLogModulePayload - """Deletes a single `GraphModule` using a unique key.""" - deleteGraphModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteGraphModuleInput! - ): DeleteGraphModulePayload - """Deletes a single `InferenceLogModule` using a unique key.""" deleteInferenceLogModule( """ @@ -13546,6 +14110,14 @@ type Mutation { input: DeleteInferenceLogModuleInput! ): DeleteInferenceLogModulePayload + """Deletes a single `NamespaceModule` using a unique key.""" + deleteNamespaceModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteNamespaceModuleInput! + ): DeleteNamespaceModulePayload + """Deletes a single `StorageLogModule` using a unique key.""" deleteStorageLogModule( """ @@ -13562,6 +14134,14 @@ type Mutation { input: DeleteTransferLogModuleInput! ): DeleteTransferLogModulePayload + """Deletes a single `FunctionDeploymentModule` using a unique key.""" + deleteFunctionDeploymentModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteFunctionDeploymentModuleInput! + ): DeleteFunctionDeploymentModulePayload + """Deletes a single `PlansModule` using a unique key.""" deletePlansModule( """ @@ -13586,6 +14166,14 @@ type Mutation { input: DeleteDbUsageModuleInput! ): DeleteDbUsageModulePayload + """Deletes a single `GraphExecutionModule` using a unique key.""" + deleteGraphExecutionModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteGraphExecutionModuleInput! + ): DeleteGraphExecutionModulePayload + """Deletes a single `HierarchyModule` using a unique key.""" deleteHierarchyModule( """ @@ -15496,7 +16084,63 @@ input ConfigSecretsModuleInput { entityTableId: UUID policies: JSON provisions: JSON - hasConfig: Boolean + hasConfig: Boolean +} + +"""The output of our create `GraphModule` mutation.""" +type CreateGraphModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `GraphModule` that was created by this mutation.""" + graphModule: GraphModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `GraphModule`. May be used by Relay 1.""" + graphModuleEdge( + """The method to use when ordering `GraphModule`.""" + orderBy: [GraphModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): GraphModuleEdge +} + +"""All input for the create `GraphModule` mutation.""" +input CreateGraphModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `GraphModule` to be created by this mutation.""" + graphModule: GraphModuleInput! +} + +"""An input for mutations affecting `GraphModule`""" +input GraphModuleInput { + id: UUID + databaseId: UUID! + publicSchemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + scope: String + prefix: String + merkleStoreModuleId: UUID! + graphsTableId: UUID + apiName: String + privateApiName: String + entityTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] + createdAt: Datetime } """The output of our create `RateLimitMetersModule` mutation.""" @@ -15834,63 +16478,6 @@ input InvitesModuleInput { privateApiName: String } -"""The output of our create `NamespaceModule` mutation.""" -type CreateNamespaceModulePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `NamespaceModule` that was created by this mutation.""" - namespaceModule: NamespaceModule - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `NamespaceModule`. May be used by Relay 1.""" - namespaceModuleEdge( - """The method to use when ordering `NamespaceModule`.""" - orderBy: [NamespaceModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): NamespaceModuleEdge -} - -"""All input for the create `NamespaceModule` mutation.""" -input CreateNamespaceModuleInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """The `NamespaceModule` to be created by this mutation.""" - namespaceModule: NamespaceModuleInput! -} - -"""An input for mutations affecting `NamespaceModule`""" -input NamespaceModuleInput { - id: UUID - databaseId: UUID! - schemaId: UUID - privateSchemaId: UUID - publicSchemaName: String - privateSchemaName: String - namespacesTableId: UUID - namespaceEventsTableId: UUID - namespacesTableName: String - namespaceEventsTableName: String - apiName: String - privateApiName: String - scope: String - prefix: String - entityTableId: UUID - policies: JSON - provisions: JSON - defaultPermissions: [String] -} - """The output of our create `ComputeLogModule` mutation.""" type CreateComputeLogModulePayload { """ @@ -15949,120 +16536,120 @@ input ComputeLogModuleInput { privateApiName: String } -"""The output of our create `GraphModule` mutation.""" -type CreateGraphModulePayload { +"""The output of our create `InferenceLogModule` mutation.""" +type CreateInferenceLogModulePayload { """ The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The `GraphModule` that was created by this mutation.""" - graphModule: GraphModule + """The `InferenceLogModule` that was created by this mutation.""" + inferenceLogModule: InferenceLogModule """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our `GraphModule`. May be used by Relay 1.""" - graphModuleEdge( - """The method to use when ordering `GraphModule`.""" - orderBy: [GraphModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): GraphModuleEdge + """An edge for our `InferenceLogModule`. May be used by Relay 1.""" + inferenceLogModuleEdge( + """The method to use when ordering `InferenceLogModule`.""" + orderBy: [InferenceLogModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): InferenceLogModuleEdge } -"""All input for the create `GraphModule` mutation.""" -input CreateGraphModuleInput { +"""All input for the create `InferenceLogModule` mutation.""" +input CreateInferenceLogModuleInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. """ clientMutationId: String - """The `GraphModule` to be created by this mutation.""" - graphModule: GraphModuleInput! + """The `InferenceLogModule` to be created by this mutation.""" + inferenceLogModule: InferenceLogModuleInput! } -"""An input for mutations affecting `GraphModule`""" -input GraphModuleInput { +"""An input for mutations affecting `InferenceLogModule`""" +input InferenceLogModuleInput { id: UUID databaseId: UUID! - publicSchemaId: UUID + schemaId: UUID privateSchemaId: UUID publicSchemaName: String privateSchemaName: String + inferenceLogTableId: UUID + inferenceLogTableName: String + usageDailyTableId: UUID + usageDailyTableName: String + interval: String + retention: String + premake: Int scope: String + actorFkTableId: UUID + entityFkTableId: UUID prefix: String - merkleStoreModuleId: UUID! - graphsTableId: UUID - executionsTableId: UUID - outputsTableId: UUID apiName: String privateApiName: String - entityTableId: UUID - policies: JSON - provisions: JSON - defaultPermissions: [String] - createdAt: Datetime } -"""The output of our create `InferenceLogModule` mutation.""" -type CreateInferenceLogModulePayload { +"""The output of our create `NamespaceModule` mutation.""" +type CreateNamespaceModulePayload { """ The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The `InferenceLogModule` that was created by this mutation.""" - inferenceLogModule: InferenceLogModule + """The `NamespaceModule` that was created by this mutation.""" + namespaceModule: NamespaceModule """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our `InferenceLogModule`. May be used by Relay 1.""" - inferenceLogModuleEdge( - """The method to use when ordering `InferenceLogModule`.""" - orderBy: [InferenceLogModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): InferenceLogModuleEdge + """An edge for our `NamespaceModule`. May be used by Relay 1.""" + namespaceModuleEdge( + """The method to use when ordering `NamespaceModule`.""" + orderBy: [NamespaceModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): NamespaceModuleEdge } -"""All input for the create `InferenceLogModule` mutation.""" -input CreateInferenceLogModuleInput { +"""All input for the create `NamespaceModule` mutation.""" +input CreateNamespaceModuleInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. """ clientMutationId: String - """The `InferenceLogModule` to be created by this mutation.""" - inferenceLogModule: InferenceLogModuleInput! + """The `NamespaceModule` to be created by this mutation.""" + namespaceModule: NamespaceModuleInput! } -"""An input for mutations affecting `InferenceLogModule`""" -input InferenceLogModuleInput { +"""An input for mutations affecting `NamespaceModule`""" +input NamespaceModuleInput { id: UUID databaseId: UUID! schemaId: UUID privateSchemaId: UUID publicSchemaName: String privateSchemaName: String - inferenceLogTableId: UUID - inferenceLogTableName: String - usageDailyTableId: UUID - usageDailyTableName: String - interval: String - retention: String - premake: Int - scope: String - actorFkTableId: UUID - entityFkTableId: UUID - prefix: String + namespacesTableId: UUID + namespaceEventsTableId: UUID + namespacesTableName: String + namespaceEventsTableName: String apiName: String privateApiName: String + scope: String + prefix: String + entityTableId: UUID + platformNamespacesTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] } """The output of our create `StorageLogModule` mutation.""" @@ -16181,6 +16768,65 @@ input TransferLogModuleInput { privateApiName: String } +"""The output of our create `FunctionDeploymentModule` mutation.""" +type CreateFunctionDeploymentModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeploymentModule` that was created by this mutation.""" + functionDeploymentModule: FunctionDeploymentModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeploymentModule`. May be used by Relay 1.""" + functionDeploymentModuleEdge( + """The method to use when ordering `FunctionDeploymentModule`.""" + orderBy: [FunctionDeploymentModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentModuleEdge +} + +"""All input for the create `FunctionDeploymentModule` mutation.""" +input CreateFunctionDeploymentModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `FunctionDeploymentModule` to be created by this mutation.""" + functionDeploymentModule: FunctionDeploymentModuleInput! +} + +"""An input for mutations affecting `FunctionDeploymentModule`""" +input FunctionDeploymentModuleInput { + id: UUID + databaseId: UUID! + schemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + deploymentsTableId: UUID + deploymentEventsTableId: UUID + deploymentsTableName: String + deploymentEventsTableName: String + apiName: String + privateApiName: String + scope: String + prefix: String + entityTableId: UUID + functionModuleId: UUID + namespaceModuleId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] +} + """The output of our create `PlansModule` mutation.""" type CreatePlansModulePayload { """ @@ -16302,65 +16948,126 @@ input BillingProviderModuleInput { privateApiName: String } -"""The output of our create `DbUsageModule` mutation.""" -type CreateDbUsageModulePayload { +"""The output of our create `DbUsageModule` mutation.""" +type CreateDbUsageModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `DbUsageModule` that was created by this mutation.""" + dbUsageModule: DbUsageModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `DbUsageModule`. May be used by Relay 1.""" + dbUsageModuleEdge( + """The method to use when ordering `DbUsageModule`.""" + orderBy: [DbUsageModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): DbUsageModuleEdge +} + +"""All input for the create `DbUsageModule` mutation.""" +input CreateDbUsageModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + + """The `DbUsageModule` to be created by this mutation.""" + dbUsageModule: DbUsageModuleInput! +} + +"""An input for mutations affecting `DbUsageModule`""" +input DbUsageModuleInput { + id: UUID + databaseId: UUID! + schemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + tableStatsLogTableId: UUID + tableStatsLogTableName: String + tableStatsDailyTableId: UUID + tableStatsDailyTableName: String + queryStatsLogTableId: UUID + queryStatsLogTableName: String + queryStatsDailyTableId: UUID + queryStatsDailyTableName: String + interval: String + retention: String + premake: Int + scope: String + prefix: String + defaultPermissions: [String] + apiName: String + privateApiName: String +} + +"""The output of our create `GraphExecutionModule` mutation.""" +type CreateGraphExecutionModulePayload { """ The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The `DbUsageModule` that was created by this mutation.""" - dbUsageModule: DbUsageModule + """The `GraphExecutionModule` that was created by this mutation.""" + graphExecutionModule: GraphExecutionModule """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our `DbUsageModule`. May be used by Relay 1.""" - dbUsageModuleEdge( - """The method to use when ordering `DbUsageModule`.""" - orderBy: [DbUsageModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): DbUsageModuleEdge + """An edge for our `GraphExecutionModule`. May be used by Relay 1.""" + graphExecutionModuleEdge( + """The method to use when ordering `GraphExecutionModule`.""" + orderBy: [GraphExecutionModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): GraphExecutionModuleEdge } -"""All input for the create `DbUsageModule` mutation.""" -input CreateDbUsageModuleInput { +"""All input for the create `GraphExecutionModule` mutation.""" +input CreateGraphExecutionModuleInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. """ clientMutationId: String - """The `DbUsageModule` to be created by this mutation.""" - dbUsageModule: DbUsageModuleInput! + """The `GraphExecutionModule` to be created by this mutation.""" + graphExecutionModule: GraphExecutionModuleInput! } -"""An input for mutations affecting `DbUsageModule`""" -input DbUsageModuleInput { +"""An input for mutations affecting `GraphExecutionModule`""" +input GraphExecutionModuleInput { id: UUID databaseId: UUID! schemaId: UUID privateSchemaId: UUID publicSchemaName: String privateSchemaName: String - tableStatsLogTableId: UUID - tableStatsLogTableName: String - tableStatsDailyTableId: UUID - tableStatsDailyTableName: String - queryStatsLogTableId: UUID - queryStatsLogTableName: String - queryStatsDailyTableId: UUID - queryStatsDailyTableName: String - interval: String - retention: String - premake: Int + graphModuleId: UUID! scope: String prefix: String - defaultPermissions: [String] + executionsTableId: UUID + outputsTableId: UUID + nodeStatesTableId: UUID + executionsTableName: String + outputsTableName: String + nodeStatesTableName: String apiName: String privateApiName: String + entityTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] + createdAt: Datetime } """The output of our create `HierarchyModule` mutation.""" @@ -19435,6 +20142,67 @@ input ConfigSecretsModulePatch { hasConfig: Boolean } +"""The output of our update `GraphModule` mutation.""" +type UpdateGraphModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `GraphModule` that was updated by this mutation.""" + graphModule: GraphModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `GraphModule`. May be used by Relay 1.""" + graphModuleEdge( + """The method to use when ordering `GraphModule`.""" + orderBy: [GraphModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): GraphModuleEdge +} + +"""All input for the `updateGraphModule` mutation.""" +input UpdateGraphModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `GraphModule` being updated. + """ + graphModulePatch: GraphModulePatch! +} + +""" +Represents an update to a `GraphModule`. Fields that are set will be updated. +""" +input GraphModulePatch { + id: UUID + databaseId: UUID + publicSchemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + scope: String + prefix: String + merkleStoreModuleId: UUID + graphsTableId: UUID + apiName: String + privateApiName: String + entityTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] + createdAt: Datetime +} + """The output of our update `RateLimitMetersModule` mutation.""" type UpdateRateLimitMetersModulePayload { """ @@ -19800,68 +20568,6 @@ input InvitesModulePatch { privateApiName: String } -"""The output of our update `NamespaceModule` mutation.""" -type UpdateNamespaceModulePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `NamespaceModule` that was updated by this mutation.""" - namespaceModule: NamespaceModule - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `NamespaceModule`. May be used by Relay 1.""" - namespaceModuleEdge( - """The method to use when ordering `NamespaceModule`.""" - orderBy: [NamespaceModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): NamespaceModuleEdge -} - -"""All input for the `updateNamespaceModule` mutation.""" -input UpdateNamespaceModuleInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! - - """ - An object where the defined keys will be set on the `NamespaceModule` being updated. - """ - namespaceModulePatch: NamespaceModulePatch! -} - -""" -Represents an update to a `NamespaceModule`. Fields that are set will be updated. -""" -input NamespaceModulePatch { - id: UUID - databaseId: UUID - schemaId: UUID - privateSchemaId: UUID - publicSchemaName: String - privateSchemaName: String - namespacesTableId: UUID - namespaceEventsTableId: UUID - namespacesTableName: String - namespaceEventsTableName: String - apiName: String - privateApiName: String - scope: String - prefix: String - entityTableId: UUID - policies: JSON - provisions: JSON - defaultPermissions: [String] -} - """The output of our update `ComputeLogModule` mutation.""" type UpdateComputeLogModulePayload { """ @@ -19925,31 +20631,31 @@ input ComputeLogModulePatch { privateApiName: String } -"""The output of our update `GraphModule` mutation.""" -type UpdateGraphModulePayload { +"""The output of our update `InferenceLogModule` mutation.""" +type UpdateInferenceLogModulePayload { """ The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The `GraphModule` that was updated by this mutation.""" - graphModule: GraphModule + """The `InferenceLogModule` that was updated by this mutation.""" + inferenceLogModule: InferenceLogModule """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our `GraphModule`. May be used by Relay 1.""" - graphModuleEdge( - """The method to use when ordering `GraphModule`.""" - orderBy: [GraphModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): GraphModuleEdge + """An edge for our `InferenceLogModule`. May be used by Relay 1.""" + inferenceLogModuleEdge( + """The method to use when ordering `InferenceLogModule`.""" + orderBy: [InferenceLogModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): InferenceLogModuleEdge } -"""All input for the `updateGraphModule` mutation.""" -input UpdateGraphModuleInput { +"""All input for the `updateInferenceLogModule` mutation.""" +input UpdateInferenceLogModuleInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -19958,61 +20664,61 @@ input UpdateGraphModuleInput { id: UUID! """ - An object where the defined keys will be set on the `GraphModule` being updated. + An object where the defined keys will be set on the `InferenceLogModule` being updated. """ - graphModulePatch: GraphModulePatch! + inferenceLogModulePatch: InferenceLogModulePatch! } """ -Represents an update to a `GraphModule`. Fields that are set will be updated. +Represents an update to a `InferenceLogModule`. Fields that are set will be updated. """ -input GraphModulePatch { +input InferenceLogModulePatch { id: UUID databaseId: UUID - publicSchemaId: UUID + schemaId: UUID privateSchemaId: UUID publicSchemaName: String privateSchemaName: String + inferenceLogTableId: UUID + inferenceLogTableName: String + usageDailyTableId: UUID + usageDailyTableName: String + interval: String + retention: String + premake: Int scope: String + actorFkTableId: UUID + entityFkTableId: UUID prefix: String - merkleStoreModuleId: UUID - graphsTableId: UUID - executionsTableId: UUID - outputsTableId: UUID apiName: String privateApiName: String - entityTableId: UUID - policies: JSON - provisions: JSON - defaultPermissions: [String] - createdAt: Datetime } -"""The output of our update `InferenceLogModule` mutation.""" -type UpdateInferenceLogModulePayload { +"""The output of our update `NamespaceModule` mutation.""" +type UpdateNamespaceModulePayload { """ The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The `InferenceLogModule` that was updated by this mutation.""" - inferenceLogModule: InferenceLogModule + """The `NamespaceModule` that was updated by this mutation.""" + namespaceModule: NamespaceModule """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our `InferenceLogModule`. May be used by Relay 1.""" - inferenceLogModuleEdge( - """The method to use when ordering `InferenceLogModule`.""" - orderBy: [InferenceLogModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): InferenceLogModuleEdge + """An edge for our `NamespaceModule`. May be used by Relay 1.""" + namespaceModuleEdge( + """The method to use when ordering `NamespaceModule`.""" + orderBy: [NamespaceModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): NamespaceModuleEdge } -"""All input for the `updateInferenceLogModule` mutation.""" -input UpdateInferenceLogModuleInput { +"""All input for the `updateNamespaceModule` mutation.""" +input UpdateNamespaceModuleInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -20021,34 +20727,34 @@ input UpdateInferenceLogModuleInput { id: UUID! """ - An object where the defined keys will be set on the `InferenceLogModule` being updated. + An object where the defined keys will be set on the `NamespaceModule` being updated. """ - inferenceLogModulePatch: InferenceLogModulePatch! + namespaceModulePatch: NamespaceModulePatch! } """ -Represents an update to a `InferenceLogModule`. Fields that are set will be updated. +Represents an update to a `NamespaceModule`. Fields that are set will be updated. """ -input InferenceLogModulePatch { +input NamespaceModulePatch { id: UUID databaseId: UUID schemaId: UUID - privateSchemaId: UUID - publicSchemaName: String - privateSchemaName: String - inferenceLogTableId: UUID - inferenceLogTableName: String - usageDailyTableId: UUID - usageDailyTableName: String - interval: String - retention: String - premake: Int - scope: String - actorFkTableId: UUID - entityFkTableId: UUID - prefix: String + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + namespacesTableId: UUID + namespaceEventsTableId: UUID + namespacesTableName: String + namespaceEventsTableName: String apiName: String privateApiName: String + scope: String + prefix: String + entityTableId: UUID + platformNamespacesTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] } """The output of our update `StorageLogModule` mutation.""" @@ -20177,6 +20883,70 @@ input TransferLogModulePatch { privateApiName: String } +"""The output of our update `FunctionDeploymentModule` mutation.""" +type UpdateFunctionDeploymentModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeploymentModule` that was updated by this mutation.""" + functionDeploymentModule: FunctionDeploymentModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeploymentModule`. May be used by Relay 1.""" + functionDeploymentModuleEdge( + """The method to use when ordering `FunctionDeploymentModule`.""" + orderBy: [FunctionDeploymentModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentModuleEdge +} + +"""All input for the `updateFunctionDeploymentModule` mutation.""" +input UpdateFunctionDeploymentModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `FunctionDeploymentModule` being updated. + """ + functionDeploymentModulePatch: FunctionDeploymentModulePatch! +} + +""" +Represents an update to a `FunctionDeploymentModule`. Fields that are set will be updated. +""" +input FunctionDeploymentModulePatch { + id: UUID + databaseId: UUID + schemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + deploymentsTableId: UUID + deploymentEventsTableId: UUID + deploymentsTableName: String + deploymentEventsTableName: String + apiName: String + privateApiName: String + scope: String + prefix: String + entityTableId: UUID + functionModuleId: UUID + namespaceModuleId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] +} + """The output of our update `PlansModule` mutation.""" type UpdatePlansModulePayload { """ @@ -20374,6 +21144,72 @@ input DbUsageModulePatch { privateApiName: String } +"""The output of our update `GraphExecutionModule` mutation.""" +type UpdateGraphExecutionModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `GraphExecutionModule` that was updated by this mutation.""" + graphExecutionModule: GraphExecutionModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `GraphExecutionModule`. May be used by Relay 1.""" + graphExecutionModuleEdge( + """The method to use when ordering `GraphExecutionModule`.""" + orderBy: [GraphExecutionModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): GraphExecutionModuleEdge +} + +"""All input for the `updateGraphExecutionModule` mutation.""" +input UpdateGraphExecutionModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! + + """ + An object where the defined keys will be set on the `GraphExecutionModule` being updated. + """ + graphExecutionModulePatch: GraphExecutionModulePatch! +} + +""" +Represents an update to a `GraphExecutionModule`. Fields that are set will be updated. +""" +input GraphExecutionModulePatch { + id: UUID + databaseId: UUID + schemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + graphModuleId: UUID + scope: String + prefix: String + executionsTableId: UUID + outputsTableId: UUID + nodeStatesTableId: UUID + executionsTableName: String + outputsTableName: String + nodeStatesTableName: String + apiName: String + privateApiName: String + entityTableId: UUID + policies: JSON + provisions: JSON + defaultPermissions: [String] + createdAt: Datetime +} + """The output of our update `HierarchyModule` mutation.""" type UpdateHierarchyModulePayload { """ @@ -22804,6 +23640,39 @@ input DeleteConfigSecretsModuleInput { id: UUID! } +"""The output of our delete `GraphModule` mutation.""" +type DeleteGraphModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `GraphModule` that was deleted by this mutation.""" + graphModule: GraphModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `GraphModule`. May be used by Relay 1.""" + graphModuleEdge( + """The method to use when ordering `GraphModule`.""" + orderBy: [GraphModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): GraphModuleEdge +} + +"""All input for the `deleteGraphModule` mutation.""" +input DeleteGraphModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + """The output of our delete `RateLimitMetersModule` mutation.""" type DeleteRateLimitMetersModulePayload { """ @@ -23002,39 +23871,6 @@ input DeleteInvitesModuleInput { id: UUID! } -"""The output of our delete `NamespaceModule` mutation.""" -type DeleteNamespaceModulePayload { - """ - The exact same `clientMutationId` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The `NamespaceModule` that was deleted by this mutation.""" - namespaceModule: NamespaceModule - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `NamespaceModule`. May be used by Relay 1.""" - namespaceModuleEdge( - """The method to use when ordering `NamespaceModule`.""" - orderBy: [NamespaceModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): NamespaceModuleEdge -} - -"""All input for the `deleteNamespaceModule` mutation.""" -input DeleteNamespaceModuleInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! -} - """The output of our delete `ComputeLogModule` mutation.""" type DeleteComputeLogModulePayload { """ @@ -23068,31 +23904,31 @@ input DeleteComputeLogModuleInput { id: UUID! } -"""The output of our delete `GraphModule` mutation.""" -type DeleteGraphModulePayload { +"""The output of our delete `InferenceLogModule` mutation.""" +type DeleteInferenceLogModulePayload { """ The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The `GraphModule` that was deleted by this mutation.""" - graphModule: GraphModule + """The `InferenceLogModule` that was deleted by this mutation.""" + inferenceLogModule: InferenceLogModule """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our `GraphModule`. May be used by Relay 1.""" - graphModuleEdge( - """The method to use when ordering `GraphModule`.""" - orderBy: [GraphModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): GraphModuleEdge + """An edge for our `InferenceLogModule`. May be used by Relay 1.""" + inferenceLogModuleEdge( + """The method to use when ordering `InferenceLogModule`.""" + orderBy: [InferenceLogModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): InferenceLogModuleEdge } -"""All input for the `deleteGraphModule` mutation.""" -input DeleteGraphModuleInput { +"""All input for the `deleteInferenceLogModule` mutation.""" +input DeleteInferenceLogModuleInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -23101,31 +23937,31 @@ input DeleteGraphModuleInput { id: UUID! } -"""The output of our delete `InferenceLogModule` mutation.""" -type DeleteInferenceLogModulePayload { +"""The output of our delete `NamespaceModule` mutation.""" +type DeleteNamespaceModulePayload { """ The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The `InferenceLogModule` that was deleted by this mutation.""" - inferenceLogModule: InferenceLogModule + """The `NamespaceModule` that was deleted by this mutation.""" + namespaceModule: NamespaceModule """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our `InferenceLogModule`. May be used by Relay 1.""" - inferenceLogModuleEdge( - """The method to use when ordering `InferenceLogModule`.""" - orderBy: [InferenceLogModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): InferenceLogModuleEdge + """An edge for our `NamespaceModule`. May be used by Relay 1.""" + namespaceModuleEdge( + """The method to use when ordering `NamespaceModule`.""" + orderBy: [NamespaceModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): NamespaceModuleEdge } -"""All input for the `deleteInferenceLogModule` mutation.""" -input DeleteInferenceLogModuleInput { +"""All input for the `deleteNamespaceModule` mutation.""" +input DeleteNamespaceModuleInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -23200,6 +24036,39 @@ input DeleteTransferLogModuleInput { id: UUID! } +"""The output of our delete `FunctionDeploymentModule` mutation.""" +type DeleteFunctionDeploymentModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `FunctionDeploymentModule` that was deleted by this mutation.""" + functionDeploymentModule: FunctionDeploymentModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `FunctionDeploymentModule`. May be used by Relay 1.""" + functionDeploymentModuleEdge( + """The method to use when ordering `FunctionDeploymentModule`.""" + orderBy: [FunctionDeploymentModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): FunctionDeploymentModuleEdge +} + +"""All input for the `deleteFunctionDeploymentModule` mutation.""" +input DeleteFunctionDeploymentModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + """The output of our delete `PlansModule` mutation.""" type DeletePlansModulePayload { """ @@ -23299,6 +24168,39 @@ input DeleteDbUsageModuleInput { id: UUID! } +"""The output of our delete `GraphExecutionModule` mutation.""" +type DeleteGraphExecutionModulePayload { + """ + The exact same `clientMutationId` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The `GraphExecutionModule` that was deleted by this mutation.""" + graphExecutionModule: GraphExecutionModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `GraphExecutionModule`. May be used by Relay 1.""" + graphExecutionModuleEdge( + """The method to use when ordering `GraphExecutionModule`.""" + orderBy: [GraphExecutionModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): GraphExecutionModuleEdge +} + +"""All input for the `deleteGraphExecutionModule` mutation.""" +input DeleteGraphExecutionModuleInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} + """The output of our delete `HierarchyModule` mutation.""" type DeleteHierarchyModulePayload { """ diff --git a/sdk/constructive-sdk/schemas/objects.graphql b/sdk/constructive-sdk/schemas/objects.graphql index ed4376c1d6..f9d9cb3f43 100644 --- a/sdk/constructive-sdk/schemas/objects.graphql +++ b/sdk/constructive-sdk/schemas/objects.graphql @@ -1030,6 +1030,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -1041,6 +1053,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -1053,6 +1068,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -1162,6 +1186,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ diff --git a/sdk/constructive-sdk/schemas/usage.graphql b/sdk/constructive-sdk/schemas/usage.graphql index db5f410fb1..b939825833 100644 --- a/sdk/constructive-sdk/schemas/usage.graphql +++ b/sdk/constructive-sdk/schemas/usage.graphql @@ -3316,6 +3316,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -3327,6 +3339,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -3339,6 +3354,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -3448,6 +3472,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ diff --git a/sdk/constructive-sdk/src/.targets b/sdk/constructive-sdk/src/.targets index bf4de0b16a..42542d6c87 100644 --- a/sdk/constructive-sdk/src/.targets +++ b/sdk/constructive-sdk/src/.targets @@ -1 +1 @@ -["admin","agent","api","auth","modules","objects","usage"] +["admin","agent","api","auth","compute","config","modules","objects","usage"] diff --git a/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts index fd80edc234..cc7a22623e 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appAdminGrant.ts @@ -196,7 +196,8 @@ export class AppAdminGrantModel { 'UpdateAppAdminGrantInput', 'id', 'appAdminGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts index c9e66ec9c8..598f1b15af 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appClaimedInvite.ts @@ -196,7 +196,8 @@ export class AppClaimedInviteModel { 'UpdateAppClaimedInviteInput', 'id', 'appClaimedInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts index 4481fb3d83..d773ff6de1 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appGrant.ts @@ -196,7 +196,8 @@ export class AppGrantModel { 'UpdateAppGrantInput', 'id', 'appGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts index 5fcbff9369..3350bba65b 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appInvite.ts @@ -196,7 +196,8 @@ export class AppInviteModel { 'UpdateAppInviteInput', 'id', 'appInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts b/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts index a4011c41ab..1faa691016 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appMembership.ts @@ -196,7 +196,8 @@ export class AppMembershipModel { 'UpdateAppMembershipInput', 'id', 'appMembershipPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts index f69f1aca69..efc0ab28ee 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appMembershipDefault.ts @@ -198,7 +198,8 @@ export class AppMembershipDefaultModel { 'UpdateAppMembershipDefaultInput', 'id', 'appMembershipDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts index eeb815d842..28f7d92d12 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appOwnerGrant.ts @@ -196,7 +196,8 @@ export class AppOwnerGrantModel { 'UpdateAppOwnerGrantInput', 'id', 'appOwnerGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts index e71adea658..efa4812398 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermission.ts @@ -196,7 +196,8 @@ export class AppPermissionModel { 'UpdateAppPermissionInput', 'id', 'appPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts index d5511aed01..c967364f31 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefault.ts @@ -198,7 +198,8 @@ export class AppPermissionDefaultModel { 'UpdateAppPermissionDefaultInput', 'id', 'appPermissionDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts index 6915611884..b6a3b10748 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultGrant.ts @@ -198,7 +198,8 @@ export class AppPermissionDefaultGrantModel { 'UpdateAppPermissionDefaultGrantInput', 'id', 'appPermissionDefaultGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts index eeee28fadd..6e47d9eeec 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/appPermissionDefaultPermission.ts @@ -221,7 +221,8 @@ export class AppPermissionDefaultPermissionModel { 'UpdateAppPermissionDefaultPermissionInput', 'id', 'appPermissionDefaultPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts b/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts index ee7ed596c0..1ab7c15781 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/membershipType.ts @@ -196,7 +196,8 @@ export class MembershipTypeModel { 'UpdateMembershipTypeInput', 'id', 'membershipTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts index 7b13377316..9ef902aaa8 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgAdminGrant.ts @@ -196,7 +196,8 @@ export class OrgAdminGrantModel { 'UpdateOrgAdminGrantInput', 'id', 'orgAdminGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgChartEdge.ts b/sdk/constructive-sdk/src/admin/orm/models/orgChartEdge.ts index 8a43b83a98..80c81b0e08 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgChartEdge.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgChartEdge.ts @@ -196,7 +196,8 @@ export class OrgChartEdgeModel { 'UpdateOrgChartEdgeInput', 'id', 'orgChartEdgePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgChartEdgeGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgChartEdgeGrant.ts index 168a6fe3db..c9df058dfd 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgChartEdgeGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgChartEdgeGrant.ts @@ -196,7 +196,8 @@ export class OrgChartEdgeGrantModel { 'UpdateOrgChartEdgeGrantInput', 'id', 'orgChartEdgeGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts index e1a3aecafb..82b31bb474 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgClaimedInvite.ts @@ -196,7 +196,8 @@ export class OrgClaimedInviteModel { 'UpdateOrgClaimedInviteInput', 'id', 'orgClaimedInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts index c8e74f5cc6..467c6b11b9 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgGrant.ts @@ -196,7 +196,8 @@ export class OrgGrantModel { 'UpdateOrgGrantInput', 'id', 'orgGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts b/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts index 8d7931f078..50cc5eb9e6 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgInvite.ts @@ -196,7 +196,8 @@ export class OrgInviteModel { 'UpdateOrgInviteInput', 'id', 'orgInvitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts index 44f5608f45..bf7ac25fe9 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMember.ts @@ -196,7 +196,8 @@ export class OrgMemberModel { 'UpdateOrgMemberInput', 'id', 'orgMemberPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts index 77357e1745..9cecf8839b 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMemberProfile.ts @@ -196,7 +196,8 @@ export class OrgMemberProfileModel { 'UpdateOrgMemberProfileInput', 'id', 'orgMemberProfilePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts index 623ec08fe2..06ee032ca8 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMembership.ts @@ -196,7 +196,8 @@ export class OrgMembershipModel { 'UpdateOrgMembershipInput', 'id', 'orgMembershipPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts index 3441315057..525619dfca 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipDefault.ts @@ -198,7 +198,8 @@ export class OrgMembershipDefaultModel { 'UpdateOrgMembershipDefaultInput', 'id', 'orgMembershipDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts index 46801fc913..de551183d2 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgMembershipSetting.ts @@ -198,7 +198,8 @@ export class OrgMembershipSettingModel { 'UpdateOrgMembershipSettingInput', 'id', 'orgMembershipSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts index 9614dce8fc..d99550bd73 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgOwnerGrant.ts @@ -196,7 +196,8 @@ export class OrgOwnerGrantModel { 'UpdateOrgOwnerGrantInput', 'id', 'orgOwnerGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts index 7bdc906323..e3aded7147 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermission.ts @@ -196,7 +196,8 @@ export class OrgPermissionModel { 'UpdateOrgPermissionInput', 'id', 'orgPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts index 8d00b99325..20ed957d15 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefault.ts @@ -198,7 +198,8 @@ export class OrgPermissionDefaultModel { 'UpdateOrgPermissionDefaultInput', 'id', 'orgPermissionDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts index 2f1a709be3..07d5976acb 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultGrant.ts @@ -198,7 +198,8 @@ export class OrgPermissionDefaultGrantModel { 'UpdateOrgPermissionDefaultGrantInput', 'id', 'orgPermissionDefaultGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts index 7c898408dc..3339ceaeca 100644 --- a/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts +++ b/sdk/constructive-sdk/src/admin/orm/models/orgPermissionDefaultPermission.ts @@ -221,7 +221,8 @@ export class OrgPermissionDefaultPermissionModel { 'UpdateOrgPermissionDefaultPermissionInput', 'id', 'orgPermissionDefaultPermissionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/admin/orm/query-builder.ts b/sdk/constructive-sdk/src/admin/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/admin/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/admin/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-sdk/src/agent/orm/input-types.ts b/sdk/constructive-sdk/src/agent/orm/input-types.ts index dbb8e0c07f..8198498912 100644 --- a/sdk/constructive-sdk/src/agent/orm/input-types.ts +++ b/sdk/constructive-sdk/src/agent/orm/input-types.ts @@ -1092,7 +1092,8 @@ export interface AgentResourceFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -1569,6 +1570,7 @@ export interface CreateAgentResourceChunkInput { chunkIndex?: number; embedding?: number[]; metadata?: Record; + embeddingText?: string; }; } export interface AgentResourceChunkPatch { @@ -1577,6 +1579,7 @@ export interface AgentResourceChunkPatch { chunkIndex?: number | null; embedding?: number[] | null; metadata?: Record | null; + embeddingText?: string | null; } export interface UpdateAgentResourceChunkInput { clientMutationId?: string; @@ -1638,6 +1641,7 @@ export interface CreateAgentResourceInput { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + embeddingText?: string; }; } export interface AgentResourcePatch { @@ -1655,6 +1659,7 @@ export interface AgentResourcePatch { archivedAt?: string | null; embedding?: number[] | null; embeddingUpdatedAt?: string | null; + embeddingText?: string | null; } export interface UpdateAgentResourceInput { clientMutationId?: string; @@ -1770,6 +1775,8 @@ export interface VectorNearbyInput { distance?: number; /** When true (default for tables with @hasChunks), transparently queries the chunks table and returns the minimum distance across parent + all chunks. Set to false to only search the parent embedding. */ includeChunks?: boolean; + /** Natural language text to embed server-side for similarity search. Mutually exclusive with `vector` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + text?: string; } /** A filter to be used against many `Agent` object types. All fields are combined with a logical ‘and.’ */ export interface AgentPersonaToManyAgentFilter { @@ -2021,6 +2028,8 @@ export interface AgentResourceChunkInput { metadata?: Record; createdAt?: string; updatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } /** An input for mutations affecting `AgentPersona` */ export interface AgentPersonaInput { @@ -2073,6 +2082,8 @@ export interface AgentResourceInput { archivedAt?: string; embedding?: number[]; embeddingUpdatedAt?: string; + /** Natural language text to embed server-side into the `embedding` vector column. Mutually exclusive with `embedding` — provide one or the other. Requires the LLM plugin to be configured with an embedding provider. */ + embeddingText?: string; } /** A filter to be used against `AgentTask` object types. All fields are combined with a logical ‘and.’ */ export interface AgentTaskFilter { @@ -2721,7 +2732,8 @@ export interface AgentResourceFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; diff --git a/sdk/constructive-sdk/src/agent/orm/models/agent.ts b/sdk/constructive-sdk/src/agent/orm/models/agent.ts index 1bf091a6cf..72f4b04da0 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agent.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agent.ts @@ -196,7 +196,8 @@ export class AgentModel { 'UpdateAgentInput', 'id', 'agentPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts b/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts index d128641c85..ffa3a09734 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentMessage.ts @@ -196,7 +196,8 @@ export class AgentMessageModel { 'UpdateAgentMessageInput', 'id', 'agentMessagePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts b/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts index 84cebbe0e1..1391dbde2c 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentPersona.ts @@ -196,7 +196,8 @@ export class AgentPersonaModel { 'UpdateAgentPersonaInput', 'id', 'agentPersonaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts b/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts index ec029de47d..9829718fee 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentPlan.ts @@ -196,7 +196,8 @@ export class AgentPlanModel { 'UpdateAgentPlanInput', 'id', 'agentPlanPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts b/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts index 5e4aa9b6d1..e301bf6c99 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentPrompt.ts @@ -196,7 +196,8 @@ export class AgentPromptModel { 'UpdateAgentPromptInput', 'id', 'agentPromptPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts b/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts index a02699c383..7628b03b3c 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentResource.ts @@ -196,7 +196,8 @@ export class AgentResourceModel { 'UpdateAgentResourceInput', 'id', 'agentResourcePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts b/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts index b69cb15557..fd5edf82ac 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentResourceChunk.ts @@ -196,7 +196,8 @@ export class AgentResourceChunkModel { 'UpdateAgentResourceChunkInput', 'id', 'agentResourceChunkPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts b/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts index 3bbc609f16..a4b3a1e367 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentTask.ts @@ -196,7 +196,8 @@ export class AgentTaskModel { 'UpdateAgentTaskInput', 'id', 'agentTaskPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts b/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts index 7bbd14abec..1ae2eb5a67 100644 --- a/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts +++ b/sdk/constructive-sdk/src/agent/orm/models/agentThread.ts @@ -196,7 +196,8 @@ export class AgentThreadModel { 'UpdateAgentThreadInput', 'id', 'agentThreadPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/agent/orm/query-builder.ts b/sdk/constructive-sdk/src/agent/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/agent/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/agent/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-sdk/src/api/orm/README.md b/sdk/constructive-sdk/src/api/orm/README.md index e4f38f7327..caf70c1803 100644 --- a/sdk/constructive-sdk/src/api/orm/README.md +++ b/sdk/constructive-sdk/src/api/orm/README.md @@ -121,6 +121,7 @@ CRUD operations for Schema records. | `scope` | Int | Yes | | `tags` | String | Yes | | `isPublic` | Boolean | Yes | +| `apiExposure` | ApiExposureLevel | Yes | | `createdAt` | Datetime | No | | `updatedAt` | Datetime | No | @@ -128,13 +129,13 @@ CRUD operations for Schema records. ```typescript // List all schema records -const items = await db.schema.findMany({ select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }).execute(); +const items = await db.schema.findMany({ select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }).execute(); // Get one by id -const item = await db.schema.findOne({ id: '', select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, createdAt: true, updatedAt: true } }).execute(); +const item = await db.schema.findOne({ id: '', select: { id: true, databaseId: true, name: true, schemaName: true, label: true, description: true, smartTags: true, category: true, scope: true, tags: true, isPublic: true, apiExposure: true, createdAt: true, updatedAt: true } }).execute(); // Create -const created = await db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '' }, select: { id: true } }).execute(); +const created = await db.schema.create({ data: { databaseId: '', name: '', schemaName: '', label: '', description: '', smartTags: '', category: '', scope: '', tags: '', isPublic: '', apiExposure: '' }, select: { id: true } }).execute(); // Update const updated = await db.schema.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); diff --git a/sdk/constructive-sdk/src/api/orm/input-types.ts b/sdk/constructive-sdk/src/api/orm/input-types.ts index 75eb0921a8..b1e5d0f51c 100644 --- a/sdk/constructive-sdk/src/api/orm/input-types.ts +++ b/sdk/constructive-sdk/src/api/orm/input-types.ts @@ -231,6 +231,7 @@ export interface UUIDListFilter { anyGreaterThanOrEqualTo?: string; } // ============ Enum Types ============ +export type ApiExposureLevel = 'EXPOSABLE' | 'INTERNAL_ONLY' | 'NEVER_EXPOSE'; export type ObjectCategory = 'CORE' | 'MODULE' | 'PERMISSIONS' | 'AUTH' | 'MEMBERSHIPS' | 'APP'; // ============ Custom Scalar Types ============ export type ConstructiveInternalTypeAttachment = unknown; @@ -257,6 +258,7 @@ export interface Schema { scope?: number | null; tags?: string[] | null; isPublic?: boolean | null; + apiExposure?: ApiExposureLevel | null; createdAt?: string | null; updatedAt?: string | null; } @@ -1329,6 +1331,7 @@ export type SchemaSelect = { scope?: boolean; tags?: boolean; isPublic?: boolean; + apiExposure?: boolean; createdAt?: boolean; updatedAt?: boolean; database?: { @@ -2718,6 +2721,8 @@ export interface SchemaFilter { tags?: StringListFilter; /** Filter by the object’s `isPublic` field. */ isPublic?: BooleanFilter; + /** Filter by the object’s `apiExposure` field. */ + apiExposure?: ApiExposureLevelFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ @@ -4652,6 +4657,8 @@ export type SchemaOrderBy = | 'TAGS_DESC' | 'IS_PUBLIC_ASC' | 'IS_PUBLIC_DESC' + | 'API_EXPOSURE_ASC' + | 'API_EXPOSURE_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' @@ -5804,6 +5811,7 @@ export interface CreateSchemaInput { scope?: number; tags?: string[]; isPublic?: boolean; + apiExposure?: ApiExposureLevel; }; } export interface SchemaPatch { @@ -5817,6 +5825,7 @@ export interface SchemaPatch { scope?: number | null; tags?: string[] | null; isPublic?: boolean | null; + apiExposure?: ApiExposureLevel | null; } export interface UpdateSchemaInput { clientMutationId?: string; @@ -7497,6 +7506,31 @@ export interface ObjectCategoryFilter { /** Greater than or equal to the specified value. */ greaterThanOrEqualTo?: ObjectCategory; } +/** A filter to be used against ApiExposureLevel fields. All fields are combined with a logical ‘and.’ */ +export interface ApiExposureLevelFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: ApiExposureLevel; + /** Not equal to the specified value. */ + notEqualTo?: ApiExposureLevel; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: ApiExposureLevel; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: ApiExposureLevel; + /** Included in the specified list. */ + in?: ApiExposureLevel[]; + /** Not included in the specified list. */ + notIn?: ApiExposureLevel[]; + /** Less than the specified value. */ + lessThan?: ApiExposureLevel; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: ApiExposureLevel; + /** Greater than the specified value. */ + greaterThan?: ApiExposureLevel; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: ApiExposureLevel; +} /** A filter to be used against many `Table` object types. All fields are combined with a logical ‘and.’ */ export interface SchemaToManyTableFilter { /** Filters to entities where at least one related entity matches. */ @@ -8457,6 +8491,7 @@ export interface SchemaInput { scope?: number; tags?: string[]; isPublic?: boolean; + apiExposure?: ApiExposureLevel; createdAt?: string; updatedAt?: string; } @@ -10346,6 +10381,8 @@ export interface SchemaFilter { tags?: StringListFilter; /** Filter by the object’s `isPublic` field. */ isPublic?: BooleanFilter; + /** Filter by the object’s `apiExposure` field. */ + apiExposure?: ApiExposureLevelFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ diff --git a/sdk/constructive-sdk/src/api/orm/models/api.ts b/sdk/constructive-sdk/src/api/orm/models/api.ts index 5e2e04bd39..4d60695731 100644 --- a/sdk/constructive-sdk/src/api/orm/models/api.ts +++ b/sdk/constructive-sdk/src/api/orm/models/api.ts @@ -196,7 +196,8 @@ export class ApiModel { 'UpdateApiInput', 'id', 'apiPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/apiModule.ts b/sdk/constructive-sdk/src/api/orm/models/apiModule.ts index d98c67c6e7..dd9bb29f76 100644 --- a/sdk/constructive-sdk/src/api/orm/models/apiModule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/apiModule.ts @@ -196,7 +196,8 @@ export class ApiModuleModel { 'UpdateApiModuleInput', 'id', 'apiModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts b/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts index 9ef99da8cd..2179728a2b 100644 --- a/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts +++ b/sdk/constructive-sdk/src/api/orm/models/apiSchema.ts @@ -196,7 +196,8 @@ export class ApiSchemaModel { 'UpdateApiSchemaInput', 'id', 'apiSchemaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts b/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts index 9c3140fdc9..01f1b5b74e 100644 --- a/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/apiSetting.ts @@ -196,7 +196,8 @@ export class ApiSettingModel { 'UpdateApiSettingInput', 'id', 'apiSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/app.ts b/sdk/constructive-sdk/src/api/orm/models/app.ts index 73ac9831b1..049d73f6c0 100644 --- a/sdk/constructive-sdk/src/api/orm/models/app.ts +++ b/sdk/constructive-sdk/src/api/orm/models/app.ts @@ -196,7 +196,8 @@ export class AppModel { 'UpdateAppInput', 'id', 'appPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts index 5c052886fa..7f6054e6a4 100644 --- a/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/checkConstraint.ts @@ -196,7 +196,8 @@ export class CheckConstraintModel { 'UpdateCheckConstraintInput', 'id', 'checkConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/compositeType.ts b/sdk/constructive-sdk/src/api/orm/models/compositeType.ts index 0f46f810e9..72f4ab3adf 100644 --- a/sdk/constructive-sdk/src/api/orm/models/compositeType.ts +++ b/sdk/constructive-sdk/src/api/orm/models/compositeType.ts @@ -196,7 +196,8 @@ export class CompositeTypeModel { 'UpdateCompositeTypeInput', 'id', 'compositeTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts b/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts index 91b61c1eb4..2e37465f00 100644 --- a/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/corsSetting.ts @@ -196,7 +196,8 @@ export class CorsSettingModel { 'UpdateCorsSettingInput', 'id', 'corsSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/database.ts b/sdk/constructive-sdk/src/api/orm/models/database.ts index 57b3505489..41c99ba120 100644 --- a/sdk/constructive-sdk/src/api/orm/models/database.ts +++ b/sdk/constructive-sdk/src/api/orm/models/database.ts @@ -196,7 +196,8 @@ export class DatabaseModel { 'UpdateDatabaseInput', 'id', 'databasePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts b/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts index 08d9ab8cb6..6743fdbdc2 100644 --- a/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/databaseSetting.ts @@ -196,7 +196,8 @@ export class DatabaseSettingModel { 'UpdateDatabaseSettingInput', 'id', 'databaseSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts b/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts index dd22777cdf..9260ed2fb7 100644 --- a/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts +++ b/sdk/constructive-sdk/src/api/orm/models/databaseTransfer.ts @@ -196,7 +196,8 @@ export class DatabaseTransferModel { 'UpdateDatabaseTransferInput', 'id', 'databaseTransferPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts b/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts index 36414357b3..8d964bf6a4 100644 --- a/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts +++ b/sdk/constructive-sdk/src/api/orm/models/defaultPrivilege.ts @@ -196,7 +196,8 @@ export class DefaultPrivilegeModel { 'UpdateDefaultPrivilegeInput', 'id', 'defaultPrivilegePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/domain.ts b/sdk/constructive-sdk/src/api/orm/models/domain.ts index ab0016ec4b..d5d807ae4c 100644 --- a/sdk/constructive-sdk/src/api/orm/models/domain.ts +++ b/sdk/constructive-sdk/src/api/orm/models/domain.ts @@ -196,7 +196,8 @@ export class DomainModel { 'UpdateDomainInput', 'id', 'domainPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts b/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts index a5c7feb754..90af6f51a9 100644 --- a/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts +++ b/sdk/constructive-sdk/src/api/orm/models/embeddingChunk.ts @@ -196,7 +196,8 @@ export class EmbeddingChunkModel { 'UpdateEmbeddingChunkInput', 'id', 'embeddingChunkPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/enum.ts b/sdk/constructive-sdk/src/api/orm/models/enum.ts index 58495e1551..b5f965ea6f 100644 --- a/sdk/constructive-sdk/src/api/orm/models/enum.ts +++ b/sdk/constructive-sdk/src/api/orm/models/enum.ts @@ -196,7 +196,8 @@ export class EnumModel { 'UpdateEnumInput', 'id', 'enumPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/field.ts b/sdk/constructive-sdk/src/api/orm/models/field.ts index 7664e791c7..baa1994dbd 100644 --- a/sdk/constructive-sdk/src/api/orm/models/field.ts +++ b/sdk/constructive-sdk/src/api/orm/models/field.ts @@ -196,7 +196,8 @@ export class FieldModel { 'UpdateFieldInput', 'id', 'fieldPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts index 36e80496f3..498b987bd0 100644 --- a/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/foreignKeyConstraint.ts @@ -198,7 +198,8 @@ export class ForeignKeyConstraintModel { 'UpdateForeignKeyConstraintInput', 'id', 'foreignKeyConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts b/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts index 2135f84475..1fc50cde73 100644 --- a/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts +++ b/sdk/constructive-sdk/src/api/orm/models/fullTextSearch.ts @@ -196,7 +196,8 @@ export class FullTextSearchModel { 'UpdateFullTextSearchInput', 'id', 'fullTextSearchPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/function.ts b/sdk/constructive-sdk/src/api/orm/models/function.ts index 1ca6207ace..fc8fba9b21 100644 --- a/sdk/constructive-sdk/src/api/orm/models/function.ts +++ b/sdk/constructive-sdk/src/api/orm/models/function.ts @@ -196,7 +196,8 @@ export class FunctionModel { 'UpdateFunctionInput', 'id', 'functionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/indexModel.ts b/sdk/constructive-sdk/src/api/orm/models/indexModel.ts index 1c7eb1e964..919849c835 100644 --- a/sdk/constructive-sdk/src/api/orm/models/indexModel.ts +++ b/sdk/constructive-sdk/src/api/orm/models/indexModel.ts @@ -196,7 +196,8 @@ export class IndexModel { 'UpdateIndexInput', 'id', 'indexPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts b/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts index 83cb41250f..ab4670e925 100644 --- a/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts +++ b/sdk/constructive-sdk/src/api/orm/models/nodeTypeRegistry.ts @@ -196,7 +196,8 @@ export class NodeTypeRegistryModel { 'UpdateNodeTypeRegistryInput', 'name', 'nodeTypeRegistryPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/partition.ts b/sdk/constructive-sdk/src/api/orm/models/partition.ts index 86baeedbe9..1f848f6419 100644 --- a/sdk/constructive-sdk/src/api/orm/models/partition.ts +++ b/sdk/constructive-sdk/src/api/orm/models/partition.ts @@ -196,7 +196,8 @@ export class PartitionModel { 'UpdatePartitionInput', 'id', 'partitionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/policy.ts b/sdk/constructive-sdk/src/api/orm/models/policy.ts index c60088703b..0b50aa86d3 100644 --- a/sdk/constructive-sdk/src/api/orm/models/policy.ts +++ b/sdk/constructive-sdk/src/api/orm/models/policy.ts @@ -196,7 +196,8 @@ export class PolicyModel { 'UpdatePolicyInput', 'id', 'policyPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts index e73aca57d2..65f2946d86 100644 --- a/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/primaryKeyConstraint.ts @@ -198,7 +198,8 @@ export class PrimaryKeyConstraintModel { 'UpdatePrimaryKeyConstraintInput', 'id', 'primaryKeyConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts b/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts index d950bb4fd5..e44627cac6 100644 --- a/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/pubkeySetting.ts @@ -196,7 +196,8 @@ export class PubkeySettingModel { 'UpdatePubkeySettingInput', 'id', 'pubkeySettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts b/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts index 50c715e02b..f371074a3a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/rlsSetting.ts @@ -196,7 +196,8 @@ export class RlsSettingModel { 'UpdateRlsSettingInput', 'id', 'rlsSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/schema.ts b/sdk/constructive-sdk/src/api/orm/models/schema.ts index 3d0af98206..d9d34cae1a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/schema.ts +++ b/sdk/constructive-sdk/src/api/orm/models/schema.ts @@ -196,7 +196,8 @@ export class SchemaModel { 'UpdateSchemaInput', 'id', 'schemaPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts b/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts index dfe7569752..553345a2b3 100644 --- a/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts +++ b/sdk/constructive-sdk/src/api/orm/models/schemaGrant.ts @@ -196,7 +196,8 @@ export class SchemaGrantModel { 'UpdateSchemaGrantInput', 'id', 'schemaGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/site.ts b/sdk/constructive-sdk/src/api/orm/models/site.ts index 070a32b240..30c5c8f81a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/site.ts +++ b/sdk/constructive-sdk/src/api/orm/models/site.ts @@ -196,7 +196,8 @@ export class SiteModel { 'UpdateSiteInput', 'id', 'sitePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts b/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts index de85238e4f..1e8bc08f33 100644 --- a/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts +++ b/sdk/constructive-sdk/src/api/orm/models/siteMetadatum.ts @@ -196,7 +196,8 @@ export class SiteMetadatumModel { 'UpdateSiteMetadatumInput', 'id', 'siteMetadatumPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/siteModule.ts b/sdk/constructive-sdk/src/api/orm/models/siteModule.ts index b890423fee..fe7f43bf62 100644 --- a/sdk/constructive-sdk/src/api/orm/models/siteModule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/siteModule.ts @@ -196,7 +196,8 @@ export class SiteModuleModel { 'UpdateSiteModuleInput', 'id', 'siteModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts b/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts index 57b9cadc54..51551f60db 100644 --- a/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts +++ b/sdk/constructive-sdk/src/api/orm/models/siteTheme.ts @@ -196,7 +196,8 @@ export class SiteThemeModel { 'UpdateSiteThemeInput', 'id', 'siteThemePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts b/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts index fe266c9d35..31de43c115 100644 --- a/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts +++ b/sdk/constructive-sdk/src/api/orm/models/spatialRelation.ts @@ -196,7 +196,8 @@ export class SpatialRelationModel { 'UpdateSpatialRelationInput', 'id', 'spatialRelationPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/table.ts b/sdk/constructive-sdk/src/api/orm/models/table.ts index db1c5d3a97..1f8df77e80 100644 --- a/sdk/constructive-sdk/src/api/orm/models/table.ts +++ b/sdk/constructive-sdk/src/api/orm/models/table.ts @@ -196,7 +196,8 @@ export class TableModel { 'UpdateTableInput', 'id', 'tablePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts b/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts index e05b44f2b3..b49372245a 100644 --- a/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts +++ b/sdk/constructive-sdk/src/api/orm/models/tableGrant.ts @@ -196,7 +196,8 @@ export class TableGrantModel { 'UpdateTableGrantInput', 'id', 'tableGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/trigger.ts b/sdk/constructive-sdk/src/api/orm/models/trigger.ts index f4812bc6ea..47169bc484 100644 --- a/sdk/constructive-sdk/src/api/orm/models/trigger.ts +++ b/sdk/constructive-sdk/src/api/orm/models/trigger.ts @@ -196,7 +196,8 @@ export class TriggerModel { 'UpdateTriggerInput', 'id', 'triggerPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts b/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts index d2bd543aa4..40d2ee283e 100644 --- a/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts +++ b/sdk/constructive-sdk/src/api/orm/models/triggerFunction.ts @@ -196,7 +196,8 @@ export class TriggerFunctionModel { 'UpdateTriggerFunctionInput', 'id', 'triggerFunctionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts b/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts index 3c1dad93d6..0880a23e50 100644 --- a/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts +++ b/sdk/constructive-sdk/src/api/orm/models/uniqueConstraint.ts @@ -196,7 +196,8 @@ export class UniqueConstraintModel { 'UpdateUniqueConstraintInput', 'id', 'uniqueConstraintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/view.ts b/sdk/constructive-sdk/src/api/orm/models/view.ts index 75acdcbcf5..04afa60a84 100644 --- a/sdk/constructive-sdk/src/api/orm/models/view.ts +++ b/sdk/constructive-sdk/src/api/orm/models/view.ts @@ -196,7 +196,8 @@ export class ViewModel { 'UpdateViewInput', 'id', 'viewPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts b/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts index bd4eddaefe..7f9b69a42c 100644 --- a/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts +++ b/sdk/constructive-sdk/src/api/orm/models/viewGrant.ts @@ -196,7 +196,8 @@ export class ViewGrantModel { 'UpdateViewGrantInput', 'id', 'viewGrantPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/viewRule.ts b/sdk/constructive-sdk/src/api/orm/models/viewRule.ts index cdec5ad128..df3eadd57c 100644 --- a/sdk/constructive-sdk/src/api/orm/models/viewRule.ts +++ b/sdk/constructive-sdk/src/api/orm/models/viewRule.ts @@ -196,7 +196,8 @@ export class ViewRuleModel { 'UpdateViewRuleInput', 'id', 'viewRulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/viewTable.ts b/sdk/constructive-sdk/src/api/orm/models/viewTable.ts index 83362317e6..44308019a0 100644 --- a/sdk/constructive-sdk/src/api/orm/models/viewTable.ts +++ b/sdk/constructive-sdk/src/api/orm/models/viewTable.ts @@ -196,7 +196,8 @@ export class ViewTableModel { 'UpdateViewTableInput', 'id', 'viewTablePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts b/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts index e83c7e59f7..515c0dbcaa 100644 --- a/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts +++ b/sdk/constructive-sdk/src/api/orm/models/webauthnSetting.ts @@ -196,7 +196,8 @@ export class WebauthnSettingModel { 'UpdateWebauthnSettingInput', 'id', 'webauthnSettingPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/api/orm/query-builder.ts b/sdk/constructive-sdk/src/api/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/api/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/api/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-sdk/src/auth/orm/input-types.ts b/sdk/constructive-sdk/src/auth/orm/input-types.ts index 8e73cfffb4..734fe10c3a 100644 --- a/sdk/constructive-sdk/src/auth/orm/input-types.ts +++ b/sdk/constructive-sdk/src/auth/orm/input-types.ts @@ -808,7 +808,8 @@ export interface UserFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; @@ -2221,7 +2222,8 @@ export interface UserFilter { /** * Composite unified search. Provide a search string and it will be dispatched to * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * simultaneously. Rows matching ANY algorithm are returned. All matching score + * simultaneously. When the LLM plugin is active, pgvector also participates via + * auto-embedding. Rows matching ANY algorithm are returned. All matching score * fields are populated. */ unifiedSearch?: string; diff --git a/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts b/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts index 8a6665612c..d0eee8faf1 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/auditLogAuth.ts @@ -176,6 +176,7 @@ export class AuditLogAuthModel { S, { id: string; + createdAt: string; }, AuditLogAuthPatch > & { @@ -196,7 +197,10 @@ export class AuditLogAuthModel { 'UpdateAuditLogAuthInput', 'id', 'auditLogAuthPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class AuditLogAuthModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class AuditLogAuthModel { 'auditLogAuth', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteAuditLogAuthInput', args.select, diff --git a/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts b/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts index 11914bd9d1..5dc26c76df 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/cryptoAddress.ts @@ -196,7 +196,8 @@ export class CryptoAddressModel { 'UpdateCryptoAddressInput', 'id', 'cryptoAddressPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/auth/orm/models/email.ts b/sdk/constructive-sdk/src/auth/orm/models/email.ts index 325475b9ce..eb60ea671f 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/email.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/email.ts @@ -196,7 +196,8 @@ export class EmailModel { 'UpdateEmailInput', 'id', 'emailPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts b/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts index 0803908e25..f005f23c34 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/phoneNumber.ts @@ -196,7 +196,8 @@ export class PhoneNumberModel { 'UpdatePhoneNumberInput', 'id', 'phoneNumberPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/auth/orm/models/roleType.ts b/sdk/constructive-sdk/src/auth/orm/models/roleType.ts index 8b256a0dc7..e8df4924bd 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/roleType.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/roleType.ts @@ -196,7 +196,8 @@ export class RoleTypeModel { 'UpdateRoleTypeInput', 'id', 'roleTypePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/auth/orm/models/user.ts b/sdk/constructive-sdk/src/auth/orm/models/user.ts index 8935818350..a35147a5ac 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/user.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/user.ts @@ -196,7 +196,8 @@ export class UserModel { 'UpdateUserInput', 'id', 'userPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts b/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts index cca4c75cf4..bc31ef6a16 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/webauthnCredential.ts @@ -196,7 +196,8 @@ export class WebauthnCredentialModel { 'UpdateWebauthnCredentialInput', 'id', 'webauthnCredentialPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/auth/orm/query-builder.ts b/sdk/constructive-sdk/src/auth/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/auth/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/auth/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-sdk/src/compute/README.md b/sdk/constructive-sdk/src/compute/README.md new file mode 100644 index 0000000000..53845f0511 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/README.md @@ -0,0 +1,41 @@ +# Generated GraphQL SDK + +

+ +

+ + + +## Overview + +- **Tables:** 18 +- **Custom queries:** 1 +- **Custom mutations:** 14 + +**Generators:** ORM + +## Modules + +### ORM Client (`./orm`) + +Prisma-like ORM client for programmatic GraphQL access. + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', +}); +``` + +See [orm/README.md](./orm/README.md) for full API reference. + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-sdk/src/compute/index.ts b/sdk/constructive-sdk/src/compute/index.ts new file mode 100644 index 0000000000..654223e7a5 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/index.ts @@ -0,0 +1,5 @@ +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +export * from './orm'; diff --git a/sdk/constructive-sdk/src/compute/orm/README.md b/sdk/constructive-sdk/src/compute/orm/README.md new file mode 100644 index 0000000000..c266bdfcb7 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/README.md @@ -0,0 +1,986 @@ +# ORM Client + +

+ +

+ + + +## Setup + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); +``` + +## Models + +| Model | Operations | +|-------|------------| +| `getAllRecord` | findMany, findOne, create, update, delete | +| `functionApiBinding` | findMany, findOne, create, update, delete | +| `functionDeployment` | findMany, findOne, create, update, delete | +| `functionGraphRef` | findMany, findOne, create, update, delete | +| `functionGraphStore` | findMany, findOne, create, update, delete | +| `functionGraphObject` | findMany, findOne, create, update, delete | +| `functionDeploymentEvent` | findMany, findOne, create, update, delete | +| `orgFunctionExecutionLog` | findMany, findOne, create, update, delete | +| `functionGraphExecutionOutput` | findMany, findOne, create, update, delete | +| `functionGraphCommit` | findMany, findOne, create, update, delete | +| `secretDefinition` | findMany, findOne, create, update, delete | +| `functionExecutionLog` | findMany, findOne, create, update, delete | +| `functionGraphExecutionNodeState` | findMany, findOne, create, update, delete | +| `functionGraph` | findMany, findOne, create, update, delete | +| `orgFunctionInvocation` | findMany, findOne, create, update, delete | +| `functionInvocation` | findMany, findOne, create, update, delete | +| `functionGraphExecution` | findMany, findOne, create, update, delete | +| `functionDefinition` | findMany, findOne, create, update, delete | + +## Table Operations + +### `db.getAllRecord` + +CRUD operations for GetAllRecord records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `path` | String | Yes | +| `data` | JSON | Yes | + +**Operations:** + +```typescript +// List all getAllRecord records +const items = await db.getAllRecord.findMany({ select: { path: true, data: true } }).execute(); + +// Get one by id +const item = await db.getAllRecord.findOne({ id: '', select: { path: true, data: true } }).execute(); + +// Create +const created = await db.getAllRecord.create({ data: { path: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.getAllRecord.update({ where: { id: '' }, data: { path: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.getAllRecord.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionApiBinding` + +CRUD operations for FunctionApiBinding records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `functionDefinitionId` | UUID | Yes | +| `apiId` | UUID | Yes | +| `alias` | String | Yes | +| `config` | JSON | Yes | + +**Operations:** + +```typescript +// List all functionApiBinding records +const items = await db.functionApiBinding.findMany({ select: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }).execute(); + +// Get one by id +const item = await db.functionApiBinding.findOne({ id: '', select: { id: true, functionDefinitionId: true, apiId: true, alias: true, config: true } }).execute(); + +// Create +const created = await db.functionApiBinding.create({ data: { functionDefinitionId: '', apiId: '', alias: '', config: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionApiBinding.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionApiBinding.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDeployment` + +CRUD operations for FunctionDeployment records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `functionDefinitionId` | UUID | Yes | +| `namespaceId` | UUID | Yes | +| `status` | String | Yes | +| `serviceUrl` | String | Yes | +| `serviceName` | String | Yes | +| `revision` | Int | Yes | +| `image` | String | Yes | +| `concurrency` | Int | Yes | +| `scaleMin` | Int | Yes | +| `scaleMax` | Int | Yes | +| `timeoutSeconds` | Int | Yes | +| `resources` | JSON | Yes | +| `lastError` | String | Yes | +| `lastErrorAt` | Datetime | Yes | +| `errorCount` | Int | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionDeployment records +const items = await db.functionDeployment.findMany({ select: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionDeployment.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, functionDefinitionId: true, namespaceId: true, status: true, serviceUrl: true, serviceName: true, revision: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, lastError: true, lastErrorAt: true, errorCount: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionDeployment.create({ data: { functionDefinitionId: '', namespaceId: '', status: '', serviceUrl: '', serviceName: '', revision: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', lastError: '', lastErrorAt: '', errorCount: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeployment.update({ where: { id: '' }, data: { functionDefinitionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeployment.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphRef` + +CRUD operations for FunctionGraphRef records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `name` | String | Yes | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `commitId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionGraphRef records +const items = await db.functionGraphRef.findMany({ select: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }).execute(); + +// Get one by id +const item = await db.functionGraphRef.findOne({ id: '', select: { id: true, name: true, databaseId: true, storeId: true, commitId: true } }).execute(); + +// Create +const created = await db.functionGraphRef.create({ data: { name: '', databaseId: '', storeId: '', commitId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphRef.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphRef.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphStore` + +CRUD operations for FunctionGraphStore records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `name` | String | Yes | +| `databaseId` | UUID | Yes | +| `hash` | UUID | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraphStore records +const items = await db.functionGraphStore.findMany({ select: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraphStore.findOne({ id: '', select: { id: true, name: true, databaseId: true, hash: true, createdAt: true } }).execute(); + +// Create +const created = await db.functionGraphStore.create({ data: { name: '', databaseId: '', hash: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphStore.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphStore.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphObject` + +CRUD operations for FunctionGraphObject records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `kids` | UUID | Yes | +| `ktree` | String | Yes | +| `data` | JSON | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraphObject records +const items = await db.functionGraphObject.findMany({ select: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraphObject.findOne({ id: '', select: { id: true, databaseId: true, kids: true, ktree: true, data: true, createdAt: true } }).execute(); + +// Create +const created = await db.functionGraphObject.create({ data: { databaseId: '', kids: '', ktree: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphObject.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphObject.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDeploymentEvent` + +CRUD operations for FunctionDeploymentEvent records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `deploymentId` | UUID | Yes | +| `eventType` | String | Yes | +| `actorId` | UUID | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionDeploymentEvent records +const items = await db.functionDeploymentEvent.findMany({ select: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionDeploymentEvent.findOne({ id: '', select: { createdAt: true, id: true, deploymentId: true, eventType: true, actorId: true, message: true, metadata: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionDeploymentEvent.create({ data: { deploymentId: '', eventType: '', actorId: '', message: '', metadata: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeploymentEvent.update({ where: { id: '' }, data: { deploymentId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeploymentEvent.delete({ where: { id: '' } }).execute(); +``` + +### `db.orgFunctionExecutionLog` + +CRUD operations for OrgFunctionExecutionLog records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `invocationId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `logLevel` | String | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `actorId` | UUID | Yes | + +**Operations:** + +```typescript +// List all orgFunctionExecutionLog records +const items = await db.orgFunctionExecutionLog.findMany({ select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }).execute(); + +// Get one by id +const item = await db.orgFunctionExecutionLog.findOne({ id: '', select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true } }).execute(); + +// Create +const created = await db.orgFunctionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgFunctionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgFunctionExecutionLog.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecutionOutput` + +CRUD operations for FunctionGraphExecutionOutput records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `hash` | Base64EncodedBinary | Yes | +| `data` | JSON | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecutionOutput records +const items = await db.functionGraphExecutionOutput.findMany({ select: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecutionOutput.findOne({ id: '', select: { createdAt: true, id: true, databaseId: true, hash: true, data: true } }).execute(); + +// Create +const created = await db.functionGraphExecutionOutput.create({ data: { databaseId: '', hash: '', data: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecutionOutput.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecutionOutput.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphCommit` + +CRUD operations for FunctionGraphCommit records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `message` | String | Yes | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `parentIds` | UUID | Yes | +| `authorId` | UUID | Yes | +| `committerId` | UUID | Yes | +| `treeId` | UUID | Yes | +| `date` | Datetime | Yes | + +**Operations:** + +```typescript +// List all functionGraphCommit records +const items = await db.functionGraphCommit.findMany({ select: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }).execute(); + +// Get one by id +const item = await db.functionGraphCommit.findOne({ id: '', select: { id: true, message: true, databaseId: true, storeId: true, parentIds: true, authorId: true, committerId: true, treeId: true, date: true } }).execute(); + +// Create +const created = await db.functionGraphCommit.create({ data: { message: '', databaseId: '', storeId: '', parentIds: '', authorId: '', committerId: '', treeId: '', date: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphCommit.update({ where: { id: '' }, data: { message: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphCommit.delete({ where: { id: '' } }).execute(); +``` + +### `db.secretDefinition` + +CRUD operations for SecretDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `name` | String | Yes | +| `description` | String | Yes | +| `isBuiltIn` | Boolean | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all secretDefinition records +const items = await db.secretDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.secretDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, isBuiltIn: true, labels: true, annotations: true, databaseId: true } }).execute(); + +// Create +const created = await db.secretDefinition.create({ data: { name: '', description: '', isBuiltIn: '', labels: '', annotations: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.secretDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.secretDefinition.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionExecutionLog` + +CRUD operations for FunctionExecutionLog records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `invocationId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `logLevel` | String | Yes | +| `message` | String | Yes | +| `metadata` | JSON | Yes | +| `actorId` | UUID | Yes | +| `databaseId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionExecutionLog records +const items = await db.functionExecutionLog.findMany({ select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }).execute(); + +// Get one by id +const item = await db.functionExecutionLog.findOne({ id: '', select: { createdAt: true, id: true, invocationId: true, taskIdentifier: true, logLevel: true, message: true, metadata: true, actorId: true, databaseId: true } }).execute(); + +// Create +const created = await db.functionExecutionLog.create({ data: { invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionExecutionLog.update({ where: { id: '' }, data: { invocationId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionExecutionLog.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecutionNodeState` + +CRUD operations for FunctionGraphExecutionNodeState records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `executionId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `nodeName` | String | Yes | +| `nodePath` | String | Yes | +| `status` | String | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `errorCode` | String | Yes | +| `errorMessage` | String | Yes | +| `outputId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecutionNodeState records +const items = await db.functionGraphExecutionNodeState.findMany({ select: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecutionNodeState.findOne({ id: '', select: { createdAt: true, id: true, executionId: true, databaseId: true, nodeName: true, nodePath: true, status: true, startedAt: true, completedAt: true, errorCode: true, errorMessage: true, outputId: true } }).execute(); + +// Create +const created = await db.functionGraphExecutionNodeState.create({ data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraph` + +CRUD operations for FunctionGraph records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `storeId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `context` | String | Yes | +| `name` | String | Yes | +| `description` | String | Yes | +| `definitionsCommitId` | UUID | Yes | +| `isValid` | Boolean | Yes | +| `validationErrors` | JSON | Yes | +| `createdBy` | UUID | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | + +**Operations:** + +```typescript +// List all functionGraph records +const items = await db.functionGraph.findMany({ select: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }).execute(); + +// Get one by id +const item = await db.functionGraph.findOne({ id: '', select: { id: true, databaseId: true, storeId: true, entityId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }).execute(); + +// Create +const created = await db.functionGraph.create({ data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); +``` + +### `db.orgFunctionInvocation` + +CRUD operations for OrgFunctionInvocation records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `actorId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `payload` | JSON | Yes | +| `status` | String | Yes | +| `result` | JSON | Yes | +| `error` | String | Yes | +| `durationMs` | Int | Yes | +| `jobId` | BigInt | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `parentInvocationId` | UUID | Yes | +| `graphExecutionId` | UUID | Yes | + +**Operations:** + +```typescript +// List all orgFunctionInvocation records +const items = await db.orgFunctionInvocation.findMany({ select: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Get one by id +const item = await db.orgFunctionInvocation.findOne({ id: '', select: { createdAt: true, id: true, actorId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Create +const created = await db.orgFunctionInvocation.create({ data: { actorId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgFunctionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgFunctionInvocation.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionInvocation` + +CRUD operations for FunctionInvocation records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `createdAt` | Datetime | No | +| `id` | UUID | No | +| `actorId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `taskIdentifier` | String | Yes | +| `payload` | JSON | Yes | +| `status` | String | Yes | +| `result` | JSON | Yes | +| `error` | String | Yes | +| `durationMs` | Int | Yes | +| `jobId` | BigInt | Yes | +| `startedAt` | Datetime | Yes | +| `completedAt` | Datetime | Yes | +| `parentInvocationId` | UUID | Yes | +| `graphExecutionId` | UUID | Yes | + +**Operations:** + +```typescript +// List all functionInvocation records +const items = await db.functionInvocation.findMany({ select: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Get one by id +const item = await db.functionInvocation.findOne({ id: '', select: { createdAt: true, id: true, actorId: true, databaseId: true, taskIdentifier: true, payload: true, status: true, result: true, error: true, durationMs: true, jobId: true, startedAt: true, completedAt: true, parentInvocationId: true, graphExecutionId: true } }).execute(); + +// Create +const created = await db.functionInvocation.create({ data: { actorId: '', databaseId: '', taskIdentifier: '', payload: '', status: '', result: '', error: '', durationMs: '', jobId: '', startedAt: '', completedAt: '', parentInvocationId: '', graphExecutionId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionInvocation.update({ where: { id: '' }, data: { actorId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionInvocation.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionGraphExecution` + +CRUD operations for FunctionGraphExecution records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `startedAt` | Datetime | Yes | +| `id` | UUID | No | +| `graphId` | UUID | Yes | +| `invocationId` | UUID | Yes | +| `databaseId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `outputNode` | String | Yes | +| `outputPort` | String | Yes | +| `status` | String | Yes | +| `inputPayload` | JSON | Yes | +| `outputPayload` | JSON | Yes | +| `nodeOutputs` | JSON | Yes | +| `executionPlan` | JSON | Yes | +| `currentWave` | Int | Yes | +| `parentExecutionId` | UUID | Yes | +| `parentNodeName` | String | Yes | +| `definitionsCommitId` | UUID | Yes | +| `tickCount` | Int | Yes | +| `completedAt` | Datetime | Yes | +| `maxTicks` | Int | Yes | +| `maxPendingJobs` | Int | Yes | +| `timeoutAt` | Datetime | Yes | +| `errorCode` | String | Yes | +| `errorMessage` | String | Yes | + +**Operations:** + +```typescript +// List all functionGraphExecution records +const items = await db.functionGraphExecution.findMany({ select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }).execute(); + +// Get one by id +const item = await db.functionGraphExecution.findOne({ id: '', select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: true, entityId: true, outputNode: true, outputPort: true, status: true, inputPayload: true, outputPayload: true, nodeOutputs: true, executionPlan: true, currentWave: true, parentExecutionId: true, parentNodeName: true, definitionsCommitId: true, tickCount: true, completedAt: true, maxTicks: true, maxPendingJobs: true, timeoutAt: true, errorCode: true, errorMessage: true } }).execute(); + +// Create +const created = await db.functionGraphExecution.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', entityId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionGraphExecution.update({ where: { id: '' }, data: { startedAt: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionGraphExecution.delete({ where: { id: '' } }).execute(); +``` + +### `db.functionDefinition` + +CRUD operations for FunctionDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `scope` | String | Yes | +| `name` | String | Yes | +| `taskIdentifier` | String | Yes | +| `description` | String | Yes | +| `isInvocable` | Boolean | Yes | +| `maxAttempts` | Int | Yes | +| `priority` | Int | Yes | +| `queueName` | String | Yes | +| `runtime` | String | Yes | +| `image` | String | Yes | +| `concurrency` | Int | Yes | +| `scaleMin` | Int | Yes | +| `scaleMax` | Int | Yes | +| `timeoutSeconds` | Int | Yes | +| `resources` | JSON | Yes | +| `isBuiltIn` | Boolean | Yes | +| `requiredSecrets` | FunctionRequirement | Yes | +| `requiredConfigs` | FunctionRequirement | Yes | +| `requiredBuckets` | String | Yes | +| `requiredModels` | String | Yes | +| `inputs` | JSON | Yes | +| `outputs` | JSON | Yes | +| `props` | JSON | Yes | +| `volatile` | Boolean | Yes | +| `icon` | String | Yes | +| `category` | String | Yes | + +**Operations:** + +```typescript +// List all functionDefinition records +const items = await db.functionDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }).execute(); + +// Get one by id +const item = await db.functionDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, scope: true, name: true, taskIdentifier: true, description: true, isInvocable: true, maxAttempts: true, priority: true, queueName: true, runtime: true, image: true, concurrency: true, scaleMin: true, scaleMax: true, timeoutSeconds: true, resources: true, isBuiltIn: true, requiredSecrets: true, requiredConfigs: true, requiredBuckets: true, requiredModels: true, inputs: true, outputs: true, props: true, volatile: true, icon: true, category: true } }).execute(); + +// Create +const created = await db.functionDefinition.create({ data: { scope: '', name: '', taskIdentifier: '', description: '', isInvocable: '', maxAttempts: '', priority: '', queueName: '', runtime: '', image: '', concurrency: '', scaleMin: '', scaleMax: '', timeoutSeconds: '', resources: '', isBuiltIn: '', requiredSecrets: '', requiredConfigs: '', requiredBuckets: '', requiredModels: '', inputs: '', outputs: '', props: '', volatile: '', icon: '', category: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDefinition.update({ where: { id: '' }, data: { scope: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDefinition.delete({ where: { id: '' } }).execute(); +``` + +## Custom Operations + +### `db.query.readFunctionGraph` + +readFunctionGraph + +- **Type:** query +- **Arguments:** + + | Argument | Type | + |----------|------| + | `graphId` | UUID | + +```typescript +const result = await db.query.readFunctionGraph({ graphId: '' }).execute(); +``` + +### `db.mutation.validateFunctionGraph` + +validateFunctionGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ValidateFunctionGraphInput (required) | + +```typescript +const result = await db.mutation.validateFunctionGraph({ input: { graphId: '' } }).execute(); +``` + +### `db.mutation.initEmptyRepo` + +initEmptyRepo + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InitEmptyRepoInput (required) | + +```typescript +const result = await db.mutation.initEmptyRepo({ input: { sId: '', storeId: '' } }).execute(); +``` + +### `db.mutation.setDataAtPath` + +setDataAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SetDataAtPathInput (required) | + +```typescript +const result = await db.mutation.setDataAtPath({ input: { sId: '', root: '', path: '', data: '' } }).execute(); +``` + +### `db.mutation.importDefinitions` + +importDefinitions + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportDefinitionsInput (required) | + +```typescript +const result = await db.mutation.importDefinitions({ input: { graphId: '', sourceScopeId: '', sourceCommitId: '', contexts: '' } }).execute(); +``` + +### `db.mutation.copyGraph` + +copyGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CopyGraphInput (required) | + +```typescript +const result = await db.mutation.copyGraph({ input: { databaseId: '', graphId: '', name: '' } }).execute(); +``` + +### `db.mutation.saveGraph` + +saveGraph + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | SaveGraphInput (required) | + +```typescript +const result = await db.mutation.saveGraph({ input: { graphId: '', rootHash: '', message: '' } }).execute(); +``` + +### `db.mutation.addEdgeAndSave` + +addEdgeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeAndSaveInput (required) | + +```typescript +const result = await db.mutation.addEdgeAndSave({ input: '' }).execute(); +``` + +### `db.mutation.addNodeAndSave` + +addNodeAndSave + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeAndSaveInput (required) | + +```typescript +const result = await db.mutation.addNodeAndSave({ input: '' }).execute(); +``` + +### `db.mutation.addEdge` + +addEdge + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddEdgeInput (required) | + +```typescript +const result = await db.mutation.addEdge({ input: '' }).execute(); +``` + +### `db.mutation.addNode` + +addNode + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | AddNodeInput (required) | + +```typescript +const result = await db.mutation.addNode({ input: '' }).execute(); +``` + +### `db.mutation.importGraphJson` + +importGraphJson + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ImportGraphJsonInput (required) | + +```typescript +const result = await db.mutation.importGraphJson({ input: '' }).execute(); +``` + +### `db.mutation.insertNodeAtPath` + +insertNodeAtPath + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | InsertNodeAtPathInput (required) | + +```typescript +const result = await db.mutation.insertNodeAtPath({ input: '' }).execute(); +``` + +### `db.mutation.startExecution` + +startExecution + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | StartExecutionInput (required) | + +```typescript +const result = await db.mutation.startExecution({ input: '' }).execute(); +``` + +### `db.mutation.provisionBucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-sdk/src/compute/orm/client.ts b/sdk/constructive-sdk/src/compute/orm/client.ts new file mode 100644 index 0000000000..16e683c712 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/client.ts @@ -0,0 +1,244 @@ +/** + * ORM Client - Runtime GraphQL executor + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; +import { createFetch } from '@constructive-io/graphql-query/runtime'; + +import type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + Unsubscribe, +} from './realtime'; +import { RealtimeManager } from './realtime'; + +export type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; + +export type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + SubscriptionOperation, + Unsubscribe, + WsClient, +} from './realtime'; +export { RealtimeManager } from './realtime'; + +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +export class FetchAdapter implements GraphQLAdapter { + private headers: Record; + private fetchFn: typeof globalThis.fetch; + + constructor( + private endpoint: string, + headers?: Record, + fetchFn?: typeof globalThis.fetch + ) { + this.headers = headers ?? {}; + this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); + } + + async execute(document: string, variables?: Record): Promise> { + const response = await this.fetchFn(this.endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + ...this.headers, + }, + body: JSON.stringify({ + query: document, + variables: variables ?? {}, + }), + }); + + if (!response.ok) { + return { + ok: false, + data: null, + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], + }; + } + + const json = (await response.json()) as { + data?: T; + errors?: GraphQLError[]; + }; + + if (json.errors && json.errors.length > 0) { + return { + ok: false, + data: null, + errors: json.errors, + }; + } + + return { + ok: true, + data: json.data as T, + errors: undefined, + }; + } + + setHeaders(headers: Record): void { + this.headers = { ...this.headers, ...headers }; + } + + getEndpoint(): string { + return this.endpoint; + } +} + +/** + * Configuration for creating an ORM client. + * Either provide endpoint (and optional headers/fetch) for HTTP requests, + * or provide a custom adapter for alternative execution strategies. + */ +export interface OrmClientConfig { + /** GraphQL endpoint URL (required if adapter not provided) */ + endpoint?: string; + /** Default headers for HTTP requests (only used with endpoint) */ + headers?: Record; + /** + * Custom fetch implementation. Defaults to createFetch() from + * @constructive-io/graphql-query/runtime which handles *.localhost + * DNS and Host headers in Node.js. Pass your own for test mocking + * or custom proxy/credentials. + */ + fetch?: typeof globalThis.fetch; + /** Custom adapter for GraphQL execution (overrides endpoint/headers/fetch) */ + adapter?: GraphQLAdapter; + /** + * Optional realtime (WebSocket) configuration. + * When provided, enables subscription methods on models. + * The WebSocket connection is created lazily on first subscribe(). + */ + realtime?: RealtimeConfig; +} + +/** + * Error thrown when GraphQL request fails + */ +export class GraphQLRequestError extends Error { + constructor( + public readonly errors: GraphQLError[], + public readonly data: unknown = null + ) { + const messages = errors.map((e) => e.message).join('; '); + super(`GraphQL Error: ${messages}`); + this.name = 'GraphQLRequestError'; + } +} + +export class OrmClient { + private adapter: GraphQLAdapter; + private realtimeManager?: RealtimeManager; + + constructor(config: OrmClientConfig) { + if (config.adapter) { + this.adapter = config.adapter; + } else if (config.endpoint) { + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); + } else { + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); + } + + if (config.realtime) { + this.realtimeManager = new RealtimeManager(config.realtime); + } + } + + async execute(document: string, variables?: Record): Promise> { + return this.adapter.execute(document, variables); + } + + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + if (!this.realtimeManager) { + throw new Error( + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' + ); + } + return this.realtimeManager.subscribe(meta, document, variables, options); + } + + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers: Record): void { + if (this.adapter.setHeaders) { + this.adapter.setHeaders(headers); + } + } + + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint(): string { + return this.adapter.getEndpoint?.() ?? ''; + } + + /** Get current WebSocket connection state */ + getConnectionState(): ConnectionState { + return this.realtimeManager?.getConnectionState() ?? 'disconnected'; + } + + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + if (!this.realtimeManager) return () => {}; + return this.realtimeManager.onConnectionStateChange(listener); + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.realtimeManager?.getActiveSubscriptionCount() ?? 0; + } + + /** Whether realtime is configured */ + get isRealtimeEnabled(): boolean { + return this.realtimeManager !== undefined; + } + + /** Dispose the realtime manager (close WebSocket) */ + dispose(): void { + this.realtimeManager?.dispose(); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/index.ts b/sdk/constructive-sdk/src/compute/orm/index.ts new file mode 100644 index 0000000000..99193c1d28 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/index.ts @@ -0,0 +1,82 @@ +/** + * ORM Client - createClient factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { GetAllRecordModel } from './models/getAllRecord'; +import { FunctionApiBindingModel } from './models/functionApiBinding'; +import { FunctionDeploymentModel } from './models/functionDeployment'; +import { FunctionGraphRefModel } from './models/functionGraphRef'; +import { FunctionGraphStoreModel } from './models/functionGraphStore'; +import { FunctionGraphObjectModel } from './models/functionGraphObject'; +import { FunctionDeploymentEventModel } from './models/functionDeploymentEvent'; +import { OrgFunctionExecutionLogModel } from './models/orgFunctionExecutionLog'; +import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecutionOutput'; +import { FunctionGraphCommitModel } from './models/functionGraphCommit'; +import { SecretDefinitionModel } from './models/secretDefinition'; +import { FunctionExecutionLogModel } from './models/functionExecutionLog'; +import { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; +import { FunctionGraphModel } from './models/functionGraph'; +import { OrgFunctionInvocationModel } from './models/orgFunctionInvocation'; +import { FunctionInvocationModel } from './models/functionInvocation'; +import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; +import { FunctionDefinitionModel } from './models/functionDefinition'; +import { createQueryOperations } from './query'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createQueryOperations } from './query'; +export { createMutationOperations } from './mutation'; +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +export function createClient(config: OrmClientConfig) { + const client = new OrmClient(config); + return { + getAllRecord: new GetAllRecordModel(client), + functionApiBinding: new FunctionApiBindingModel(client), + functionDeployment: new FunctionDeploymentModel(client), + functionGraphRef: new FunctionGraphRefModel(client), + functionGraphStore: new FunctionGraphStoreModel(client), + functionGraphObject: new FunctionGraphObjectModel(client), + functionDeploymentEvent: new FunctionDeploymentEventModel(client), + orgFunctionExecutionLog: new OrgFunctionExecutionLogModel(client), + functionGraphExecutionOutput: new FunctionGraphExecutionOutputModel(client), + functionGraphCommit: new FunctionGraphCommitModel(client), + secretDefinition: new SecretDefinitionModel(client), + functionExecutionLog: new FunctionExecutionLogModel(client), + functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), + functionGraph: new FunctionGraphModel(client), + orgFunctionInvocation: new OrgFunctionInvocationModel(client), + functionInvocation: new FunctionInvocationModel(client), + functionGraphExecution: new FunctionGraphExecutionModel(client), + functionDefinition: new FunctionDefinitionModel(client), + query: createQueryOperations(client), + mutation: createMutationOperations(client), + }; +} diff --git a/sdk/constructive-sdk/src/compute/orm/input-types.ts b/sdk/constructive-sdk/src/compute/orm/input-types.ts new file mode 100644 index 0000000000..f88c3e77d1 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/input-types.ts @@ -0,0 +1,4706 @@ +/** + * GraphQL types for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// ============ Scalar Filter Types ============ +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: Record; + containedBy?: Record; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containsOrEqualTo?: string; + containedBy?: string; + containedByOrEqualTo?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +// ============ Custom Scalar Types ============ +export type Base64EncodedBinary = unknown; +export type FunctionRequirement = unknown; +// ============ Entity Types ============ +export interface GetAllRecord { + path?: string[] | null; + data?: Record | null; +} +/** Join table binding function definitions to API endpoints with per-binding alias and config */ +export interface FunctionApiBinding { + id: string; + /** Function definition this binding belongs to */ + functionDefinitionId?: string | null; + /** API endpoint this function is bound to */ + apiId?: string | null; + /** Binding alias (e.g. default, staging, production) */ + alias?: string | null; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: Record | null; +} +/** Function deployment bindings — ties a function definition to a namespace for Knative provisioning and routing */ +export interface FunctionDeployment { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Function definition being deployed to this namespace */ + functionDefinitionId?: string | null; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId?: string | null; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string | null; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string | null; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string | null; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number | null; + /** Container image override (NULL = inherit from function definition) */ + image?: string | null; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number | null; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number | null; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number | null; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number | null; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: Record | null; + /** Most recent provisioning or runtime error message */ + lastError?: string | null; + /** Timestamp of the most recent error */ + lastErrorAt?: string | null; + /** Cumulative error count for this deployment */ + errorCount?: number | null; + /** Key/value pairs for selecting and filtering deployments */ + labels?: Record | null; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Branch heads — mutable pointers into the commit chain */ +export interface FunctionGraphRef { + /** Unique ref identifier */ + id: string; + /** Ref name (e.g. HEAD, main) */ + name?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Store this ref belongs to */ + storeId?: string | null; + /** Commit this ref points to */ + commitId?: string | null; +} +/** Named stores — one per version-controlled tree (e.g. one graph, one definition set) */ +export interface FunctionGraphStore { + /** Unique store identifier */ + id: string; + /** Human-readable store name */ + name?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Current root object hash of this store */ + hash?: string | null; + /** Timestamp of store creation */ + createdAt?: string | null; +} +/** Content-addressed Merkle tree objects keyed by UUID v5 hash of data + children */ +export interface FunctionGraphObject { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Ordered array of child object IDs */ + kids?: string[] | null; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[] | null; + /** Payload data for this object node */ + data?: Record | null; + /** Timestamp of object creation */ + createdAt?: string | null; +} +/** Deployment lifecycle events — audit log of provisioning, scaling, and failure events */ +export interface FunctionDeploymentEvent { + /** Event timestamp (partition key) */ + createdAt?: string | null; + /** Unique event identifier */ + id: string; + /** Deployment this event belongs to */ + deploymentId?: string | null; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType?: string | null; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string | null; + /** Human-readable description of the event */ + message?: string | null; + /** Structured context (old/new values, error details, etc.) */ + metadata?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Function execution logs — structured console output per invocation */ +export interface OrgFunctionExecutionLog { + /** Log entry timestamp (partition key) */ + createdAt?: string | null; + /** Unique log entry identifier */ + id: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string | null; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string | null; + /** Log severity: debug, info, warn, error */ + logLevel?: string | null; + /** Log message text */ + message?: string | null; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record | null; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string | null; +} +/** Content-addressed store for execution outputs — hash-referenced from node_outputs */ +export interface FunctionGraphExecutionOutput { + /** Timestamp of output creation */ + createdAt?: string | null; + /** Unique execution output identifier */ + id: string; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash?: Base64EncodedBinary | null; + /** The actual output payload from a completed node */ + data?: Record | null; +} +/** Commit history — each commit snapshots a tree root for a store */ +export interface FunctionGraphCommit { + /** Unique commit identifier */ + id: string; + /** Optional commit message */ + message?: string | null; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Store this commit belongs to */ + storeId?: string | null; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[] | null; + /** User who authored the changes */ + authorId?: string | null; + /** User who committed (may differ from author) */ + committerId?: string | null; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string | null; + /** Commit timestamp */ + date?: string | null; +} +/** Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. */ +export interface SecretDefinition { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Secret name (must match app_secrets.name for resolution) */ + name?: string | null; + /** Human-readable description of what this secret is used for */ + description?: string | null; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean | null; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: Record | null; + /** Freeform metadata annotations for secret definitions */ + annotations?: Record | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Function execution logs — structured console output per invocation */ +export interface FunctionExecutionLog { + /** Log entry timestamp (partition key) */ + createdAt?: string | null; + /** Unique log entry identifier */ + id: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string | null; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string | null; + /** Log severity: debug, info, warn, error */ + logLevel?: string | null; + /** Log message text */ + message?: string | null; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record | null; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; +} +/** Per-node execution state — tracks individual node lifecycle for debugging */ +export interface FunctionGraphExecutionNodeState { + /** Timestamp of node state creation (partition key) */ + createdAt?: string | null; + /** Unique node state identifier */ + id: string; + /** FK to the parent graph execution */ + executionId?: string | null; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName?: string | null; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[] | null; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string | null; + /** Timestamp when the node began executing */ + startedAt?: string | null; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string | null; + /** Machine-readable error code when status = failed */ + errorCode?: string | null; + /** Human-readable error description when status = failed */ + errorMessage?: string | null; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string | null; +} +/** Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store */ +export interface FunctionGraph { + /** Unique graph identifier */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId?: string | null; + /** Graph store (Merkle store) holding the graph definition */ + storeId?: string | null; + /** Entity context (org/team) for scoped billing */ + entityId?: string | null; + /** Evaluator/runtime context (function, js, sql, system) */ + context?: string | null; + /** Graph name (unique per database) */ + name?: string | null; + /** Human-readable description of the graph */ + description?: string | null; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string | null; + /** Whether graph passes structural validation */ + isValid?: boolean | null; + /** Array of validation error objects when is_valid = false */ + validationErrors?: Record | null; + /** Actor who created this graph */ + createdBy?: string | null; + /** Timestamp of graph creation */ + createdAt?: string | null; + /** Timestamp of last modification */ + updatedAt?: string | null; +} +/** Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. */ +export interface OrgFunctionInvocation { + /** Invocation creation timestamp (partition key) */ + createdAt?: string | null; + /** Unique invocation identifier */ + id: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string | null; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string | null; + /** Function input payload */ + payload?: Record | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Function return value (success) or structured error (failure) */ + result?: Record | null; + /** Error message when status is failed */ + error?: string | null; + /** Wall-clock execution time in milliseconds */ + durationMs?: number | null; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string | null; + /** When execution started */ + startedAt?: string | null; + /** When execution completed */ + completedAt?: string | null; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string | null; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string | null; +} +/** Function invocation log — INSERT to call a function (business-layer, metered). Linked to definitions by task_identifier string. */ +export interface FunctionInvocation { + /** Invocation creation timestamp (partition key) */ + createdAt?: string | null; + /** Unique invocation identifier */ + id: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier?: string | null; + /** Function input payload */ + payload?: Record | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Function return value (success) or structured error (failure) */ + result?: Record | null; + /** Error message when status is failed */ + error?: string | null; + /** Wall-clock execution time in milliseconds */ + durationMs?: number | null; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string | null; + /** When execution started */ + startedAt?: string | null; + /** When execution completed */ + completedAt?: string | null; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string | null; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string | null; +} +/** Ephemeral execution state for flow graph evaluation */ +export interface FunctionGraphExecution { + /** Execution start timestamp */ + startedAt?: string | null; + /** Unique execution identifier */ + id: string; + /** FK to the graph definition being executed */ + graphId?: string | null; + /** Parent function_invocations row (for metering) */ + invocationId?: string | null; + /** Scope for multi-tenant isolation */ + databaseId?: string | null; + /** Entity context (org/team) for scoped billing */ + entityId?: string | null; + /** Target output boundary node name to resolve */ + outputNode?: string | null; + /** Target output port name (default: value) */ + outputPort?: string | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Initial inputs provided at invocation time */ + inputPayload?: Record | null; + /** Final result extracted from terminal output node */ + outputPayload?: Record | null; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: Record | null; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: Record | null; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number | null; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string | null; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string | null; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string | null; + /** Number of evaluate_step ticks executed */ + tickCount?: number | null; + /** Execution completion timestamp */ + completedAt?: string | null; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number | null; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number | null; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string | null; + /** Machine-readable error code when status = failed */ + errorCode?: string | null; + /** Human-readable error description when status = failed */ + errorMessage?: string | null; +} +/** Function definitions — registered cloud functions with routing, queue, and retry configuration */ +export interface FunctionDefinition { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope?: string | null; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name?: string | null; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier?: string | null; + /** Human-readable description of what this function does */ + description?: string | null; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean | null; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number | null; + /** Job priority (lower = higher priority) */ + priority?: number | null; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string | null; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string | null; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string | null; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number | null; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number | null; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number | null; + /** Knative request timeout in seconds */ + timeoutSeconds?: number | null; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: Record | null; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean | null; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirement[] | null; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirement[] | null; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[] | null; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[] | null; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: Record | null; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: Record | null; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: Record | null; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean | null; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string | null; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string | null; +} +// ============ Relation Helper Types ============ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +// ============ Entity Relation Types ============ +export interface GetAllRecordRelations {} +export interface FunctionApiBindingRelations { + functionDefinition?: FunctionDefinition | null; +} +export interface FunctionDeploymentRelations { + functionDefinition?: FunctionDefinition | null; +} +export interface FunctionGraphRefRelations {} +export interface FunctionGraphStoreRelations {} +export interface FunctionGraphObjectRelations {} +export interface FunctionDeploymentEventRelations {} +export interface OrgFunctionExecutionLogRelations {} +export interface FunctionGraphExecutionOutputRelations {} +export interface FunctionGraphCommitRelations {} +export interface SecretDefinitionRelations {} +export interface FunctionExecutionLogRelations {} +export interface FunctionGraphExecutionNodeStateRelations {} +export interface FunctionGraphRelations {} +export interface OrgFunctionInvocationRelations {} +export interface FunctionInvocationRelations {} +export interface FunctionGraphExecutionRelations { + graph?: FunctionGraph | null; +} +export interface FunctionDefinitionRelations { + functionApiBindings?: ConnectionResult; + functionDeployments?: ConnectionResult; +} +// ============ Entity Types With Relations ============ +export type GetAllRecordWithRelations = GetAllRecord & GetAllRecordRelations; +export type FunctionApiBindingWithRelations = FunctionApiBinding & FunctionApiBindingRelations; +export type FunctionDeploymentWithRelations = FunctionDeployment & FunctionDeploymentRelations; +export type FunctionGraphRefWithRelations = FunctionGraphRef & FunctionGraphRefRelations; +export type FunctionGraphStoreWithRelations = FunctionGraphStore & FunctionGraphStoreRelations; +export type FunctionGraphObjectWithRelations = FunctionGraphObject & FunctionGraphObjectRelations; +export type FunctionDeploymentEventWithRelations = FunctionDeploymentEvent & + FunctionDeploymentEventRelations; +export type OrgFunctionExecutionLogWithRelations = OrgFunctionExecutionLog & + OrgFunctionExecutionLogRelations; +export type FunctionGraphExecutionOutputWithRelations = FunctionGraphExecutionOutput & + FunctionGraphExecutionOutputRelations; +export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGraphCommitRelations; +export type SecretDefinitionWithRelations = SecretDefinition & SecretDefinitionRelations; +export type FunctionExecutionLogWithRelations = FunctionExecutionLog & + FunctionExecutionLogRelations; +export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & + FunctionGraphExecutionNodeStateRelations; +export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; +export type OrgFunctionInvocationWithRelations = OrgFunctionInvocation & + OrgFunctionInvocationRelations; +export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; +export type FunctionGraphExecutionWithRelations = FunctionGraphExecution & + FunctionGraphExecutionRelations; +export type FunctionDefinitionWithRelations = FunctionDefinition & FunctionDefinitionRelations; +// ============ Entity Select Types ============ +export type GetAllRecordSelect = { + path?: boolean; + data?: boolean; +}; +export type FunctionApiBindingSelect = { + id?: boolean; + functionDefinitionId?: boolean; + apiId?: boolean; + alias?: boolean; + config?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; +}; +export type FunctionDeploymentSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + functionDefinitionId?: boolean; + namespaceId?: boolean; + status?: boolean; + serviceUrl?: boolean; + serviceName?: boolean; + revision?: boolean; + image?: boolean; + concurrency?: boolean; + scaleMin?: boolean; + scaleMax?: boolean; + timeoutSeconds?: boolean; + resources?: boolean; + lastError?: boolean; + lastErrorAt?: boolean; + errorCount?: boolean; + labels?: boolean; + annotations?: boolean; + databaseId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; +}; +export type FunctionGraphRefSelect = { + id?: boolean; + name?: boolean; + databaseId?: boolean; + storeId?: boolean; + commitId?: boolean; +}; +export type FunctionGraphStoreSelect = { + id?: boolean; + name?: boolean; + databaseId?: boolean; + hash?: boolean; + createdAt?: boolean; +}; +export type FunctionGraphObjectSelect = { + id?: boolean; + databaseId?: boolean; + kids?: boolean; + ktree?: boolean; + data?: boolean; + createdAt?: boolean; +}; +export type FunctionDeploymentEventSelect = { + createdAt?: boolean; + id?: boolean; + deploymentId?: boolean; + eventType?: boolean; + actorId?: boolean; + message?: boolean; + metadata?: boolean; + databaseId?: boolean; +}; +export type OrgFunctionExecutionLogSelect = { + createdAt?: boolean; + id?: boolean; + invocationId?: boolean; + taskIdentifier?: boolean; + logLevel?: boolean; + message?: boolean; + metadata?: boolean; + actorId?: boolean; +}; +export type FunctionGraphExecutionOutputSelect = { + createdAt?: boolean; + id?: boolean; + databaseId?: boolean; + hash?: boolean; + data?: boolean; +}; +export type FunctionGraphCommitSelect = { + id?: boolean; + message?: boolean; + databaseId?: boolean; + storeId?: boolean; + parentIds?: boolean; + authorId?: boolean; + committerId?: boolean; + treeId?: boolean; + date?: boolean; +}; +export type SecretDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + name?: boolean; + description?: boolean; + isBuiltIn?: boolean; + labels?: boolean; + annotations?: boolean; + databaseId?: boolean; +}; +export type FunctionExecutionLogSelect = { + createdAt?: boolean; + id?: boolean; + invocationId?: boolean; + taskIdentifier?: boolean; + logLevel?: boolean; + message?: boolean; + metadata?: boolean; + actorId?: boolean; + databaseId?: boolean; +}; +export type FunctionGraphExecutionNodeStateSelect = { + createdAt?: boolean; + id?: boolean; + executionId?: boolean; + databaseId?: boolean; + nodeName?: boolean; + nodePath?: boolean; + status?: boolean; + startedAt?: boolean; + completedAt?: boolean; + errorCode?: boolean; + errorMessage?: boolean; + outputId?: boolean; +}; +export type FunctionGraphSelect = { + id?: boolean; + databaseId?: boolean; + storeId?: boolean; + entityId?: boolean; + context?: boolean; + name?: boolean; + description?: boolean; + definitionsCommitId?: boolean; + isValid?: boolean; + validationErrors?: boolean; + createdBy?: boolean; + createdAt?: boolean; + updatedAt?: boolean; +}; +export type OrgFunctionInvocationSelect = { + createdAt?: boolean; + id?: boolean; + actorId?: boolean; + taskIdentifier?: boolean; + payload?: boolean; + status?: boolean; + result?: boolean; + error?: boolean; + durationMs?: boolean; + jobId?: boolean; + startedAt?: boolean; + completedAt?: boolean; + parentInvocationId?: boolean; + graphExecutionId?: boolean; +}; +export type FunctionInvocationSelect = { + createdAt?: boolean; + id?: boolean; + actorId?: boolean; + databaseId?: boolean; + taskIdentifier?: boolean; + payload?: boolean; + status?: boolean; + result?: boolean; + error?: boolean; + durationMs?: boolean; + jobId?: boolean; + startedAt?: boolean; + completedAt?: boolean; + parentInvocationId?: boolean; + graphExecutionId?: boolean; +}; +export type FunctionGraphExecutionSelect = { + startedAt?: boolean; + id?: boolean; + graphId?: boolean; + invocationId?: boolean; + databaseId?: boolean; + entityId?: boolean; + outputNode?: boolean; + outputPort?: boolean; + status?: boolean; + inputPayload?: boolean; + outputPayload?: boolean; + nodeOutputs?: boolean; + executionPlan?: boolean; + currentWave?: boolean; + parentExecutionId?: boolean; + parentNodeName?: boolean; + definitionsCommitId?: boolean; + tickCount?: boolean; + completedAt?: boolean; + maxTicks?: boolean; + maxPendingJobs?: boolean; + timeoutAt?: boolean; + errorCode?: boolean; + errorMessage?: boolean; + graph?: { + select: FunctionGraphSelect; + }; +}; +export type FunctionDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + scope?: boolean; + name?: boolean; + taskIdentifier?: boolean; + description?: boolean; + isInvocable?: boolean; + maxAttempts?: boolean; + priority?: boolean; + queueName?: boolean; + runtime?: boolean; + image?: boolean; + concurrency?: boolean; + scaleMin?: boolean; + scaleMax?: boolean; + timeoutSeconds?: boolean; + resources?: boolean; + isBuiltIn?: boolean; + requiredSecrets?: boolean; + requiredConfigs?: boolean; + requiredBuckets?: boolean; + requiredModels?: boolean; + inputs?: boolean; + outputs?: boolean; + props?: boolean; + volatile?: boolean; + icon?: boolean; + category?: boolean; + functionApiBindings?: { + select: FunctionApiBindingSelect; + first?: number; + filter?: FunctionApiBindingFilter; + orderBy?: FunctionApiBindingOrderBy[]; + }; + functionDeployments?: { + select: FunctionDeploymentSelect; + first?: number; + filter?: FunctionDeploymentFilter; + orderBy?: FunctionDeploymentOrderBy[]; + }; +}; +// ============ Table Filter Types ============ +export interface GetAllRecordFilter { + path?: StringListFilter; + data?: JSONFilter; + and?: GetAllRecordFilter[]; + or?: GetAllRecordFilter[]; + not?: GetAllRecordFilter; +} +export interface FunctionApiBindingFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `apiId` field. */ + apiId?: UUIDFilter; + /** Filter by the object’s `alias` field. */ + alias?: StringFilter; + /** Filter by the object’s `config` field. */ + config?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionApiBindingFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionApiBindingFilter[]; + /** Negates the expression. */ + not?: FunctionApiBindingFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +export interface FunctionDeploymentFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `serviceName` field. */ + serviceName?: StringFilter; + /** Filter by the object’s `revision` field. */ + revision?: IntFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `lastError` field. */ + lastError?: StringFilter; + /** Filter by the object’s `lastErrorAt` field. */ + lastErrorAt?: DatetimeFilter; + /** Filter by the object’s `errorCount` field. */ + errorCount?: IntFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +export interface FunctionGraphRefFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `commitId` field. */ + commitId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphRefFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphRefFilter[]; + /** Negates the expression. */ + not?: FunctionGraphRefFilter; +} +export interface FunctionGraphStoreFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphStoreFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphStoreFilter[]; + /** Negates the expression. */ + not?: FunctionGraphStoreFilter; +} +export interface FunctionGraphObjectFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `kids` field. */ + kids?: UUIDListFilter; + /** Filter by the object’s `ktree` field. */ + ktree?: StringListFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphObjectFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphObjectFilter[]; + /** Negates the expression. */ + not?: FunctionGraphObjectFilter; +} +export interface FunctionDeploymentEventFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `deploymentId` field. */ + deploymentId?: UUIDFilter; + /** Filter by the object’s `eventType` field. */ + eventType?: StringFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentEventFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentEventFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentEventFilter; +} +export interface OrgFunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: OrgFunctionExecutionLogFilter; +} +export interface FunctionGraphExecutionOutputFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `hash` field. */ + hash?: Base64EncodedBinaryFilter; + /** Filter by the object’s `data` field. */ + data?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionOutputFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionOutputFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionOutputFilter; +} +export interface FunctionGraphCommitFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `parentIds` field. */ + parentIds?: UUIDListFilter; + /** Filter by the object’s `authorId` field. */ + authorId?: UUIDFilter; + /** Filter by the object’s `committerId` field. */ + committerId?: UUIDFilter; + /** Filter by the object’s `treeId` field. */ + treeId?: UUIDFilter; + /** Filter by the object’s `date` field. */ + date?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphCommitFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphCommitFilter[]; + /** Negates the expression. */ + not?: FunctionGraphCommitFilter; +} +export interface SecretDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: SecretDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: SecretDefinitionFilter[]; + /** Negates the expression. */ + not?: SecretDefinitionFilter; +} +export interface FunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: FunctionExecutionLogFilter; +} +export interface FunctionGraphExecutionNodeStateFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `executionId` field. */ + executionId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `nodeName` field. */ + nodeName?: StringFilter; + /** Filter by the object’s `nodePath` field. */ + nodePath?: StringListFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Filter by the object’s `outputId` field. */ + outputId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionNodeStateFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionNodeStateFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionNodeStateFilter; +} +export interface FunctionGraphFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `storeId` field. */ + storeId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `context` field. */ + context?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `isValid` field. */ + isValid?: BooleanFilter; + /** Filter by the object’s `validationErrors` field. */ + validationErrors?: JSONFilter; + /** Filter by the object’s `createdBy` field. */ + createdBy?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphFilter[]; + /** Negates the expression. */ + not?: FunctionGraphFilter; +} +export interface OrgFunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: OrgFunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgFunctionInvocationFilter[]; + /** Negates the expression. */ + not?: OrgFunctionInvocationFilter; +} +export interface FunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `parentInvocationId` field. */ + parentInvocationId?: UUIDFilter; + /** Filter by the object’s `graphExecutionId` field. */ + graphExecutionId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionInvocationFilter[]; + /** Negates the expression. */ + not?: FunctionInvocationFilter; +} +export interface FunctionGraphExecutionFilter { + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `graphId` field. */ + graphId?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `outputNode` field. */ + outputNode?: StringFilter; + /** Filter by the object’s `outputPort` field. */ + outputPort?: StringFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `inputPayload` field. */ + inputPayload?: JSONFilter; + /** Filter by the object’s `outputPayload` field. */ + outputPayload?: JSONFilter; + /** Filter by the object’s `nodeOutputs` field. */ + nodeOutputs?: JSONFilter; + /** Filter by the object’s `executionPlan` field. */ + executionPlan?: JSONFilter; + /** Filter by the object’s `currentWave` field. */ + currentWave?: IntFilter; + /** Filter by the object’s `parentExecutionId` field. */ + parentExecutionId?: UUIDFilter; + /** Filter by the object’s `parentNodeName` field. */ + parentNodeName?: StringFilter; + /** Filter by the object’s `definitionsCommitId` field. */ + definitionsCommitId?: UUIDFilter; + /** Filter by the object’s `tickCount` field. */ + tickCount?: IntFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `maxTicks` field. */ + maxTicks?: IntFilter; + /** Filter by the object’s `maxPendingJobs` field. */ + maxPendingJobs?: IntFilter; + /** Filter by the object’s `timeoutAt` field. */ + timeoutAt?: DatetimeFilter; + /** Filter by the object’s `errorCode` field. */ + errorCode?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionGraphExecutionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionGraphExecutionFilter[]; + /** Negates the expression. */ + not?: FunctionGraphExecutionFilter; + /** Filter by the object’s `graph` relation. */ + graph?: FunctionGraphFilter; +} +export interface FunctionDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `runtime` field. */ + runtime?: StringFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `requiredBuckets` field. */ + requiredBuckets?: StringListFilter; + /** Filter by the object’s `requiredModels` field. */ + requiredModels?: StringListFilter; + /** Filter by the object’s `inputs` field. */ + inputs?: JSONFilter; + /** Filter by the object’s `outputs` field. */ + outputs?: JSONFilter; + /** Filter by the object’s `props` field. */ + props?: JSONFilter; + /** Filter by the object’s `volatile` field. */ + volatile?: BooleanFilter; + /** Filter by the object’s `icon` field. */ + icon?: StringFilter; + /** Filter by the object’s `category` field. */ + category?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: FunctionDefinitionFilter; + /** Filter by the object’s `functionApiBindings` relation. */ + functionApiBindings?: FunctionDefinitionToManyFunctionApiBindingFilter; + /** `functionApiBindings` exist. */ + functionApiBindingsExist?: boolean; + /** Filter by the object’s `functionDeployments` relation. */ + functionDeployments?: FunctionDefinitionToManyFunctionDeploymentFilter; + /** `functionDeployments` exist. */ + functionDeploymentsExist?: boolean; +} +// ============ OrderBy Types ============ +export type GetAllRecordsOrderBy = + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'NATURAL' + | 'PATH_ASC' + | 'PATH_DESC' + | 'DATA_ASC' + | 'DATA_DESC'; +export type FunctionApiBindingOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'API_ID_ASC' + | 'API_ID_DESC' + | 'ALIAS_ASC' + | 'ALIAS_DESC' + | 'CONFIG_ASC' + | 'CONFIG_DESC'; +export type FunctionDeploymentOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'FUNCTION_DEFINITION_ID_ASC' + | 'FUNCTION_DEFINITION_ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'SERVICE_URL_ASC' + | 'SERVICE_URL_DESC' + | 'SERVICE_NAME_ASC' + | 'SERVICE_NAME_DESC' + | 'REVISION_ASC' + | 'REVISION_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'LAST_ERROR_ASC' + | 'LAST_ERROR_DESC' + | 'LAST_ERROR_AT_ASC' + | 'LAST_ERROR_AT_DESC' + | 'ERROR_COUNT_ASC' + | 'ERROR_COUNT_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionGraphRefOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'COMMIT_ID_ASC' + | 'COMMIT_ID_DESC'; +export type FunctionGraphStoreOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +export type FunctionGraphObjectOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'KIDS_ASC' + | 'KIDS_DESC' + | 'KTREE_ASC' + | 'KTREE_DESC' + | 'DATA_ASC' + | 'DATA_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; +export type FunctionDeploymentEventOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DEPLOYMENT_ID_ASC' + | 'DEPLOYMENT_ID_DESC' + | 'EVENT_TYPE_ASC' + | 'EVENT_TYPE_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type OrgFunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC'; +export type FunctionGraphExecutionOutputOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'HASH_ASC' + | 'HASH_DESC' + | 'DATA_ASC' + | 'DATA_DESC'; +export type FunctionGraphCommitOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'PARENT_IDS_ASC' + | 'PARENT_IDS_DESC' + | 'AUTHOR_ID_ASC' + | 'AUTHOR_ID_DESC' + | 'COMMITTER_ID_ASC' + | 'COMMITTER_ID_DESC' + | 'TREE_ID_ASC' + | 'TREE_ID_DESC' + | 'DATE_ASC' + | 'DATE_DESC'; +export type SecretDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionExecutionLogOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'LOG_LEVEL_ASC' + | 'LOG_LEVEL_DESC' + | 'MESSAGE_ASC' + | 'MESSAGE_DESC' + | 'METADATA_ASC' + | 'METADATA_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC'; +export type FunctionGraphExecutionNodeStateOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'EXECUTION_ID_ASC' + | 'EXECUTION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'NODE_NAME_ASC' + | 'NODE_NAME_DESC' + | 'NODE_PATH_ASC' + | 'NODE_PATH_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'OUTPUT_ID_ASC' + | 'OUTPUT_ID_DESC'; +export type FunctionGraphOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'STORE_ID_ASC' + | 'STORE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'CONTEXT_ASC' + | 'CONTEXT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'IS_VALID_ASC' + | 'IS_VALID_DESC' + | 'VALIDATION_ERRORS_ASC' + | 'VALIDATION_ERRORS_DESC' + | 'CREATED_BY_ASC' + | 'CREATED_BY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; +export type OrgFunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +export type FunctionInvocationOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'ACTOR_ID_ASC' + | 'ACTOR_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'PAYLOAD_ASC' + | 'PAYLOAD_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'RESULT_ASC' + | 'RESULT_DESC' + | 'ERROR_ASC' + | 'ERROR_DESC' + | 'DURATION_MS_ASC' + | 'DURATION_MS_DESC' + | 'JOB_ID_ASC' + | 'JOB_ID_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'PARENT_INVOCATION_ID_ASC' + | 'PARENT_INVOCATION_ID_DESC' + | 'GRAPH_EXECUTION_ID_ASC' + | 'GRAPH_EXECUTION_ID_DESC'; +export type FunctionGraphExecutionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'STARTED_AT_ASC' + | 'STARTED_AT_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'GRAPH_ID_ASC' + | 'GRAPH_ID_DESC' + | 'INVOCATION_ID_ASC' + | 'INVOCATION_ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OUTPUT_NODE_ASC' + | 'OUTPUT_NODE_DESC' + | 'OUTPUT_PORT_ASC' + | 'OUTPUT_PORT_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'INPUT_PAYLOAD_ASC' + | 'INPUT_PAYLOAD_DESC' + | 'OUTPUT_PAYLOAD_ASC' + | 'OUTPUT_PAYLOAD_DESC' + | 'NODE_OUTPUTS_ASC' + | 'NODE_OUTPUTS_DESC' + | 'EXECUTION_PLAN_ASC' + | 'EXECUTION_PLAN_DESC' + | 'CURRENT_WAVE_ASC' + | 'CURRENT_WAVE_DESC' + | 'PARENT_EXECUTION_ID_ASC' + | 'PARENT_EXECUTION_ID_DESC' + | 'PARENT_NODE_NAME_ASC' + | 'PARENT_NODE_NAME_DESC' + | 'DEFINITIONS_COMMIT_ID_ASC' + | 'DEFINITIONS_COMMIT_ID_DESC' + | 'TICK_COUNT_ASC' + | 'TICK_COUNT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC' + | 'MAX_TICKS_ASC' + | 'MAX_TICKS_DESC' + | 'MAX_PENDING_JOBS_ASC' + | 'MAX_PENDING_JOBS_DESC' + | 'TIMEOUT_AT_ASC' + | 'TIMEOUT_AT_DESC' + | 'ERROR_CODE_ASC' + | 'ERROR_CODE_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC'; +export type FunctionDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'TASK_IDENTIFIER_ASC' + | 'TASK_IDENTIFIER_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'IS_INVOCABLE_ASC' + | 'IS_INVOCABLE_DESC' + | 'MAX_ATTEMPTS_ASC' + | 'MAX_ATTEMPTS_DESC' + | 'PRIORITY_ASC' + | 'PRIORITY_DESC' + | 'QUEUE_NAME_ASC' + | 'QUEUE_NAME_DESC' + | 'RUNTIME_ASC' + | 'RUNTIME_DESC' + | 'IMAGE_ASC' + | 'IMAGE_DESC' + | 'CONCURRENCY_ASC' + | 'CONCURRENCY_DESC' + | 'SCALE_MIN_ASC' + | 'SCALE_MIN_DESC' + | 'SCALE_MAX_ASC' + | 'SCALE_MAX_DESC' + | 'TIMEOUT_SECONDS_ASC' + | 'TIMEOUT_SECONDS_DESC' + | 'RESOURCES_ASC' + | 'RESOURCES_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'REQUIRED_SECRETS_ASC' + | 'REQUIRED_SECRETS_DESC' + | 'REQUIRED_CONFIGS_ASC' + | 'REQUIRED_CONFIGS_DESC' + | 'REQUIRED_BUCKETS_ASC' + | 'REQUIRED_BUCKETS_DESC' + | 'REQUIRED_MODELS_ASC' + | 'REQUIRED_MODELS_DESC' + | 'INPUTS_ASC' + | 'INPUTS_DESC' + | 'OUTPUTS_ASC' + | 'OUTPUTS_DESC' + | 'PROPS_ASC' + | 'PROPS_DESC' + | 'VOLATILE_ASC' + | 'VOLATILE_DESC' + | 'ICON_ASC' + | 'ICON_DESC' + | 'CATEGORY_ASC' + | 'CATEGORY_DESC'; +// ============ CRUD Input Types ============ +export interface CreateGetAllRecordInput { + clientMutationId?: string; + getAllRecord: { + path?: string[]; + data?: Record; + }; +} +export interface GetAllRecordPatch { + path?: string[] | null; + data?: Record | null; +} +export interface UpdateGetAllRecordInput { + clientMutationId?: string; + id: string; + getAllRecordPatch: GetAllRecordPatch; +} +export interface DeleteGetAllRecordInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionApiBindingInput { + clientMutationId?: string; + functionApiBinding: { + functionDefinitionId: string; + apiId: string; + alias?: string; + config?: Record; + }; +} +export interface FunctionApiBindingPatch { + functionDefinitionId?: string | null; + apiId?: string | null; + alias?: string | null; + config?: Record | null; +} +export interface UpdateFunctionApiBindingInput { + clientMutationId?: string; + id: string; + functionApiBindingPatch: FunctionApiBindingPatch; +} +export interface DeleteFunctionApiBindingInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDeploymentInput { + clientMutationId?: string; + functionDeployment: { + functionDefinitionId: string; + namespaceId: string; + status?: string; + serviceUrl?: string; + serviceName?: string; + revision?: number; + image?: string; + concurrency?: number; + scaleMin?: number; + scaleMax?: number; + timeoutSeconds?: number; + resources?: Record; + lastError?: string; + lastErrorAt?: string; + errorCount?: number; + labels?: Record; + annotations?: Record; + databaseId: string; + }; +} +export interface FunctionDeploymentPatch { + functionDefinitionId?: string | null; + namespaceId?: string | null; + status?: string | null; + serviceUrl?: string | null; + serviceName?: string | null; + revision?: number | null; + image?: string | null; + concurrency?: number | null; + scaleMin?: number | null; + scaleMax?: number | null; + timeoutSeconds?: number | null; + resources?: Record | null; + lastError?: string | null; + lastErrorAt?: string | null; + errorCount?: number | null; + labels?: Record | null; + annotations?: Record | null; + databaseId?: string | null; +} +export interface UpdateFunctionDeploymentInput { + clientMutationId?: string; + id: string; + functionDeploymentPatch: FunctionDeploymentPatch; +} +export interface DeleteFunctionDeploymentInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphRefInput { + clientMutationId?: string; + functionGraphRef: { + name: string; + databaseId: string; + storeId: string; + commitId?: string; + }; +} +export interface FunctionGraphRefPatch { + name?: string | null; + databaseId?: string | null; + storeId?: string | null; + commitId?: string | null; +} +export interface UpdateFunctionGraphRefInput { + clientMutationId?: string; + id: string; + functionGraphRefPatch: FunctionGraphRefPatch; +} +export interface DeleteFunctionGraphRefInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphStoreInput { + clientMutationId?: string; + functionGraphStore: { + name: string; + databaseId: string; + hash?: string; + }; +} +export interface FunctionGraphStorePatch { + name?: string | null; + databaseId?: string | null; + hash?: string | null; +} +export interface UpdateFunctionGraphStoreInput { + clientMutationId?: string; + id: string; + functionGraphStorePatch: FunctionGraphStorePatch; +} +export interface DeleteFunctionGraphStoreInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphObjectInput { + clientMutationId?: string; + functionGraphObject: { + databaseId: string; + kids?: string[]; + ktree?: string[]; + data?: Record; + }; +} +export interface FunctionGraphObjectPatch { + databaseId?: string | null; + kids?: string[] | null; + ktree?: string[] | null; + data?: Record | null; +} +export interface UpdateFunctionGraphObjectInput { + clientMutationId?: string; + id: string; + functionGraphObjectPatch: FunctionGraphObjectPatch; +} +export interface DeleteFunctionGraphObjectInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDeploymentEventInput { + clientMutationId?: string; + functionDeploymentEvent: { + deploymentId: string; + eventType: string; + actorId?: string; + message?: string; + metadata?: Record; + databaseId: string; + }; +} +export interface FunctionDeploymentEventPatch { + deploymentId?: string | null; + eventType?: string | null; + actorId?: string | null; + message?: string | null; + metadata?: Record | null; + databaseId?: string | null; +} +export interface UpdateFunctionDeploymentEventInput { + clientMutationId?: string; + id: string; + functionDeploymentEventPatch: FunctionDeploymentEventPatch; +} +export interface DeleteFunctionDeploymentEventInput { + clientMutationId?: string; + id: string; +} +export interface CreateOrgFunctionExecutionLogInput { + clientMutationId?: string; + orgFunctionExecutionLog: { + invocationId?: string; + taskIdentifier?: string; + logLevel?: string; + message: string; + metadata?: Record; + actorId?: string; + }; +} +export interface OrgFunctionExecutionLogPatch { + invocationId?: string | null; + taskIdentifier?: string | null; + logLevel?: string | null; + message?: string | null; + metadata?: Record | null; + actorId?: string | null; +} +export interface UpdateOrgFunctionExecutionLogInput { + clientMutationId?: string; + id: string; + orgFunctionExecutionLogPatch: OrgFunctionExecutionLogPatch; +} +export interface DeleteOrgFunctionExecutionLogInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + functionGraphExecutionOutput: { + databaseId: string; + hash: Base64EncodedBinary; + data: Record; + }; +} +export interface FunctionGraphExecutionOutputPatch { + databaseId?: string | null; + hash?: Base64EncodedBinary | null; + data?: Record | null; +} +export interface UpdateFunctionGraphExecutionOutputInput { + clientMutationId?: string; + id: string; + functionGraphExecutionOutputPatch: FunctionGraphExecutionOutputPatch; +} +export interface DeleteFunctionGraphExecutionOutputInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphCommitInput { + clientMutationId?: string; + functionGraphCommit: { + message?: string; + databaseId: string; + storeId: string; + parentIds?: string[]; + authorId?: string; + committerId?: string; + treeId?: string; + date?: string; + }; +} +export interface FunctionGraphCommitPatch { + message?: string | null; + databaseId?: string | null; + storeId?: string | null; + parentIds?: string[] | null; + authorId?: string | null; + committerId?: string | null; + treeId?: string | null; + date?: string | null; +} +export interface UpdateFunctionGraphCommitInput { + clientMutationId?: string; + id: string; + functionGraphCommitPatch: FunctionGraphCommitPatch; +} +export interface DeleteFunctionGraphCommitInput { + clientMutationId?: string; + id: string; +} +export interface CreateSecretDefinitionInput { + clientMutationId?: string; + secretDefinition: { + name: string; + description?: string; + isBuiltIn?: boolean; + labels?: Record; + annotations?: Record; + databaseId: string; + }; +} +export interface SecretDefinitionPatch { + name?: string | null; + description?: string | null; + isBuiltIn?: boolean | null; + labels?: Record | null; + annotations?: Record | null; + databaseId?: string | null; +} +export interface UpdateSecretDefinitionInput { + clientMutationId?: string; + id: string; + secretDefinitionPatch: SecretDefinitionPatch; +} +export interface DeleteSecretDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionExecutionLogInput { + clientMutationId?: string; + functionExecutionLog: { + invocationId?: string; + taskIdentifier?: string; + logLevel?: string; + message: string; + metadata?: Record; + actorId?: string; + databaseId: string; + }; +} +export interface FunctionExecutionLogPatch { + invocationId?: string | null; + taskIdentifier?: string | null; + logLevel?: string | null; + message?: string | null; + metadata?: Record | null; + actorId?: string | null; + databaseId?: string | null; +} +export interface UpdateFunctionExecutionLogInput { + clientMutationId?: string; + id: string; + functionExecutionLogPatch: FunctionExecutionLogPatch; +} +export interface DeleteFunctionExecutionLogInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + functionGraphExecutionNodeState: { + executionId: string; + databaseId: string; + nodeName: string; + nodePath?: string[]; + status?: string; + startedAt?: string; + completedAt?: string; + errorCode?: string; + errorMessage?: string; + outputId?: string; + }; +} +export interface FunctionGraphExecutionNodeStatePatch { + executionId?: string | null; + databaseId?: string | null; + nodeName?: string | null; + nodePath?: string[] | null; + status?: string | null; + startedAt?: string | null; + completedAt?: string | null; + errorCode?: string | null; + errorMessage?: string | null; + outputId?: string | null; +} +export interface UpdateFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + id: string; + functionGraphExecutionNodeStatePatch: FunctionGraphExecutionNodeStatePatch; +} +export interface DeleteFunctionGraphExecutionNodeStateInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphInput { + clientMutationId?: string; + functionGraph: { + databaseId: string; + storeId: string; + entityId: string; + context?: string; + name?: string; + description?: string; + definitionsCommitId: string; + isValid?: boolean; + validationErrors?: Record; + createdBy?: string; + }; +} +export interface FunctionGraphPatch { + databaseId?: string | null; + storeId?: string | null; + entityId?: string | null; + context?: string | null; + name?: string | null; + description?: string | null; + definitionsCommitId?: string | null; + isValid?: boolean | null; + validationErrors?: Record | null; + createdBy?: string | null; +} +export interface UpdateFunctionGraphInput { + clientMutationId?: string; + id: string; + functionGraphPatch: FunctionGraphPatch; +} +export interface DeleteFunctionGraphInput { + clientMutationId?: string; + id: string; +} +export interface CreateOrgFunctionInvocationInput { + clientMutationId?: string; + orgFunctionInvocation: { + actorId?: string; + taskIdentifier: string; + payload?: Record; + status?: string; + result?: Record; + error?: string; + durationMs?: number; + jobId?: string; + startedAt?: string; + completedAt?: string; + parentInvocationId?: string; + graphExecutionId?: string; + }; +} +export interface OrgFunctionInvocationPatch { + actorId?: string | null; + taskIdentifier?: string | null; + payload?: Record | null; + status?: string | null; + result?: Record | null; + error?: string | null; + durationMs?: number | null; + jobId?: string | null; + startedAt?: string | null; + completedAt?: string | null; + parentInvocationId?: string | null; + graphExecutionId?: string | null; +} +export interface UpdateOrgFunctionInvocationInput { + clientMutationId?: string; + id: string; + orgFunctionInvocationPatch: OrgFunctionInvocationPatch; +} +export interface DeleteOrgFunctionInvocationInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionInvocationInput { + clientMutationId?: string; + functionInvocation: { + actorId?: string; + databaseId: string; + taskIdentifier: string; + payload?: Record; + status?: string; + result?: Record; + error?: string; + durationMs?: number; + jobId?: string; + startedAt?: string; + completedAt?: string; + parentInvocationId?: string; + graphExecutionId?: string; + }; +} +export interface FunctionInvocationPatch { + actorId?: string | null; + databaseId?: string | null; + taskIdentifier?: string | null; + payload?: Record | null; + status?: string | null; + result?: Record | null; + error?: string | null; + durationMs?: number | null; + jobId?: string | null; + startedAt?: string | null; + completedAt?: string | null; + parentInvocationId?: string | null; + graphExecutionId?: string | null; +} +export interface UpdateFunctionInvocationInput { + clientMutationId?: string; + id: string; + functionInvocationPatch: FunctionInvocationPatch; +} +export interface DeleteFunctionInvocationInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionGraphExecutionInput { + clientMutationId?: string; + functionGraphExecution: { + startedAt?: string; + graphId: string; + invocationId?: string; + databaseId: string; + entityId?: string; + outputNode: string; + outputPort?: string; + status?: string; + inputPayload?: Record; + outputPayload?: Record; + nodeOutputs?: Record; + executionPlan?: Record; + currentWave?: number; + parentExecutionId?: string; + parentNodeName?: string; + definitionsCommitId?: string; + tickCount?: number; + completedAt?: string; + maxTicks?: number; + maxPendingJobs?: number; + timeoutAt?: string; + errorCode?: string; + errorMessage?: string; + }; +} +export interface FunctionGraphExecutionPatch { + startedAt?: string | null; + graphId?: string | null; + invocationId?: string | null; + databaseId?: string | null; + entityId?: string | null; + outputNode?: string | null; + outputPort?: string | null; + status?: string | null; + inputPayload?: Record | null; + outputPayload?: Record | null; + nodeOutputs?: Record | null; + executionPlan?: Record | null; + currentWave?: number | null; + parentExecutionId?: string | null; + parentNodeName?: string | null; + definitionsCommitId?: string | null; + tickCount?: number | null; + completedAt?: string | null; + maxTicks?: number | null; + maxPendingJobs?: number | null; + timeoutAt?: string | null; + errorCode?: string | null; + errorMessage?: string | null; +} +export interface UpdateFunctionGraphExecutionInput { + clientMutationId?: string; + id: string; + functionGraphExecutionPatch: FunctionGraphExecutionPatch; +} +export interface DeleteFunctionGraphExecutionInput { + clientMutationId?: string; + id: string; +} +export interface CreateFunctionDefinitionInput { + clientMutationId?: string; + functionDefinition: { + scope: string; + name: string; + taskIdentifier: string; + description?: string; + isInvocable?: boolean; + maxAttempts?: number; + priority?: number; + queueName?: string; + runtime?: string; + image?: string; + concurrency?: number; + scaleMin?: number; + scaleMax?: number; + timeoutSeconds?: number; + resources?: Record; + isBuiltIn?: boolean; + requiredSecrets?: FunctionRequirementInput[]; + requiredConfigs?: FunctionRequirementInput[]; + requiredBuckets?: string[]; + requiredModels?: string[]; + inputs?: Record; + outputs?: Record; + props?: Record; + volatile?: boolean; + icon?: string; + category?: string; + }; +} +export interface FunctionDefinitionPatch { + scope?: string | null; + name?: string | null; + taskIdentifier?: string | null; + description?: string | null; + isInvocable?: boolean | null; + maxAttempts?: number | null; + priority?: number | null; + queueName?: string | null; + runtime?: string | null; + image?: string | null; + concurrency?: number | null; + scaleMin?: number | null; + scaleMax?: number | null; + timeoutSeconds?: number | null; + resources?: Record | null; + isBuiltIn?: boolean | null; + requiredSecrets?: FunctionRequirementInput[] | null; + requiredConfigs?: FunctionRequirementInput[] | null; + requiredBuckets?: string[] | null; + requiredModels?: string[] | null; + inputs?: Record | null; + outputs?: Record | null; + props?: Record | null; + volatile?: boolean | null; + icon?: string | null; + category?: string | null; +} +export interface UpdateFunctionDefinitionInput { + clientMutationId?: string; + id: string; + functionDefinitionPatch: FunctionDefinitionPatch; +} +export interface DeleteFunctionDefinitionInput { + clientMutationId?: string; + id: string; +} +// ============ Connection Fields Map ============ +export const connectionFieldsMap = { + FunctionDefinition: { + functionApiBindings: 'FunctionApiBinding', + functionDeployments: 'FunctionDeployment', + }, +} as Record>; +// ============ Custom Input Types (from schema) ============ +export interface ValidateFunctionGraphInput { + clientMutationId?: string; + graphId?: string; +} +export interface InitEmptyRepoInput { + clientMutationId?: string; + sId?: string; + storeId?: string; +} +export interface SetDataAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: Record; +} +export interface ImportDefinitionsInput { + clientMutationId?: string; + graphId?: string; + sourceScopeId?: string; + sourceCommitId?: string; + contexts?: string[]; +} +export interface CopyGraphInput { + clientMutationId?: string; + databaseId?: string; + graphId?: string; + name?: string; +} +export interface SaveGraphInput { + clientMutationId?: string; + graphId?: string; + rootHash?: string; + message?: string; +} +export interface AddEdgeAndSaveInput { + clientMutationId?: string; + graphId?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + message?: string; +} +export interface AddNodeAndSaveInput { + clientMutationId?: string; + graphId?: string; + nodeName?: string; + nodeType?: string; + props?: Record; + meta?: Record; + message?: string; +} +export interface AddEdgeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + srcNode?: string; + srcPort?: string; + dstNode?: string; + dstPort?: string; + context?: string; + graphName?: string; +} +export interface AddNodeInput { + clientMutationId?: string; + databaseId?: string; + rootHash?: string; + nodeName?: string; + nodeType?: string; + context?: string; + graphName?: string; + props?: Record; + meta?: Record; +} +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: Record; + context?: string; + description?: string; + entityId?: string; + createdBy?: string; + definitionsCommitId?: string; +} +export interface InsertNodeAtPathInput { + clientMutationId?: string; + sId?: string; + root?: string; + path?: string[]; + data?: Record; + kids?: string[]; + ktree?: string[]; +} +export interface StartExecutionInput { + clientMutationId?: string; + graphId?: string; + inputPayload?: Record; + outputNode?: string; + outputPort?: string; + maxTicks?: number; + maxPendingJobs?: number; + timeoutInterval?: IntervalInput; + parentExecutionId?: string; + parentNodeName?: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** A filter to be used against Base64EncodedBinary fields. All fields are combined with a logical ‘and.’ */ +export interface Base64EncodedBinaryFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: Base64EncodedBinary; + /** Not equal to the specified value. */ + notEqualTo?: Base64EncodedBinary; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: Base64EncodedBinary; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: Base64EncodedBinary; + /** Included in the specified list. */ + in?: Base64EncodedBinary[]; + /** Not included in the specified list. */ + notIn?: Base64EncodedBinary[]; +} +/** A filter to be used against many `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionApiBindingFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionApiBindingFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionApiBindingFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionApiBindingFilter; +} +/** A filter to be used against many `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionToManyFunctionDeploymentFilter { + /** Filters to entities where at least one related entity matches. */ + some?: FunctionDeploymentFilter; + /** Filters to entities where every related entity matches. */ + every?: FunctionDeploymentFilter; + /** Filters to entities where no related entity matches. */ + none?: FunctionDeploymentFilter; +} +/** An input for mutations affecting `FunctionApiBinding` */ +export interface FunctionApiBindingInput { + id?: string; + /** Function definition this binding belongs to */ + functionDefinitionId: string; + /** API endpoint this function is bound to */ + apiId: string; + /** Binding alias (e.g. default, staging, production) */ + alias?: string; + /** Per-binding configuration (overrides, routing rules, etc.) */ + config?: Record; +} +/** An input for mutations affecting `FunctionDeployment` */ +export interface FunctionDeploymentInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function definition being deployed to this namespace */ + functionDefinitionId: string; + /** Target namespace for this deployment (maps to a K8s namespace) */ + namespaceId: string; + /** Deployment lifecycle status: pending, provisioning, active, failed, scaled_to_zero, deactivated */ + status?: string; + /** Knative service URL (http://{service-name}.{namespace}.svc.cluster.local) — populated after provisioning */ + serviceUrl?: string; + /** Knative service name — derived from task_identifier at provision time */ + serviceName?: string; + /** Deployment revision number (incremented on each redeployment) */ + revision?: number; + /** Container image override (NULL = inherit from function definition) */ + image?: string; + /** Max concurrent requests per pod (NULL = inherit from definition) */ + concurrency?: number; + /** Minimum replica count (NULL = inherit from definition or Knative default) */ + scaleMin?: number; + /** Maximum replica count (NULL = inherit from definition or Knative default) */ + scaleMax?: number; + /** Request timeout override in seconds (NULL = inherit from definition) */ + timeoutSeconds?: number; + /** K8s resource spec override: {"requests":{"cpu":"100m","memory":"128Mi"},"limits":{...}} */ + resources?: Record; + /** Most recent provisioning or runtime error message */ + lastError?: string; + /** Timestamp of the most recent error */ + lastErrorAt?: string; + /** Cumulative error count for this deployment */ + errorCount?: number; + /** Key/value pairs for selecting and filtering deployments */ + labels?: Record; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionGraphRef` */ +export interface FunctionGraphRefInput { + /** Unique ref identifier */ + id?: string; + /** Ref name (e.g. HEAD, main) */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this ref belongs to */ + storeId: string; + /** Commit this ref points to */ + commitId?: string; +} +/** An input for mutations affecting `FunctionGraphStore` */ +export interface FunctionGraphStoreInput { + /** Unique store identifier */ + id?: string; + /** Human-readable store name */ + name: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Current root object hash of this store */ + hash?: string; + /** Timestamp of store creation */ + createdAt?: string; +} +/** An input for mutations affecting `FunctionGraphObject` */ +export interface FunctionGraphObjectInput { + /** Content-addressed UUID v5 — deterministic hash of (data, kids, ktree) */ + id: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Ordered array of child object IDs */ + kids?: string[]; + /** Ordered array of child path names (parallel to kids) */ + ktree?: string[]; + /** Payload data for this object node */ + data?: Record; + /** Timestamp of object creation */ + createdAt?: string; +} +/** An input for mutations affecting `FunctionDeploymentEvent` */ +export interface FunctionDeploymentEventInput { + /** Event timestamp (partition key) */ + createdAt?: string; + /** Unique event identifier */ + id?: string; + /** Deployment this event belongs to */ + deploymentId: string; + /** Event type: provisioned, scaled, failed, deactivated, redeployed, health_check */ + eventType: string; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string; + /** Human-readable description of the event */ + message?: string; + /** Structured context (old/new values, error details, etc.) */ + metadata?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `OrgFunctionExecutionLog` */ +export interface OrgFunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; +} +/** An input for mutations affecting `FunctionGraphExecutionOutput` */ +export interface FunctionGraphExecutionOutputInput { + /** Timestamp of output creation */ + createdAt?: string; + /** Unique execution output identifier */ + id?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** SHA-256 hash of the data JSONB — content-addressed deduplication */ + hash: Base64EncodedBinary; + /** The actual output payload from a completed node */ + data: Record; +} +/** An input for mutations affecting `FunctionGraphCommit` */ +export interface FunctionGraphCommitInput { + /** Unique commit identifier */ + id?: string; + /** Optional commit message */ + message?: string; + /** Database scope for multi-tenant isolation */ + databaseId: string; + /** Store this commit belongs to */ + storeId: string; + /** Parent commit IDs (supports merge commits) */ + parentIds?: string[]; + /** User who authored the changes */ + authorId?: string; + /** User who committed (may differ from author) */ + committerId?: string; + /** Root object ID of the tree snapshot at this commit */ + treeId?: string; + /** Commit timestamp */ + date?: string; +} +/** An input for mutations affecting `SecretDefinition` */ +export interface SecretDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Secret name (must match app_secrets.name for resolution) */ + name: string; + /** Human-readable description of what this secret is used for */ + description?: string; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: Record; + /** Freeform metadata annotations for secret definitions */ + annotations?: Record; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionExecutionLog` */ +export interface FunctionExecutionLogInput { + /** Log entry timestamp (partition key) */ + createdAt?: string; + /** Unique log entry identifier */ + id?: string; + /** Invocation this log entry belongs to (NULL for standalone job logs) */ + invocationId?: string; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string; + /** Log severity: debug, info, warn, error */ + logLevel?: string; + /** Log message text */ + message: string; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; +} +/** An input for mutations affecting `FunctionGraphExecutionNodeState` */ +export interface FunctionGraphExecutionNodeStateInput { + /** Timestamp of node state creation (partition key) */ + createdAt?: string; + /** Unique node state identifier */ + id?: string; + /** FK to the parent graph execution */ + executionId: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Name of the node within the graph (e.g. send-email1) */ + nodeName: string; + /** Full merkle tree path to this node (e.g. {function,graphs,myflow,nodes,send-email1}) — enables subnet hierarchy tracking */ + nodePath?: string[]; + /** Node lifecycle: pending → queued → running → completed/failed */ + status?: string; + /** Timestamp when the node began executing */ + startedAt?: string; + /** Timestamp when the node finished (success or failure) */ + completedAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; + /** FK to execution_outputs — content-addressed output blob for this node */ + outputId?: string; +} +/** An input for mutations affecting `OrgFunctionInvocation` */ +export interface OrgFunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: Record; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: Record; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +/** An input for mutations affecting `FunctionInvocation` */ +export interface FunctionInvocationInput { + /** Invocation creation timestamp (partition key) */ + createdAt?: string; + /** Unique invocation identifier */ + id?: string; + /** Who triggered the invocation (NULL for system/cron) */ + actorId?: string; + /** Database that owns this resource (database-scoped isolation) */ + databaseId: string; + /** Function routing slug (scope:name). Links to function_definitions.task_identifier by convention — no FK. */ + taskIdentifier: string; + /** Function input payload */ + payload?: Record; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Function return value (success) or structured error (failure) */ + result?: Record; + /** Error message when status is failed */ + error?: string; + /** Wall-clock execution time in milliseconds */ + durationMs?: number; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string; + /** When execution started */ + startedAt?: string; + /** When execution completed */ + completedAt?: string; + /** Parent invocation when this is a child node of a flow graph execution */ + parentInvocationId?: string; + /** Groups all node invocations from a single flow graph execution */ + graphExecutionId?: string; +} +/** An input for mutations affecting `FunctionGraphExecution` */ +export interface FunctionGraphExecutionInput { + /** Execution start timestamp */ + startedAt?: string; + /** Unique execution identifier */ + id?: string; + /** FK to the graph definition being executed */ + graphId: string; + /** Parent function_invocations row (for metering) */ + invocationId?: string; + /** Scope for multi-tenant isolation */ + databaseId: string; + /** Entity context (org/team) for scoped billing */ + entityId?: string; + /** Target output boundary node name to resolve */ + outputNode: string; + /** Target output port name (default: value) */ + outputPort?: string; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string; + /** Initial inputs provided at invocation time */ + inputPayload?: Record; + /** Final result extracted from terminal output node */ + outputPayload?: Record; + /** Map of node_name → execution output id (content-addressed hash reference) */ + nodeOutputs?: Record; + /** Pre-computed topological sort as array of wave objects */ + executionPlan?: Record; + /** Index into execution_plan — tick only processes this wave */ + currentWave?: number; + /** Parent execution when this is a sub-execution */ + parentExecutionId?: string; + /** Node name in parent execution that spawned this sub-execution */ + parentNodeName?: string; + /** Pinned definitions store commit for deterministic evaluation */ + definitionsCommitId?: string; + /** Number of evaluate_step ticks executed */ + tickCount?: number; + /** Execution completion timestamp */ + completedAt?: string; + /** Maximum ticks before execution is failed (default 100) */ + maxTicks?: number; + /** Maximum pending jobs before execution is failed (default 50) */ + maxPendingJobs?: number; + /** Absolute deadline — execution fails if still running after this time */ + timeoutAt?: string; + /** Machine-readable error code when status = failed */ + errorCode?: string; + /** Human-readable error description when status = failed */ + errorMessage?: string; +} +/** An input for mutations affecting `FunctionDefinition` */ +export interface FunctionDefinitionInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope: string; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name: string; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier: string; + /** Human-readable description of what this function does */ + description?: string; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number; + /** Job priority (lower = higher priority) */ + priority?: number; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string; + /** Execution mode: http (Knative Service dispatch) or inline (in-process in compute worker) */ + runtime?: string; + /** Docker image reference (e.g. ghcr.io/constructive-io/email-send-fn:latest). Required when runtime=http. NULL for inline functions. */ + image?: string; + /** Knative containerConcurrency — max concurrent requests per pod instance */ + concurrency?: number; + /** Minimum pod count for Knative autoscaling (minScale) */ + scaleMin?: number; + /** Maximum pod count for Knative autoscaling (maxScale) */ + scaleMax?: number; + /** Knative request timeout in seconds */ + timeoutSeconds?: number; + /** Container resource requests and limits: {requests: {memory, cpu}, limits: {memory, cpu}} */ + resources?: Record; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirementInput[]; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirementInput[]; + /** Bucket keys this function needs (e.g. uploads, exports). Empty = no bucket requirements. */ + requiredBuckets?: string[]; + /** Inference model whitelist (e.g. gpt-4o, claude-3). Empty = no model requirements. */ + requiredModels?: string[]; + /** Data input ports: [{name, type, description?, optional?, multi?, schema?}] */ + inputs?: Record; + /** Data output ports: [{name, type, description?, optional?, multi?, schema?}] */ + outputs?: Record; + /** Configuration properties: [{name, type, default?, description?, required?, schema?}] */ + props?: Record; + /** Whether this function has side effects and cannot be cached or memoized */ + volatile?: boolean; + /** Icon identifier for UI palette rendering (e.g. mail, database, code) */ + icon?: string; + /** Palette grouping category (e.g. email, data, ai, custom) */ + category?: string; +} +/** An input for mutations affecting `FunctionRequirement` */ +export interface FunctionRequirementInput { + name?: string; + required?: boolean; +} +/** An interval of time that has passed where the smallest distinct unit is a second. */ +export interface IntervalInput { + /** + * A quantity of seconds. This is the only non-integer field, as all the other + * fields will dump their overflow into a smaller unit of time. Intervals don’t + * have a smaller unit than seconds. + */ + seconds?: number; + /** A quantity of minutes. */ + minutes?: number; + /** A quantity of hours. */ + hours?: number; + /** A quantity of days. */ + days?: number; + /** A quantity of months. */ + months?: number; + /** A quantity of years. */ + years?: number; +} +/** A filter to be used against `FunctionApiBinding` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionApiBindingFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `apiId` field. */ + apiId?: UUIDFilter; + /** Filter by the object’s `alias` field. */ + alias?: StringFilter; + /** Filter by the object’s `config` field. */ + config?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: FunctionApiBindingFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionApiBindingFilter[]; + /** Negates the expression. */ + not?: FunctionApiBindingFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against `FunctionDeployment` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDeploymentFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `functionDefinitionId` field. */ + functionDefinitionId?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `serviceName` field. */ + serviceName?: StringFilter; + /** Filter by the object’s `revision` field. */ + revision?: IntFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `lastError` field. */ + lastError?: StringFilter; + /** Filter by the object’s `lastErrorAt` field. */ + lastErrorAt?: DatetimeFilter; + /** Filter by the object’s `errorCount` field. */ + errorCount?: IntFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentFilter; + /** Filter by the object’s `functionDefinition` relation. */ + functionDefinition?: FunctionDefinitionFilter; +} +/** A filter to be used against UUID fields. All fields are combined with a logical ‘and.’ */ +export interface UUIDFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; +} +/** A filter to be used against String fields. All fields are combined with a logical ‘and.’ */ +export interface StringFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; + /** Contains the specified string (case-sensitive). */ + includes?: string; + /** Does not contain the specified string (case-sensitive). */ + notIncludes?: string; + /** Contains the specified string (case-insensitive). */ + includesInsensitive?: string; + /** Does not contain the specified string (case-insensitive). */ + notIncludesInsensitive?: string; + /** Starts with the specified string (case-sensitive). */ + startsWith?: string; + /** Does not start with the specified string (case-sensitive). */ + notStartsWith?: string; + /** Starts with the specified string (case-insensitive). */ + startsWithInsensitive?: string; + /** Does not start with the specified string (case-insensitive). */ + notStartsWithInsensitive?: string; + /** Ends with the specified string (case-sensitive). */ + endsWith?: string; + /** Does not end with the specified string (case-sensitive). */ + notEndsWith?: string; + /** Ends with the specified string (case-insensitive). */ + endsWithInsensitive?: string; + /** Does not end with the specified string (case-insensitive). */ + notEndsWithInsensitive?: string; + /** Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + like?: string; + /** Does not match the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + notLike?: string; + /** Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + likeInsensitive?: string; + /** Does not match the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. */ + notLikeInsensitive?: string; + /** Equal to the specified value (case-insensitive). */ + equalToInsensitive?: string; + /** Not equal to the specified value (case-insensitive). */ + notEqualToInsensitive?: string; + /** Not equal to the specified value, treating null like an ordinary value (case-insensitive). */ + distinctFromInsensitive?: string; + /** Equal to the specified value, treating null like an ordinary value (case-insensitive). */ + notDistinctFromInsensitive?: string; + /** Included in the specified list (case-insensitive). */ + inInsensitive?: string[]; + /** Not included in the specified list (case-insensitive). */ + notInInsensitive?: string[]; + /** Less than the specified value (case-insensitive). */ + lessThanInsensitive?: string; + /** Less than or equal to the specified value (case-insensitive). */ + lessThanOrEqualToInsensitive?: string; + /** Greater than the specified value (case-insensitive). */ + greaterThanInsensitive?: string; + /** Greater than or equal to the specified value (case-insensitive). */ + greaterThanOrEqualToInsensitive?: string; +} +/** A filter to be used against JSON fields. All fields are combined with a logical ‘and.’ */ +export interface JSONFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: Record; + /** Not equal to the specified value. */ + notEqualTo?: Record; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: Record; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: Record; + /** Included in the specified list. */ + in?: Record[]; + /** Not included in the specified list. */ + notIn?: Record[]; + /** Less than the specified value. */ + lessThan?: Record; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: Record; + /** Greater than the specified value. */ + greaterThan?: Record; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: Record; + /** Contains the specified JSON. */ + contains?: Record; + /** Contains the specified key. */ + containsKey?: string; + /** Contains all of the specified keys. */ + containsAllKeys?: string[]; + /** Contains any of the specified keys. */ + containsAnyKeys?: string[]; + /** Contained by the specified JSON. */ + containedBy?: Record; +} +/** A filter to be used against `FunctionDefinition` object types. All fields are combined with a logical ‘and.’ */ +export interface FunctionDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `runtime` field. */ + runtime?: StringFilter; + /** Filter by the object’s `image` field. */ + image?: StringFilter; + /** Filter by the object’s `concurrency` field. */ + concurrency?: IntFilter; + /** Filter by the object’s `scaleMin` field. */ + scaleMin?: IntFilter; + /** Filter by the object’s `scaleMax` field. */ + scaleMax?: IntFilter; + /** Filter by the object’s `timeoutSeconds` field. */ + timeoutSeconds?: IntFilter; + /** Filter by the object’s `resources` field. */ + resources?: JSONFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `requiredBuckets` field. */ + requiredBuckets?: StringListFilter; + /** Filter by the object’s `requiredModels` field. */ + requiredModels?: StringListFilter; + /** Filter by the object’s `inputs` field. */ + inputs?: JSONFilter; + /** Filter by the object’s `outputs` field. */ + outputs?: JSONFilter; + /** Filter by the object’s `props` field. */ + props?: JSONFilter; + /** Filter by the object’s `volatile` field. */ + volatile?: BooleanFilter; + /** Filter by the object’s `icon` field. */ + icon?: StringFilter; + /** Filter by the object’s `category` field. */ + category?: StringFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: FunctionDefinitionFilter; + /** Filter by the object’s `functionApiBindings` relation. */ + functionApiBindings?: FunctionDefinitionToManyFunctionApiBindingFilter; + /** `functionApiBindings` exist. */ + functionApiBindingsExist?: boolean; + /** Filter by the object’s `functionDeployments` relation. */ + functionDeployments?: FunctionDefinitionToManyFunctionDeploymentFilter; + /** `functionDeployments` exist. */ + functionDeploymentsExist?: boolean; +} +/** A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ */ +export interface DatetimeFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string; + /** Not equal to the specified value. */ + notEqualTo?: string; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string; + /** Included in the specified list. */ + in?: string[]; + /** Not included in the specified list. */ + notIn?: string[]; + /** Less than the specified value. */ + lessThan?: string; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string; + /** Greater than the specified value. */ + greaterThan?: string; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string; +} +/** A filter to be used against Int fields. All fields are combined with a logical ‘and.’ */ +export interface IntFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: number; + /** Not equal to the specified value. */ + notEqualTo?: number; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: number; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: number; + /** Included in the specified list. */ + in?: number[]; + /** Not included in the specified list. */ + notIn?: number[]; + /** Less than the specified value. */ + lessThan?: number; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: number; + /** Greater than the specified value. */ + greaterThan?: number; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: number; +} +/** A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ */ +export interface BooleanFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: boolean; + /** Not equal to the specified value. */ + notEqualTo?: boolean; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: boolean; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: boolean; + /** Included in the specified list. */ + in?: boolean[]; + /** Not included in the specified list. */ + notIn?: boolean[]; + /** Less than the specified value. */ + lessThan?: boolean; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: boolean; + /** Greater than the specified value. */ + greaterThan?: boolean; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: boolean; +} +/** A filter to be used against String List fields. All fields are combined with a logical ‘and.’ */ +export interface StringListFilter { + /** Is null (if `true` is specified) or is not null (if `false` is specified). */ + isNull?: boolean; + /** Equal to the specified value. */ + equalTo?: string[]; + /** Not equal to the specified value. */ + notEqualTo?: string[]; + /** Not equal to the specified value, treating null like an ordinary value. */ + distinctFrom?: string[]; + /** Equal to the specified value, treating null like an ordinary value. */ + notDistinctFrom?: string[]; + /** Less than the specified value. */ + lessThan?: string[]; + /** Less than or equal to the specified value. */ + lessThanOrEqualTo?: string[]; + /** Greater than the specified value. */ + greaterThan?: string[]; + /** Greater than or equal to the specified value. */ + greaterThanOrEqualTo?: string[]; + /** Contains the specified list of values. */ + contains?: string[]; + /** Contained by the specified list of values. */ + containedBy?: string[]; + /** Overlaps the specified list of values. */ + overlaps?: string[]; + /** Any array item is equal to the specified value. */ + anyEqualTo?: string; + /** Any array item is not equal to the specified value. */ + anyNotEqualTo?: string; + /** Any array item is less than the specified value. */ + anyLessThan?: string; + /** Any array item is less than or equal to the specified value. */ + anyLessThanOrEqualTo?: string; + /** Any array item is greater than the specified value. */ + anyGreaterThan?: string; + /** Any array item is greater than or equal to the specified value. */ + anyGreaterThanOrEqualTo?: string; +} +// ============ Payload/Return Types (for custom operations) ============ +export interface ValidateFunctionGraphPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type ValidateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface InitEmptyRepoPayload { + clientMutationId?: string | null; +} +export type InitEmptyRepoPayloadSelect = { + clientMutationId?: boolean; +}; +export interface SetDataAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type SetDataAtPathPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ImportDefinitionsPayload { + clientMutationId?: string | null; +} +export type ImportDefinitionsPayloadSelect = { + clientMutationId?: boolean; +}; +export interface CopyGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CopyGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface SaveGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type SaveGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddEdgeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddEdgeAndSavePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddNodeAndSavePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddNodeAndSavePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddEdgePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddEdgePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface AddNodePayload { + clientMutationId?: string | null; + result?: string | null; +} +export type AddNodePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ImportGraphJsonPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type ImportGraphJsonPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface InsertNodeAtPathPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type InsertNodeAtPathPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface StartExecutionPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type StartExecutionPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +export type ProvisionBucketPayloadSelect = { + success?: boolean; + bucketName?: boolean; + accessType?: boolean; + provider?: boolean; + endpoint?: boolean; + error?: boolean; +}; +export interface CreateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was created by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type CreateFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface UpdateFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was updated by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type UpdateFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface DeleteFunctionApiBindingPayload { + clientMutationId?: string | null; + /** The `FunctionApiBinding` that was deleted by this mutation. */ + functionApiBinding?: FunctionApiBinding | null; + functionApiBindingEdge?: FunctionApiBindingEdge | null; +} +export type DeleteFunctionApiBindingPayloadSelect = { + clientMutationId?: boolean; + functionApiBinding?: { + select: FunctionApiBindingSelect; + }; + functionApiBindingEdge?: { + select: FunctionApiBindingEdgeSelect; + }; +}; +export interface CreateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was created by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type CreateFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was updated by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type UpdateFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentPayload { + clientMutationId?: string | null; + /** The `FunctionDeployment` that was deleted by this mutation. */ + functionDeployment?: FunctionDeployment | null; + functionDeploymentEdge?: FunctionDeploymentEdge | null; +} +export type DeleteFunctionDeploymentPayloadSelect = { + clientMutationId?: boolean; + functionDeployment?: { + select: FunctionDeploymentSelect; + }; + functionDeploymentEdge?: { + select: FunctionDeploymentEdgeSelect; + }; +}; +export interface CreateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was created by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type CreateFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface UpdateFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was updated by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type UpdateFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface DeleteFunctionGraphRefPayload { + clientMutationId?: string | null; + /** The `FunctionGraphRef` that was deleted by this mutation. */ + functionGraphRef?: FunctionGraphRef | null; + functionGraphRefEdge?: FunctionGraphRefEdge | null; +} +export type DeleteFunctionGraphRefPayloadSelect = { + clientMutationId?: boolean; + functionGraphRef?: { + select: FunctionGraphRefSelect; + }; + functionGraphRefEdge?: { + select: FunctionGraphRefEdgeSelect; + }; +}; +export interface CreateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was created by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type CreateFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface UpdateFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was updated by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type UpdateFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface DeleteFunctionGraphStorePayload { + clientMutationId?: string | null; + /** The `FunctionGraphStore` that was deleted by this mutation. */ + functionGraphStore?: FunctionGraphStore | null; + functionGraphStoreEdge?: FunctionGraphStoreEdge | null; +} +export type DeleteFunctionGraphStorePayloadSelect = { + clientMutationId?: boolean; + functionGraphStore?: { + select: FunctionGraphStoreSelect; + }; + functionGraphStoreEdge?: { + select: FunctionGraphStoreEdgeSelect; + }; +}; +export interface CreateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was created by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type CreateFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface UpdateFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was updated by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type UpdateFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface DeleteFunctionGraphObjectPayload { + clientMutationId?: string | null; + /** The `FunctionGraphObject` that was deleted by this mutation. */ + functionGraphObject?: FunctionGraphObject | null; + functionGraphObjectEdge?: FunctionGraphObjectEdge | null; +} +export type DeleteFunctionGraphObjectPayloadSelect = { + clientMutationId?: boolean; + functionGraphObject?: { + select: FunctionGraphObjectSelect; + }; + functionGraphObjectEdge?: { + select: FunctionGraphObjectEdgeSelect; + }; +}; +export interface CreateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was created by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type CreateFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was updated by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type UpdateFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentEventPayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentEvent` that was deleted by this mutation. */ + functionDeploymentEvent?: FunctionDeploymentEvent | null; + functionDeploymentEventEdge?: FunctionDeploymentEventEdge | null; +} +export type DeleteFunctionDeploymentEventPayloadSelect = { + clientMutationId?: boolean; + functionDeploymentEvent?: { + select: FunctionDeploymentEventSelect; + }; + functionDeploymentEventEdge?: { + select: FunctionDeploymentEventEdgeSelect; + }; +}; +export interface CreateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was created by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type CreateOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface UpdateOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was updated by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type UpdateOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface DeleteOrgFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `OrgFunctionExecutionLog` that was deleted by this mutation. */ + orgFunctionExecutionLog?: OrgFunctionExecutionLog | null; + orgFunctionExecutionLogEdge?: OrgFunctionExecutionLogEdge | null; +} +export type DeleteOrgFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + orgFunctionExecutionLog?: { + select: OrgFunctionExecutionLogSelect; + }; + orgFunctionExecutionLogEdge?: { + select: OrgFunctionExecutionLogEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was created by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type CreateFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was updated by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type UpdateFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionOutputPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionOutput` that was deleted by this mutation. */ + functionGraphExecutionOutput?: FunctionGraphExecutionOutput | null; + functionGraphExecutionOutputEdge?: FunctionGraphExecutionOutputEdge | null; +} +export type DeleteFunctionGraphExecutionOutputPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionOutput?: { + select: FunctionGraphExecutionOutputSelect; + }; + functionGraphExecutionOutputEdge?: { + select: FunctionGraphExecutionOutputEdgeSelect; + }; +}; +export interface CreateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was created by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type CreateFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface UpdateFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was updated by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type UpdateFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface DeleteFunctionGraphCommitPayload { + clientMutationId?: string | null; + /** The `FunctionGraphCommit` that was deleted by this mutation. */ + functionGraphCommit?: FunctionGraphCommit | null; + functionGraphCommitEdge?: FunctionGraphCommitEdge | null; +} +export type DeleteFunctionGraphCommitPayloadSelect = { + clientMutationId?: boolean; + functionGraphCommit?: { + select: FunctionGraphCommitSelect; + }; + functionGraphCommitEdge?: { + select: FunctionGraphCommitEdgeSelect; + }; +}; +export interface CreateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was created by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type CreateSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface UpdateSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was updated by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type UpdateSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface DeleteSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `SecretDefinition` that was deleted by this mutation. */ + secretDefinition?: SecretDefinition | null; + secretDefinitionEdge?: SecretDefinitionEdge | null; +} +export type DeleteSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + secretDefinition?: { + select: SecretDefinitionSelect; + }; + secretDefinitionEdge?: { + select: SecretDefinitionEdgeSelect; + }; +}; +export interface CreateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was created by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type CreateFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface UpdateFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was updated by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type UpdateFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface DeleteFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `FunctionExecutionLog` that was deleted by this mutation. */ + functionExecutionLog?: FunctionExecutionLog | null; + functionExecutionLogEdge?: FunctionExecutionLogEdge | null; +} +export type DeleteFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + functionExecutionLog?: { + select: FunctionExecutionLogSelect; + }; + functionExecutionLogEdge?: { + select: FunctionExecutionLogEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was created by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type CreateFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was updated by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type UpdateFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was deleted by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} +export type DeleteFunctionGraphExecutionNodeStatePayloadSelect = { + clientMutationId?: boolean; + functionGraphExecutionNodeState?: { + select: FunctionGraphExecutionNodeStateSelect; + }; + functionGraphExecutionNodeStateEdge?: { + select: FunctionGraphExecutionNodeStateEdgeSelect; + }; +}; +export interface CreateFunctionGraphPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface UpdateFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was updated by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export type UpdateFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + functionGraph?: { + select: FunctionGraphSelect; + }; + functionGraphEdge?: { + select: FunctionGraphEdgeSelect; + }; +}; +export interface DeleteFunctionGraphPayload { + clientMutationId?: string | null; + /** The `FunctionGraph` that was deleted by this mutation. */ + functionGraph?: FunctionGraph | null; + functionGraphEdge?: FunctionGraphEdge | null; +} +export type DeleteFunctionGraphPayloadSelect = { + clientMutationId?: boolean; + functionGraph?: { + select: FunctionGraphSelect; + }; + functionGraphEdge?: { + select: FunctionGraphEdgeSelect; + }; +}; +export interface CreateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was created by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type CreateOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface UpdateOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was updated by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type UpdateOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface DeleteOrgFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `OrgFunctionInvocation` that was deleted by this mutation. */ + orgFunctionInvocation?: OrgFunctionInvocation | null; + orgFunctionInvocationEdge?: OrgFunctionInvocationEdge | null; +} +export type DeleteOrgFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + orgFunctionInvocation?: { + select: OrgFunctionInvocationSelect; + }; + orgFunctionInvocationEdge?: { + select: OrgFunctionInvocationEdgeSelect; + }; +}; +export interface CreateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was created by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type CreateFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface UpdateFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was updated by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type UpdateFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface DeleteFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `FunctionInvocation` that was deleted by this mutation. */ + functionInvocation?: FunctionInvocation | null; + functionInvocationEdge?: FunctionInvocationEdge | null; +} +export type DeleteFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + functionInvocation?: { + select: FunctionInvocationSelect; + }; + functionInvocationEdge?: { + select: FunctionInvocationEdgeSelect; + }; +}; +export interface CreateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was created by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type CreateFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface UpdateFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was updated by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type UpdateFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface DeleteFunctionGraphExecutionPayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecution` that was deleted by this mutation. */ + functionGraphExecution?: FunctionGraphExecution | null; + functionGraphExecutionEdge?: FunctionGraphExecutionEdge | null; +} +export type DeleteFunctionGraphExecutionPayloadSelect = { + clientMutationId?: boolean; + functionGraphExecution?: { + select: FunctionGraphExecutionSelect; + }; + functionGraphExecutionEdge?: { + select: FunctionGraphExecutionEdgeSelect; + }; +}; +export interface CreateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was created by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type CreateFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +export interface UpdateFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was updated by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type UpdateFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +export interface DeleteFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `FunctionDefinition` that was deleted by this mutation. */ + functionDefinition?: FunctionDefinition | null; + functionDefinitionEdge?: FunctionDefinitionEdge | null; +} +export type DeleteFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + functionDefinition?: { + select: FunctionDefinitionSelect; + }; + functionDefinitionEdge?: { + select: FunctionDefinitionEdgeSelect; + }; +}; +/** A `FunctionApiBinding` edge in the connection. */ +export interface FunctionApiBindingEdge { + cursor?: string | null; + /** The `FunctionApiBinding` at the end of the edge. */ + node?: FunctionApiBinding | null; +} +export type FunctionApiBindingEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionApiBindingSelect; + }; +}; +/** A `FunctionDeployment` edge in the connection. */ +export interface FunctionDeploymentEdge { + cursor?: string | null; + /** The `FunctionDeployment` at the end of the edge. */ + node?: FunctionDeployment | null; +} +export type FunctionDeploymentEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentSelect; + }; +}; +/** A `FunctionGraphRef` edge in the connection. */ +export interface FunctionGraphRefEdge { + cursor?: string | null; + /** The `FunctionGraphRef` at the end of the edge. */ + node?: FunctionGraphRef | null; +} +export type FunctionGraphRefEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphRefSelect; + }; +}; +/** A `FunctionGraphStore` edge in the connection. */ +export interface FunctionGraphStoreEdge { + cursor?: string | null; + /** The `FunctionGraphStore` at the end of the edge. */ + node?: FunctionGraphStore | null; +} +export type FunctionGraphStoreEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphStoreSelect; + }; +}; +/** A `FunctionGraphObject` edge in the connection. */ +export interface FunctionGraphObjectEdge { + cursor?: string | null; + /** The `FunctionGraphObject` at the end of the edge. */ + node?: FunctionGraphObject | null; +} +export type FunctionGraphObjectEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphObjectSelect; + }; +}; +/** A `FunctionDeploymentEvent` edge in the connection. */ +export interface FunctionDeploymentEventEdge { + cursor?: string | null; + /** The `FunctionDeploymentEvent` at the end of the edge. */ + node?: FunctionDeploymentEvent | null; +} +export type FunctionDeploymentEventEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentEventSelect; + }; +}; +/** A `OrgFunctionExecutionLog` edge in the connection. */ +export interface OrgFunctionExecutionLogEdge { + cursor?: string | null; + /** The `OrgFunctionExecutionLog` at the end of the edge. */ + node?: OrgFunctionExecutionLog | null; +} +export type OrgFunctionExecutionLogEdgeSelect = { + cursor?: boolean; + node?: { + select: OrgFunctionExecutionLogSelect; + }; +}; +/** A `FunctionGraphExecutionOutput` edge in the connection. */ +export interface FunctionGraphExecutionOutputEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionOutput` at the end of the edge. */ + node?: FunctionGraphExecutionOutput | null; +} +export type FunctionGraphExecutionOutputEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionOutputSelect; + }; +}; +/** A `FunctionGraphCommit` edge in the connection. */ +export interface FunctionGraphCommitEdge { + cursor?: string | null; + /** The `FunctionGraphCommit` at the end of the edge. */ + node?: FunctionGraphCommit | null; +} +export type FunctionGraphCommitEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphCommitSelect; + }; +}; +/** A `SecretDefinition` edge in the connection. */ +export interface SecretDefinitionEdge { + cursor?: string | null; + /** The `SecretDefinition` at the end of the edge. */ + node?: SecretDefinition | null; +} +export type SecretDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: SecretDefinitionSelect; + }; +}; +/** A `FunctionExecutionLog` edge in the connection. */ +export interface FunctionExecutionLogEdge { + cursor?: string | null; + /** The `FunctionExecutionLog` at the end of the edge. */ + node?: FunctionExecutionLog | null; +} +export type FunctionExecutionLogEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionExecutionLogSelect; + }; +}; +/** A `FunctionGraphExecutionNodeState` edge in the connection. */ +export interface FunctionGraphExecutionNodeStateEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionNodeState` at the end of the edge. */ + node?: FunctionGraphExecutionNodeState | null; +} +export type FunctionGraphExecutionNodeStateEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionNodeStateSelect; + }; +}; +/** A `FunctionGraph` edge in the connection. */ +export interface FunctionGraphEdge { + cursor?: string | null; + /** The `FunctionGraph` at the end of the edge. */ + node?: FunctionGraph | null; +} +export type FunctionGraphEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphSelect; + }; +}; +/** A `OrgFunctionInvocation` edge in the connection. */ +export interface OrgFunctionInvocationEdge { + cursor?: string | null; + /** The `OrgFunctionInvocation` at the end of the edge. */ + node?: OrgFunctionInvocation | null; +} +export type OrgFunctionInvocationEdgeSelect = { + cursor?: boolean; + node?: { + select: OrgFunctionInvocationSelect; + }; +}; +/** A `FunctionInvocation` edge in the connection. */ +export interface FunctionInvocationEdge { + cursor?: string | null; + /** The `FunctionInvocation` at the end of the edge. */ + node?: FunctionInvocation | null; +} +export type FunctionInvocationEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionInvocationSelect; + }; +}; +/** A `FunctionGraphExecution` edge in the connection. */ +export interface FunctionGraphExecutionEdge { + cursor?: string | null; + /** The `FunctionGraphExecution` at the end of the edge. */ + node?: FunctionGraphExecution | null; +} +export type FunctionGraphExecutionEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionGraphExecutionSelect; + }; +}; +/** A `FunctionDefinition` edge in the connection. */ +export interface FunctionDefinitionEdge { + cursor?: string | null; + /** The `FunctionDefinition` at the end of the edge. */ + node?: FunctionDefinition | null; +} +export type FunctionDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDefinitionSelect; + }; +}; diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionApiBinding.ts b/sdk/constructive-sdk/src/compute/orm/models/functionApiBinding.ts new file mode 100644 index 0000000000..a98f9d2a06 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionApiBinding.ts @@ -0,0 +1,245 @@ +/** + * FunctionApiBinding model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionApiBinding, + FunctionApiBindingWithRelations, + FunctionApiBindingSelect, + FunctionApiBindingFilter, + FunctionApiBindingOrderBy, + CreateFunctionApiBindingInput, + UpdateFunctionApiBindingInput, + FunctionApiBindingPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionApiBindingModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBindings: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBindings', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBinding: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', + document, + variables, + transform: (data: { + functionApiBindings?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionApiBinding: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionApiBinding', + 'functionApiBindings', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionApiBindingFilter', + 'FunctionApiBindingOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionApiBinding', + fieldName: 'functionApiBinding', + document, + variables, + transform: (data: { + functionApiBindings?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionApiBinding: data.functionApiBindings?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionApiBinding', + 'createFunctionApiBinding', + 'functionApiBinding', + args.select, + args.data, + 'CreateFunctionApiBindingInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'createFunctionApiBinding', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionApiBindingPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionApiBinding', + 'updateFunctionApiBinding', + 'functionApiBinding', + args.select, + args.where.id, + args.data, + 'UpdateFunctionApiBindingInput', + 'id', + 'functionApiBindingPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'updateFunctionApiBinding', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionApiBinding: { + functionApiBinding: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionApiBinding', + 'deleteFunctionApiBinding', + 'functionApiBinding', + { + id: args.where.id, + }, + 'DeleteFunctionApiBindingInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionApiBinding', + fieldName: 'deleteFunctionApiBinding', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionDefinition.ts b/sdk/constructive-sdk/src/compute/orm/models/functionDefinition.ts new file mode 100644 index 0000000000..be6cb3ac27 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionDefinition.ts @@ -0,0 +1,245 @@ +/** + * FunctionDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDefinition, + FunctionDefinitionWithRelations, + FunctionDefinitionSelect, + FunctionDefinitionFilter, + FunctionDefinitionOrderBy, + CreateFunctionDefinitionInput, + UpdateFunctionDefinitionInput, + FunctionDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinitions: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', + document, + variables, + transform: (data: { + functionDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDefinition', + 'functionDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDefinitionFilter', + 'FunctionDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDefinition', + fieldName: 'functionDefinition', + document, + variables, + transform: (data: { + functionDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDefinition: data.functionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDefinition', + 'createFunctionDefinition', + 'functionDefinition', + args.select, + args.data, + 'CreateFunctionDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'createFunctionDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDefinition', + 'updateFunctionDefinition', + 'functionDefinition', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDefinitionInput', + 'id', + 'functionDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'updateFunctionDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDefinition: { + functionDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDefinition', + 'deleteFunctionDefinition', + 'functionDefinition', + { + id: args.where.id, + }, + 'DeleteFunctionDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDefinition', + fieldName: 'deleteFunctionDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionDeployment.ts b/sdk/constructive-sdk/src/compute/orm/models/functionDeployment.ts new file mode 100644 index 0000000000..d54820ebba --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionDeployment.ts @@ -0,0 +1,245 @@ +/** + * FunctionDeployment model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeployment, + FunctionDeploymentWithRelations, + FunctionDeploymentSelect, + FunctionDeploymentFilter, + FunctionDeploymentOrderBy, + CreateFunctionDeploymentInput, + UpdateFunctionDeploymentInput, + FunctionDeploymentPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployments: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployments', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployment: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', + document, + variables, + transform: (data: { + functionDeployments?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeployment: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeployment', + 'functionDeployments', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentFilter', + 'FunctionDeploymentOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeployment', + fieldName: 'functionDeployment', + document, + variables, + transform: (data: { + functionDeployments?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeployment: data.functionDeployments?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeployment', + 'createFunctionDeployment', + 'functionDeployment', + args.select, + args.data, + 'CreateFunctionDeploymentInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'createFunctionDeployment', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeployment', + 'updateFunctionDeployment', + 'functionDeployment', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentInput', + 'id', + 'functionDeploymentPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'updateFunctionDeployment', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeployment: { + functionDeployment: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeployment', + 'deleteFunctionDeployment', + 'functionDeployment', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeployment', + fieldName: 'deleteFunctionDeployment', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionDeploymentEvent.ts b/sdk/constructive-sdk/src/compute/orm/models/functionDeploymentEvent.ts new file mode 100644 index 0000000000..6b95be6471 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionDeploymentEvent.ts @@ -0,0 +1,252 @@ +/** + * FunctionDeploymentEvent model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentEvent, + FunctionDeploymentEventWithRelations, + FunctionDeploymentEventSelect, + FunctionDeploymentEventFilter, + FunctionDeploymentEventOrderBy, + CreateFunctionDeploymentEventInput, + UpdateFunctionDeploymentEventInput, + FunctionDeploymentEventPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentEventModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvents: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvents', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvent: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', + document, + variables, + transform: (data: { + functionDeploymentEvents?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentEvent: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentEvent', + 'functionDeploymentEvents', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentEventFilter', + 'FunctionDeploymentEventOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentEvent', + fieldName: 'functionDeploymentEvent', + document, + variables, + transform: (data: { + functionDeploymentEvents?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentEvent: data.functionDeploymentEvents?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentEvent', + 'createFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.data, + 'CreateFunctionDeploymentEventInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'createFunctionDeploymentEvent', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionDeploymentEventPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentEvent', + 'updateFunctionDeploymentEvent', + 'functionDeploymentEvent', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentEventInput', + 'id', + 'functionDeploymentEventPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'updateFunctionDeploymentEvent', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeploymentEvent: { + functionDeploymentEvent: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentEvent', + 'deleteFunctionDeploymentEvent', + 'functionDeploymentEvent', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionDeploymentEventInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentEvent', + fieldName: 'deleteFunctionDeploymentEvent', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionExecutionLog.ts b/sdk/constructive-sdk/src/compute/orm/models/functionExecutionLog.ts new file mode 100644 index 0000000000..a581eeab83 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionExecutionLog.ts @@ -0,0 +1,252 @@ +/** + * FunctionExecutionLog model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionExecutionLog, + FunctionExecutionLogWithRelations, + FunctionExecutionLogSelect, + FunctionExecutionLogFilter, + FunctionExecutionLogOrderBy, + CreateFunctionExecutionLogInput, + UpdateFunctionExecutionLogInput, + FunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionExecutionLogModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLogs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', + document, + variables, + transform: (data: { + functionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionExecutionLog', + 'functionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionExecutionLogFilter', + 'FunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionExecutionLog', + fieldName: 'functionExecutionLog', + document, + variables, + transform: (data: { + functionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionExecutionLog: data.functionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionExecutionLog', + 'createFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.data, + 'CreateFunctionExecutionLogInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'createFunctionExecutionLog', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionExecutionLog', + 'updateFunctionExecutionLog', + 'functionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateFunctionExecutionLogInput', + 'id', + 'functionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'updateFunctionExecutionLog', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionExecutionLog: { + functionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionExecutionLog', + 'deleteFunctionExecutionLog', + 'functionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionExecutionLog', + fieldName: 'deleteFunctionExecutionLog', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraph.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraph.ts new file mode 100644 index 0000000000..8355e31658 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraph.ts @@ -0,0 +1,245 @@ +/** + * FunctionGraph model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraph, + FunctionGraphWithRelations, + FunctionGraphSelect, + FunctionGraphFilter, + FunctionGraphOrderBy, + CreateFunctionGraphInput, + UpdateFunctionGraphInput, + FunctionGraphPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraphs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraph: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', + document, + variables, + transform: (data: { + functionGraphs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraph: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraph', + 'functionGraphs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphFilter', + 'FunctionGraphOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraph', + fieldName: 'functionGraph', + document, + variables, + transform: (data: { + functionGraphs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraph: data.functionGraphs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraph', + 'createFunctionGraph', + 'functionGraph', + args.select, + args.data, + 'CreateFunctionGraphInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'createFunctionGraph', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraph', + 'updateFunctionGraph', + 'functionGraph', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphInput', + 'id', + 'functionGraphPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'updateFunctionGraph', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraph: { + functionGraph: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraph', + 'deleteFunctionGraph', + 'functionGraph', + { + id: args.where.id, + }, + 'DeleteFunctionGraphInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraph', + fieldName: 'deleteFunctionGraph', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphCommit.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphCommit.ts new file mode 100644 index 0000000000..65426339ae --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphCommit.ts @@ -0,0 +1,250 @@ +/** + * FunctionGraphCommit model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphCommit, + FunctionGraphCommitWithRelations, + FunctionGraphCommitSelect, + FunctionGraphCommitFilter, + FunctionGraphCommitOrderBy, + CreateFunctionGraphCommitInput, + UpdateFunctionGraphCommitInput, + FunctionGraphCommitPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphCommitModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommits: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommits', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommit: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', + document, + variables, + transform: (data: { + functionGraphCommits?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphCommit: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphCommit', + 'functionGraphCommits', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphCommitFilter', + 'FunctionGraphCommitOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphCommit', + fieldName: 'functionGraphCommit', + document, + variables, + transform: (data: { + functionGraphCommits?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphCommit: data.functionGraphCommits?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphCommit', + 'createFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.data, + 'CreateFunctionGraphCommitInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'createFunctionGraphCommit', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphCommitPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphCommit', + 'updateFunctionGraphCommit', + 'functionGraphCommit', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphCommitInput', + 'id', + 'functionGraphCommitPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'updateFunctionGraphCommit', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphCommit: { + functionGraphCommit: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphCommit', + 'deleteFunctionGraphCommit', + 'functionGraphCommit', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphCommitInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphCommit', + fieldName: 'deleteFunctionGraphCommit', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecution.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecution.ts new file mode 100644 index 0000000000..36ba0d39b8 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecution.ts @@ -0,0 +1,252 @@ +/** + * FunctionGraphExecution model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecution, + FunctionGraphExecutionWithRelations, + FunctionGraphExecutionSelect, + FunctionGraphExecutionFilter, + FunctionGraphExecutionOrderBy, + CreateFunctionGraphExecutionInput, + UpdateFunctionGraphExecutionInput, + FunctionGraphExecutionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutions: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecutions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecution: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', + document, + variables, + transform: (data: { + functionGraphExecutions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecution: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecution', + 'functionGraphExecutions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionFilter', + 'FunctionGraphExecutionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecution', + fieldName: 'functionGraphExecution', + document, + variables, + transform: (data: { + functionGraphExecutions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecution', + 'createFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.data, + 'CreateFunctionGraphExecutionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'createFunctionGraphExecution', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + startedAt: string; + }, + FunctionGraphExecutionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecution', + 'updateFunctionGraphExecution', + 'functionGraphExecution', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionInput', + 'id', + 'functionGraphExecutionPatch', + connectionFieldsMap, + { + startedAt: args.where.startedAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'updateFunctionGraphExecution', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + startedAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecution: { + functionGraphExecution: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecution', + 'deleteFunctionGraphExecution', + 'functionGraphExecution', + { + id: args.where.id, + startedAt: args.where.startedAt, + }, + 'DeleteFunctionGraphExecutionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecution', + fieldName: 'deleteFunctionGraphExecution', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionNodeState.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionNodeState.ts new file mode 100644 index 0000000000..734317c006 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionNodeState.ts @@ -0,0 +1,278 @@ +/** + * FunctionGraphExecutionNodeState model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionNodeState, + FunctionGraphExecutionNodeStateWithRelations, + FunctionGraphExecutionNodeStateSelect, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy, + CreateFunctionGraphExecutionNodeStateInput, + UpdateFunctionGraphExecutionNodeStateInput, + FunctionGraphExecutionNodeStatePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionNodeStateModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeStates: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeStates', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionNodeStateFilter, + FunctionGraphExecutionNodeStateOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', + document, + variables, + transform: (data: { + functionGraphExecutionNodeStates?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeStates', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionNodeStateFilter', + 'FunctionGraphExecutionNodeStateOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'functionGraphExecutionNodeState', + document, + variables, + transform: (data: { + functionGraphExecutionNodeStates?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionNodeState: data.functionGraphExecutionNodeStates?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs< + S, + CreateFunctionGraphExecutionNodeStateInput['functionGraphExecutionNodeState'] + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionNodeState', + 'createFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.data, + 'CreateFunctionGraphExecutionNodeStateInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'createFunctionGraphExecutionNodeState', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionNodeStatePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionNodeState', + 'updateFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionNodeStateInput', + 'id', + 'functionGraphExecutionNodeStatePatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'updateFunctionGraphExecutionNodeState', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecutionNodeState: { + functionGraphExecutionNodeState: InferSelectResult< + FunctionGraphExecutionNodeStateWithRelations, + S + >; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionNodeState', + 'deleteFunctionGraphExecutionNodeState', + 'functionGraphExecutionNodeState', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionNodeStateInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionNodeState', + fieldName: 'deleteFunctionGraphExecutionNodeState', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionOutput.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionOutput.ts new file mode 100644 index 0000000000..c9a5085e5e --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphExecutionOutput.ts @@ -0,0 +1,266 @@ +/** + * FunctionGraphExecutionOutput model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphExecutionOutput, + FunctionGraphExecutionOutputWithRelations, + FunctionGraphExecutionOutputSelect, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy, + CreateFunctionGraphExecutionOutputInput, + UpdateFunctionGraphExecutionOutputInput, + FunctionGraphExecutionOutputPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphExecutionOutputModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutputs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutputs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs< + S, + FunctionGraphExecutionOutputFilter, + FunctionGraphExecutionOutputOrderBy + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', + document, + variables, + transform: (data: { + functionGraphExecutionOutputs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphExecutionOutput: InferSelectResult< + FunctionGraphExecutionOutputWithRelations, + S + > | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphExecutionOutput', + 'functionGraphExecutionOutputs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphExecutionOutputFilter', + 'FunctionGraphExecutionOutputOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'functionGraphExecutionOutput', + document, + variables, + transform: (data: { + functionGraphExecutionOutputs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphExecutionOutput: data.functionGraphExecutionOutputs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphExecutionOutput', + 'createFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.data, + 'CreateFunctionGraphExecutionOutputInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'createFunctionGraphExecutionOutput', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionGraphExecutionOutputPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphExecutionOutput', + 'updateFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphExecutionOutputInput', + 'id', + 'functionGraphExecutionOutputPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'updateFunctionGraphExecutionOutput', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphExecutionOutput: { + functionGraphExecutionOutput: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphExecutionOutput', + 'deleteFunctionGraphExecutionOutput', + 'functionGraphExecutionOutput', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionGraphExecutionOutputInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphExecutionOutput', + fieldName: 'deleteFunctionGraphExecutionOutput', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphObject.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphObject.ts new file mode 100644 index 0000000000..cf946855ac --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphObject.ts @@ -0,0 +1,236 @@ +/** + * FunctionGraphObject model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphObject, + FunctionGraphObjectWithRelations, + FunctionGraphObjectSelect, + FunctionGraphObjectFilter, + FunctionGraphObjectOrderBy, + CreateFunctionGraphObjectInput, + UpdateFunctionGraphObjectInput, + FunctionGraphObjectPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphObjectModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObjects: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObjects', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObject: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphObject', + 'functionGraphObjects', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphObjectFilter', + 'FunctionGraphObjectOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', + document, + variables, + transform: (data: { + functionGraphObjects?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphObject: data.functionGraphObjects?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphObject: InferSelectResult | null; + }> { + const { document, variables } = buildFindOneDocument( + 'FunctionGraphObject', + 'getNodeAtPath', + args.id, + args.select, + 'id', + 'UUID!', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphObject', + fieldName: 'functionGraphObject', + document, + variables, + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphObject', + 'createFunctionGraphObject', + 'functionGraphObject', + args.select, + args.data, + 'CreateFunctionGraphObjectInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'createFunctionGraphObject', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphObjectPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphObject', + 'updateFunctionGraphObject', + 'functionGraphObject', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphObjectInput', + 'id', + 'functionGraphObjectPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'updateFunctionGraphObject', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphObject: { + functionGraphObject: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphObject', + 'deleteFunctionGraphObject', + 'functionGraphObject', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphObjectInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphObject', + fieldName: 'deleteFunctionGraphObject', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphRef.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphRef.ts new file mode 100644 index 0000000000..22d8769625 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphRef.ts @@ -0,0 +1,250 @@ +/** + * FunctionGraphRef model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphRef, + FunctionGraphRefWithRelations, + FunctionGraphRefSelect, + FunctionGraphRefFilter, + FunctionGraphRefOrderBy, + CreateFunctionGraphRefInput, + UpdateFunctionGraphRefInput, + FunctionGraphRefPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphRefModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRefs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRefs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRef: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', + document, + variables, + transform: (data: { + functionGraphRefs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphRef: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphRef', + 'functionGraphRefs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphRefFilter', + 'FunctionGraphRefOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphRef', + fieldName: 'functionGraphRef', + document, + variables, + transform: (data: { + functionGraphRefs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphRef: data.functionGraphRefs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphRef', + 'createFunctionGraphRef', + 'functionGraphRef', + args.select, + args.data, + 'CreateFunctionGraphRefInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'createFunctionGraphRef', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + databaseId: string; + }, + FunctionGraphRefPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphRef', + 'updateFunctionGraphRef', + 'functionGraphRef', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphRefInput', + 'id', + 'functionGraphRefPatch', + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'updateFunctionGraphRef', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + databaseId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphRef: { + functionGraphRef: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphRef', + 'deleteFunctionGraphRef', + 'functionGraphRef', + { + id: args.where.id, + databaseId: args.where.databaseId, + }, + 'DeleteFunctionGraphRefInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphRef', + fieldName: 'deleteFunctionGraphRef', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionGraphStore.ts b/sdk/constructive-sdk/src/compute/orm/models/functionGraphStore.ts new file mode 100644 index 0000000000..6d1f384449 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionGraphStore.ts @@ -0,0 +1,245 @@ +/** + * FunctionGraphStore model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionGraphStore, + FunctionGraphStoreWithRelations, + FunctionGraphStoreSelect, + FunctionGraphStoreFilter, + FunctionGraphStoreOrderBy, + CreateFunctionGraphStoreInput, + UpdateFunctionGraphStoreInput, + FunctionGraphStorePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionGraphStoreModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStores: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStores', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStore: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', + document, + variables, + transform: (data: { + functionGraphStores?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionGraphStore: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionGraphStore', + 'functionGraphStores', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionGraphStoreFilter', + 'FunctionGraphStoreOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionGraphStore', + fieldName: 'functionGraphStore', + document, + variables, + transform: (data: { + functionGraphStores?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionGraphStore: data.functionGraphStores?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionGraphStore', + 'createFunctionGraphStore', + 'functionGraphStore', + args.select, + args.data, + 'CreateFunctionGraphStoreInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'createFunctionGraphStore', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionGraphStorePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionGraphStore', + 'updateFunctionGraphStore', + 'functionGraphStore', + args.select, + args.where.id, + args.data, + 'UpdateFunctionGraphStoreInput', + 'id', + 'functionGraphStorePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'updateFunctionGraphStore', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionGraphStore: { + functionGraphStore: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionGraphStore', + 'deleteFunctionGraphStore', + 'functionGraphStore', + { + id: args.where.id, + }, + 'DeleteFunctionGraphStoreInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionGraphStore', + fieldName: 'deleteFunctionGraphStore', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/functionInvocation.ts b/sdk/constructive-sdk/src/compute/orm/models/functionInvocation.ts new file mode 100644 index 0000000000..3589bf5a1d --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/functionInvocation.ts @@ -0,0 +1,250 @@ +/** + * FunctionInvocation model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionInvocation, + FunctionInvocationWithRelations, + FunctionInvocationSelect, + FunctionInvocationFilter, + FunctionInvocationOrderBy, + CreateFunctionInvocationInput, + UpdateFunctionInvocationInput, + FunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionInvocationModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocations: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocations', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', + document, + variables, + transform: (data: { + functionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionInvocation', + 'functionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionInvocationFilter', + 'FunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionInvocation', + fieldName: 'functionInvocation', + document, + variables, + transform: (data: { + functionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionInvocation: data.functionInvocations?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionInvocation', + 'createFunctionInvocation', + 'functionInvocation', + args.select, + args.data, + 'CreateFunctionInvocationInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'createFunctionInvocation', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + FunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionInvocation', + 'updateFunctionInvocation', + 'functionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateFunctionInvocationInput', + 'id', + 'functionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'updateFunctionInvocation', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionInvocation: { + functionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionInvocation', + 'deleteFunctionInvocation', + 'functionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteFunctionInvocationInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionInvocation', + fieldName: 'deleteFunctionInvocation', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/getAllRecord.ts b/sdk/constructive-sdk/src/compute/orm/models/getAllRecord.ts new file mode 100644 index 0000000000..39a82fbbba --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/getAllRecord.ts @@ -0,0 +1,134 @@ +/** + * GetAllRecord model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GetAllRecord, + GetAllRecordWithRelations, + GetAllRecordSelect, + GetAllRecordFilter, + GetAllRecordsOrderBy, + CreateGetAllRecordInput, + UpdateGetAllRecordInput, + GetAllRecordPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class GetAllRecordModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + getAll: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'GetAllRecord', + 'getAll', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GetAllRecordFilter', + 'GetAllRecordsOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GetAllRecord', + fieldName: 'getAll', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + getAllRecord: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'GetAllRecord', + 'getAll', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GetAllRecordFilter', + 'GetAllRecordsOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GetAllRecord', + fieldName: 'getAllRecord', + document, + variables, + transform: (data: { + getAll?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + getAllRecord: data.getAll?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createGetAllRecord: { + getAllRecord: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'GetAllRecord', + 'createGetAllRecord', + 'getAllRecord', + args.select, + args.data, + 'CreateGetAllRecordInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GetAllRecord', + fieldName: 'createGetAllRecord', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/index.ts b/sdk/constructive-sdk/src/compute/orm/models/index.ts new file mode 100644 index 0000000000..51e9b9f05d --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/index.ts @@ -0,0 +1,23 @@ +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export { GetAllRecordModel } from './getAllRecord'; +export { FunctionApiBindingModel } from './functionApiBinding'; +export { FunctionDeploymentModel } from './functionDeployment'; +export { FunctionGraphRefModel } from './functionGraphRef'; +export { FunctionGraphStoreModel } from './functionGraphStore'; +export { FunctionGraphObjectModel } from './functionGraphObject'; +export { FunctionDeploymentEventModel } from './functionDeploymentEvent'; +export { OrgFunctionExecutionLogModel } from './orgFunctionExecutionLog'; +export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutput'; +export { FunctionGraphCommitModel } from './functionGraphCommit'; +export { SecretDefinitionModel } from './secretDefinition'; +export { FunctionExecutionLogModel } from './functionExecutionLog'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; +export { FunctionGraphModel } from './functionGraph'; +export { OrgFunctionInvocationModel } from './orgFunctionInvocation'; +export { FunctionInvocationModel } from './functionInvocation'; +export { FunctionGraphExecutionModel } from './functionGraphExecution'; +export { FunctionDefinitionModel } from './functionDefinition'; diff --git a/sdk/constructive-sdk/src/compute/orm/models/orgFunctionExecutionLog.ts b/sdk/constructive-sdk/src/compute/orm/models/orgFunctionExecutionLog.ts new file mode 100644 index 0000000000..95b37a939d --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/orgFunctionExecutionLog.ts @@ -0,0 +1,252 @@ +/** + * OrgFunctionExecutionLog model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + OrgFunctionExecutionLog, + OrgFunctionExecutionLogWithRelations, + OrgFunctionExecutionLogSelect, + OrgFunctionExecutionLogFilter, + OrgFunctionExecutionLogOrderBy, + CreateOrgFunctionExecutionLogInput, + UpdateOrgFunctionExecutionLogInput, + OrgFunctionExecutionLogPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgFunctionExecutionLogModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLogs: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLogs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLog', + document, + variables, + transform: (data: { + orgFunctionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionExecutionLog: data.orgFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionExecutionLog: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionExecutionLog', + 'orgFunctionExecutionLogs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgFunctionExecutionLogFilter', + 'OrgFunctionExecutionLogOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'orgFunctionExecutionLog', + document, + variables, + transform: (data: { + orgFunctionExecutionLogs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionExecutionLog: data.orgFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgFunctionExecutionLog', + 'createOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + args.select, + args.data, + 'CreateOrgFunctionExecutionLogInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'createOrgFunctionExecutionLog', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgFunctionExecutionLogPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'OrgFunctionExecutionLog', + 'updateOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + args.select, + args.where.id, + args.data, + 'UpdateOrgFunctionExecutionLogInput', + 'id', + 'orgFunctionExecutionLogPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'updateOrgFunctionExecutionLog', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteOrgFunctionExecutionLog: { + orgFunctionExecutionLog: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'OrgFunctionExecutionLog', + 'deleteOrgFunctionExecutionLog', + 'orgFunctionExecutionLog', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgFunctionExecutionLogInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionExecutionLog', + fieldName: 'deleteOrgFunctionExecutionLog', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/orgFunctionInvocation.ts b/sdk/constructive-sdk/src/compute/orm/models/orgFunctionInvocation.ts new file mode 100644 index 0000000000..3f3eaab557 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/orgFunctionInvocation.ts @@ -0,0 +1,252 @@ +/** + * OrgFunctionInvocation model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + OrgFunctionInvocation, + OrgFunctionInvocationWithRelations, + OrgFunctionInvocationSelect, + OrgFunctionInvocationFilter, + OrgFunctionInvocationOrderBy, + CreateOrgFunctionInvocationInput, + UpdateOrgFunctionInvocationInput, + OrgFunctionInvocationPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgFunctionInvocationModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocations: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocations', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocation', + document, + variables, + transform: (data: { + orgFunctionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionInvocation: data.orgFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgFunctionInvocation: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgFunctionInvocation', + 'orgFunctionInvocations', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgFunctionInvocationFilter', + 'OrgFunctionInvocationOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgFunctionInvocation', + fieldName: 'orgFunctionInvocation', + document, + variables, + transform: (data: { + orgFunctionInvocations?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgFunctionInvocation: data.orgFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgFunctionInvocation', + 'createOrgFunctionInvocation', + 'orgFunctionInvocation', + args.select, + args.data, + 'CreateOrgFunctionInvocationInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'createOrgFunctionInvocation', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + createdAt: string; + }, + OrgFunctionInvocationPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'OrgFunctionInvocation', + 'updateOrgFunctionInvocation', + 'orgFunctionInvocation', + args.select, + args.where.id, + args.data, + 'UpdateOrgFunctionInvocationInput', + 'id', + 'orgFunctionInvocationPatch', + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'updateOrgFunctionInvocation', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + createdAt: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteOrgFunctionInvocation: { + orgFunctionInvocation: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'OrgFunctionInvocation', + 'deleteOrgFunctionInvocation', + 'orgFunctionInvocation', + { + id: args.where.id, + createdAt: args.where.createdAt, + }, + 'DeleteOrgFunctionInvocationInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgFunctionInvocation', + fieldName: 'deleteOrgFunctionInvocation', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/models/secretDefinition.ts b/sdk/constructive-sdk/src/compute/orm/models/secretDefinition.ts new file mode 100644 index 0000000000..09b9a0b956 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/models/secretDefinition.ts @@ -0,0 +1,245 @@ +/** + * SecretDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + SecretDefinition, + SecretDefinitionWithRelations, + SecretDefinitionSelect, + SecretDefinitionFilter, + SecretDefinitionOrderBy, + CreateSecretDefinitionInput, + UpdateSecretDefinitionInput, + SecretDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class SecretDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinitions: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinition', + document, + variables, + transform: (data: { + secretDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + secretDefinition: data.secretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + secretDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'SecretDefinition', + 'secretDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'SecretDefinitionFilter', + 'SecretDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'SecretDefinition', + fieldName: 'secretDefinition', + document, + variables, + transform: (data: { + secretDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + secretDefinition: data.secretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'SecretDefinition', + 'createSecretDefinition', + 'secretDefinition', + args.select, + args.data, + 'CreateSecretDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'createSecretDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + SecretDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'SecretDefinition', + 'updateSecretDefinition', + 'secretDefinition', + args.select, + args.where.id, + args.data, + 'UpdateSecretDefinitionInput', + 'id', + 'secretDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'updateSecretDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteSecretDefinition: { + secretDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'SecretDefinition', + 'deleteSecretDefinition', + 'secretDefinition', + { + id: args.where.id, + }, + 'DeleteSecretDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'SecretDefinition', + fieldName: 'deleteSecretDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/mutation/index.ts b/sdk/constructive-sdk/src/compute/orm/mutation/index.ts new file mode 100644 index 0000000000..b4abf9132b --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/mutation/index.ts @@ -0,0 +1,512 @@ +/** + * Custom mutation operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + ValidateFunctionGraphInput, + InitEmptyRepoInput, + SetDataAtPathInput, + ImportDefinitionsInput, + CopyGraphInput, + SaveGraphInput, + AddEdgeAndSaveInput, + AddNodeAndSaveInput, + AddEdgeInput, + AddNodeInput, + ImportGraphJsonInput, + InsertNodeAtPathInput, + StartExecutionInput, + ProvisionBucketInput, + ValidateFunctionGraphPayload, + InitEmptyRepoPayload, + SetDataAtPathPayload, + ImportDefinitionsPayload, + CopyGraphPayload, + SaveGraphPayload, + AddEdgeAndSavePayload, + AddNodeAndSavePayload, + AddEdgePayload, + AddNodePayload, + ImportGraphJsonPayload, + InsertNodeAtPathPayload, + StartExecutionPayload, + ProvisionBucketPayload, + ValidateFunctionGraphPayloadSelect, + InitEmptyRepoPayloadSelect, + SetDataAtPathPayloadSelect, + ImportDefinitionsPayloadSelect, + CopyGraphPayloadSelect, + SaveGraphPayloadSelect, + AddEdgeAndSavePayloadSelect, + AddNodeAndSavePayloadSelect, + AddEdgePayloadSelect, + AddNodePayloadSelect, + ImportGraphJsonPayloadSelect, + InsertNodeAtPathPayloadSelect, + StartExecutionPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export interface ValidateFunctionGraphVariables { + input: ValidateFunctionGraphInput; +} +export interface InitEmptyRepoVariables { + input: InitEmptyRepoInput; +} +export interface SetDataAtPathVariables { + input: SetDataAtPathInput; +} +export interface ImportDefinitionsVariables { + input: ImportDefinitionsInput; +} +export interface CopyGraphVariables { + input: CopyGraphInput; +} +export interface SaveGraphVariables { + input: SaveGraphInput; +} +export interface AddEdgeAndSaveVariables { + input: AddEdgeAndSaveInput; +} +export interface AddNodeAndSaveVariables { + input: AddNodeAndSaveInput; +} +export interface AddEdgeVariables { + input: AddEdgeInput; +} +export interface AddNodeVariables { + input: AddNodeInput; +} +export interface ImportGraphJsonVariables { + input: ImportGraphJsonInput; +} +export interface InsertNodeAtPathVariables { + input: InsertNodeAtPathInput; +} +export interface StartExecutionVariables { + input: StartExecutionInput; +} +/** + * Variables for provisionBucket + * Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + */ +export interface ProvisionBucketVariables { + input: ProvisionBucketInput; +} +export function createMutationOperations(client: OrmClient) { + return { + validateFunctionGraph: ( + args: ValidateFunctionGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + validateFunctionGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ValidateFunctionGraph', + fieldName: 'validateFunctionGraph', + ...buildCustomDocument( + 'mutation', + 'ValidateFunctionGraph', + 'validateFunctionGraph', + options.select, + args, + [ + { + name: 'input', + type: 'ValidateFunctionGraphInput!', + }, + ], + connectionFieldsMap, + 'ValidateFunctionGraphPayload' + ), + }), + initEmptyRepo: ( + args: InitEmptyRepoVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + initEmptyRepo: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InitEmptyRepo', + fieldName: 'initEmptyRepo', + ...buildCustomDocument( + 'mutation', + 'InitEmptyRepo', + 'initEmptyRepo', + options.select, + args, + [ + { + name: 'input', + type: 'InitEmptyRepoInput!', + }, + ], + connectionFieldsMap, + 'InitEmptyRepoPayload' + ), + }), + setDataAtPath: ( + args: SetDataAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + setDataAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SetDataAtPath', + fieldName: 'setDataAtPath', + ...buildCustomDocument( + 'mutation', + 'SetDataAtPath', + 'setDataAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'SetDataAtPathInput!', + }, + ], + connectionFieldsMap, + 'SetDataAtPathPayload' + ), + }), + importDefinitions: ( + args: ImportDefinitionsVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importDefinitions: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportDefinitions', + fieldName: 'importDefinitions', + ...buildCustomDocument( + 'mutation', + 'ImportDefinitions', + 'importDefinitions', + options.select, + args, + [ + { + name: 'input', + type: 'ImportDefinitionsInput!', + }, + ], + connectionFieldsMap, + 'ImportDefinitionsPayload' + ), + }), + copyGraph: ( + args: CopyGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + copyGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CopyGraph', + fieldName: 'copyGraph', + ...buildCustomDocument( + 'mutation', + 'CopyGraph', + 'copyGraph', + options.select, + args, + [ + { + name: 'input', + type: 'CopyGraphInput!', + }, + ], + connectionFieldsMap, + 'CopyGraphPayload' + ), + }), + saveGraph: ( + args: SaveGraphVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + saveGraph: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'SaveGraph', + fieldName: 'saveGraph', + ...buildCustomDocument( + 'mutation', + 'SaveGraph', + 'saveGraph', + options.select, + args, + [ + { + name: 'input', + type: 'SaveGraphInput!', + }, + ], + connectionFieldsMap, + 'SaveGraphPayload' + ), + }), + addEdgeAndSave: ( + args: AddEdgeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdgeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdgeAndSave', + fieldName: 'addEdgeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddEdgeAndSave', + 'addEdgeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddEdgeAndSavePayload' + ), + }), + addNodeAndSave: ( + args: AddNodeAndSaveVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNodeAndSave: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNodeAndSave', + fieldName: 'addNodeAndSave', + ...buildCustomDocument( + 'mutation', + 'AddNodeAndSave', + 'addNodeAndSave', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeAndSaveInput!', + }, + ], + connectionFieldsMap, + 'AddNodeAndSavePayload' + ), + }), + addEdge: ( + args: AddEdgeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addEdge: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddEdge', + fieldName: 'addEdge', + ...buildCustomDocument( + 'mutation', + 'AddEdge', + 'addEdge', + options.select, + args, + [ + { + name: 'input', + type: 'AddEdgeInput!', + }, + ], + connectionFieldsMap, + 'AddEdgePayload' + ), + }), + addNode: ( + args: AddNodeVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + addNode: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'AddNode', + fieldName: 'addNode', + ...buildCustomDocument( + 'mutation', + 'AddNode', + 'addNode', + options.select, + args, + [ + { + name: 'input', + type: 'AddNodeInput!', + }, + ], + connectionFieldsMap, + 'AddNodePayload' + ), + }), + importGraphJson: ( + args: ImportGraphJsonVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + importGraphJson: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ImportGraphJson', + fieldName: 'importGraphJson', + ...buildCustomDocument( + 'mutation', + 'ImportGraphJson', + 'importGraphJson', + options.select, + args, + [ + { + name: 'input', + type: 'ImportGraphJsonInput!', + }, + ], + connectionFieldsMap, + 'ImportGraphJsonPayload' + ), + }), + insertNodeAtPath: ( + args: InsertNodeAtPathVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + insertNodeAtPath: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'InsertNodeAtPath', + fieldName: 'insertNodeAtPath', + ...buildCustomDocument( + 'mutation', + 'InsertNodeAtPath', + 'insertNodeAtPath', + options.select, + args, + [ + { + name: 'input', + type: 'InsertNodeAtPathInput!', + }, + ], + connectionFieldsMap, + 'InsertNodeAtPathPayload' + ), + }), + startExecution: ( + args: StartExecutionVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + startExecution: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'StartExecution', + fieldName: 'startExecution', + ...buildCustomDocument( + 'mutation', + 'StartExecution', + 'startExecution', + options.select, + args, + [ + { + name: 'input', + type: 'StartExecutionInput!', + }, + ], + connectionFieldsMap, + 'StartExecutionPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + }; +} diff --git a/sdk/constructive-sdk/src/compute/orm/query-builder.ts b/sdk/constructive-sdk/src/compute/orm/query-builder.ts new file mode 100644 index 0000000000..fd785bbae6 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/query-builder.ts @@ -0,0 +1,1047 @@ +/** + * Query Builder - Builds and executes GraphQL operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { parseType, print } from '@constructive-io/graphql-query/runtime'; +import * as t from 'gql-ast'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; + +import { GraphQLRequestError, OrmClient, QueryResult } from './client'; + +export interface QueryBuilderConfig { + client: OrmClient; + operation: 'query' | 'mutation'; + operationName: string; + fieldName: string; + document: string; + variables?: Record; + transform?: (data: any) => TResult; +} + +export class QueryBuilder { + private config: QueryBuilderConfig; + + constructor(config: QueryBuilderConfig) { + this.config = config; + } + + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + async execute(): Promise> { + const rawResult = await this.config.client.execute( + this.config.document, + this.config.variables + ); + if (!rawResult.ok) { + return rawResult; + } + if (!this.config.transform) { + return rawResult as unknown as QueryResult; + } + return { + ok: true, + data: this.config.transform(rawResult.data), + errors: undefined, + }; + } + + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + async unwrap(): Promise { + const result = await this.execute(); + if (!result.ok) { + throw new GraphQLRequestError(result.errors, result.data); + } + return result.data; + } + + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + async unwrapOr(defaultValue: D): Promise { + const result = await this.execute(); + if (!result.ok) { + return defaultValue; + } + return result.data; + } + + /** + * Execute and unwrap, calling onError callback on failure + */ + async unwrapOrElse( + onError: (errors: import('./client').GraphQLError[]) => D + ): Promise { + const result = await this.execute(); + if (!result.ok) { + return onError(result.errors); + } + return result.data; + } + + toGraphQL(): string { + return this.config.document; + } + + getVariables(): Record | undefined { + return this.config.variables; + } +} + +const OP_QUERY = 'query' as unknown as import('graphql').OperationTypeNode; +const OP_MUTATION = 'mutation' as unknown as import('graphql').OperationTypeNode; +const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; + +// ============================================================================ +// Selection Builders +// ============================================================================ + +export function buildSelections( + select: Record | undefined, + connectionFieldsMap?: Record>, + entityType?: string +): FieldNode[] { + if (!select) { + return []; + } + + const fields: FieldNode[] = []; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; + + for (const [key, value] of Object.entries(select)) { + if (value === false || value === undefined) { + continue; + } + + if (value === true) { + fields.push(t.field({ name: key })); + continue; + } + + if (typeof value === 'object' && value !== null) { + const nested = value as { + select?: Record; + args?: Record; + first?: number; + filter?: Record; + orderBy?: string[]; + connection?: boolean; + }; + + // Field with arguments (e.g. requestUploadUrl on bucket types) + if (nested.args && typeof nested.args === 'object') { + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) + ); + const nestedSelect = nested.select; + if (nestedSelect && typeof nestedSelect === 'object') { + const subSelections = Object.entries(nestedSelect) + .filter(([, v]) => v) + .map(([name]) => t.field({ name })); + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: subSelections.length + ? t.selectionSet({ selections: subSelections }) + : undefined, + }) + ); + } else { + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + }) + ); + } + continue; + } + + if (!nested.select || typeof nested.select !== 'object') { + throw new Error( + `Invalid selection for field "${key}": nested selections must include a "select" object.` + ); + } + + const relatedEntityType = entityConnections?.[key]; + const nestedSelections = buildSelections( + nested.select, + connectionFieldsMap, + relatedEntityType + ); + const isConnection = + nested.connection === true || + nested.first !== undefined || + nested.filter !== undefined || + relatedEntityType !== undefined; + const args = buildArgs([ + buildOptionalArg('first', nested.first), + nested.filter + ? t.argument({ + name: 'filter', + value: buildValueAst(nested.filter), + }) + : null, + buildEnumListArg('orderBy', nested.orderBy), + ]); + + if (isConnection) { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(nestedSelections), + }), + }) + ); + } else { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ selections: nestedSelections }), + }) + ); + } + } + } + + return fields; +} + +// ============================================================================ +// Document Builders +// ============================================================================ + +export function buildFindManyDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { + where?: TWhere; + orderBy?: string[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; + }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'first', typeName: 'Int', value: args.first }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'last', typeName: 'Int', value: args.last }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'after', typeName: 'Cursor', value: args.after }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'before', typeName: 'Cursor', value: args.before }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'offset', typeName: 'Int', value: args.offset }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs.length ? queryArgs : undefined, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(selections), + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildFindFirstDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { where?: TWhere; orderBy?: string[] }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + // Always add first: 1 for findFirst + addVariable( + { varName: 'first', typeName: 'Int', value: 1 }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildCreateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [entityField]: data, + }, + }, + }; +} + +export function buildUpdateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + patchFieldName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + id: where.id, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildUpdateByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + id: string | number, + data: TData, + inputTypeName: string, + idFieldName: string, + patchFieldName: string, + connectionFieldsMap?: Record>, + extraKeys?: Record +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [idFieldName]: id, + ...extraKeys, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildFindOneDocument( + operationName: string, + queryField: string, + id: string | number, + select: TSelect, + idArgName: string, + idTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = [ + t.variableDefinition({ + variable: t.variable({ name: idArgName }), + type: parseType(idTypeName), + }), + ]; + + const queryArgs: ArgumentNode[] = [ + t.argument({ + name: idArgName, + value: t.variable({ name: idArgName }), + }), + ]; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: { [idArgName]: id }, + }; +} + +export function buildDeleteDocument( + operationName: string, + mutationField: string, + entityField: string, + where: TWhere, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ + selections: entitySelections, + }), + }), + ], + }), + variables: { + input: { + id: where.id, + }, + }, + }; +} + +export function buildDeleteByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + keys: Record, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections: entitySelections }), + }), + ], + }), + variables: { + input: keys, + }, + }; +} + +export function buildJunctionRemoveDocument( + operationName: string, + mutationField: string, + keys: Record, + inputTypeName: string +): { document: string; variables: Record } { + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [t.field({ name: 'clientMutationId' })], + }), + variables: { + input: keys, + }, + }; +} + +export function buildCustomDocument( + operationType: 'query' | 'mutation', + operationName: string, + fieldName: string, + select: TSelect, + args: TArgs, + variableDefinitions: Array<{ name: string; type: string }>, + connectionFieldsMap?: Record>, + entityType?: string +): { document: string; variables: Record } { + let actualSelect: TSelect = select; + let isConnection = false; + + if (isCustomSelectionWrapper(select)) { + actualSelect = select.select as TSelect; + isConnection = select.connection === true; + } + + const selections = actualSelect + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) + : []; + + const variableDefs = variableDefinitions.map((definition) => + t.variableDefinition({ + variable: t.variable({ name: definition.name }), + type: parseType(definition.type), + }) + ); + const fieldArgs = variableDefinitions.map((definition) => + t.argument({ + name: definition.name, + value: t.variable({ name: definition.name }), + }) + ); + + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY, + name: operationName, + variableDefinitions: variableDefs.length ? variableDefs : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: fieldName, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: fieldSelections.length + ? t.selectionSet({ selections: fieldSelections }) + : undefined, + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: (args ?? {}) as Record, + }; +} + +function isCustomSelectionWrapper( + value: unknown +): value is { select: Record; connection?: boolean } { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + + const record = value as Record; + const keys = Object.keys(record); + + if (!keys.includes('select') || !keys.includes('connection')) { + return false; + } + + if (keys.some((key) => key !== 'select' && key !== 'connection')) { + return false; + } + + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); +} + +// ============================================================================ +// Helper Functions +// ============================================================================ + +function buildArgs(args: Array): ArgumentNode[] { + return args.filter((arg): arg is ArgumentNode => arg !== null); +} + +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { + if (value === undefined) { + return null; + } + const valueNode = + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); + return t.argument({ name, value: valueNode }); +} + +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { + if (!values || values.length === 0) { + return null; + } + return t.argument({ + name, + value: t.listValue({ + values: values.map((value) => buildEnumValue(value)), + }), + }); +} + +function buildEnumValue(value: string): EnumValueNode { + return { + kind: ENUM_VALUE_KIND, + value, + }; +} + +function buildPageInfoSelections(): FieldNode[] { + return [ + t.field({ name: 'hasNextPage' }), + t.field({ name: 'hasPreviousPage' }), + t.field({ name: 'startCursor' }), + t.field({ name: 'endCursor' }), + ]; +} + +function buildConnectionSelections(nodeSelections: FieldNode[]): FieldNode[] { + return [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections: nodeSelections }), + }), + t.field({ name: 'totalCount' }), + t.field({ + name: 'pageInfo', + selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }), + }), + ]; +} + +interface VariableSpec { + varName: string; + argName?: string; + typeName?: string; + value: unknown; +} + +interface InputMutationConfig { + operationName: string; + mutationField: string; + inputTypeName: string; + resultSelections: FieldNode[]; +} + +function buildInputMutationDocument(config: InputMutationConfig): string { + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_MUTATION, + name: config.operationName + 'Mutation', + variableDefinitions: [ + t.variableDefinition({ + variable: t.variable({ name: 'input' }), + type: parseType(config.inputTypeName + '!'), + }), + ], + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: config.mutationField, + args: [ + t.argument({ + name: 'input', + value: t.variable({ name: 'input' }), + }), + ], + selectionSet: t.selectionSet({ + selections: config.resultSelections, + }), + }), + ], + }), + }), + ], + }); + return print(document); +} + +function addVariable( + spec: VariableSpec, + definitions: VariableDefinitionNode[], + args: ArgumentNode[], + variables: Record +): void { + if (spec.value === undefined || !spec.typeName) return; + + definitions.push( + t.variableDefinition({ + variable: t.variable({ name: spec.varName }), + type: parseType(spec.typeName), + }) + ); + args.push( + t.argument({ + name: spec.argName ?? spec.varName, + value: t.variable({ name: spec.varName }), + }) + ); + variables[spec.varName] = spec.value; +} + +function buildValueAst( + value: unknown +): + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | EnumValueNode { + if (value === null) { + return t.nullValue(); + } + + if (typeof value === 'boolean') { + return t.booleanValue({ value }); + } + + if (typeof value === 'number') { + return Number.isInteger(value) + ? t.intValue({ value: value.toString() }) + : t.floatValue({ value: value.toString() }); + } + + if (typeof value === 'string') { + return t.stringValue({ value }); + } + + if (Array.isArray(value)) { + return t.listValue({ + values: value.map((item) => buildValueAst(item)), + }); + } + + if (typeof value === 'object' && value !== null) { + const obj = value as Record; + return t.objectValue({ + fields: Object.entries(obj).map(([key, val]) => + t.objectField({ + name: key, + value: buildValueAst(val), + }) + ), + }); + } + + throw new Error('Unsupported value type: ' + typeof value); +} + +// ============================================================================ +// Bulk Mutation Document Builders +// ============================================================================ + +export function buildBulkInsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict?: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + ...(onConflict ? { onConflict } : {}), + }, + }, + }; +} + +export function buildBulkUpsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + onConflict, + }, + }, + }; +} + +export function buildBulkUpdateDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + patch: data, + }, + }, + }; +} + +export function buildBulkDeleteDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + }, + }, + }; +} diff --git a/sdk/constructive-sdk/src/compute/orm/query/index.ts b/sdk/constructive-sdk/src/compute/orm/query/index.ts new file mode 100644 index 0000000000..505264ae62 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/query/index.ts @@ -0,0 +1,45 @@ +/** + * Custom query operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import { connectionFieldsMap } from '../input-types'; +export interface ReadFunctionGraphVariables { + graphId?: string; +} +export function createQueryOperations(client: OrmClient) { + return { + readFunctionGraph: ( + args: ReadFunctionGraphVariables, + options?: { + select?: Record; + } + ) => + new QueryBuilder<{ + readFunctionGraph: unknown | null; + }>({ + client, + operation: 'query', + operationName: 'ReadFunctionGraph', + fieldName: 'readFunctionGraph', + ...buildCustomDocument( + 'query', + 'ReadFunctionGraph', + 'readFunctionGraph', + options?.select, + args, + [ + { + name: 'graphId', + type: 'UUID', + }, + ], + connectionFieldsMap, + undefined + ), + }), + }; +} diff --git a/sdk/constructive-sdk/src/compute/orm/realtime.ts b/sdk/constructive-sdk/src/compute/orm/realtime.ts new file mode 100644 index 0000000000..214eb56203 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/realtime.ts @@ -0,0 +1,244 @@ +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// Minimal type shims so this module compiles without graphql-ws +// installed. Consumers supply a WsClient via RealtimeConfig; +// the SDK itself never imports or requires graphql-ws. + +interface WsGraphQLError { + readonly message: string; + readonly [key: string]: unknown; +} + +interface WsExecutionResult> { + data?: TData | null; + errors?: readonly WsGraphQLError[]; + extensions?: Record; +} + +interface WsSink { + next(value: T): void; + error(error: unknown): void; + complete(): void; +} + +/** + * Minimal interface matching the graphql-ws Client. + * Consumers pass a concrete instance via RealtimeConfig.client. + */ +export interface WsClient { + subscribe>( + payload: { query: string; variables?: Record }, + sink: WsSink> + ): () => void; + dispose(): void; +} + +// ============================================================================ +// Types +// ============================================================================ + +/** The DML operation that triggered the subscription event */ +export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; + +/** Connection state of the WebSocket */ +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; + +/** Listener for connection state changes */ +export type ConnectionStateListener = (state: ConnectionState) => void; + +/** Function returned by subscribe() to cancel the subscription */ +export type Unsubscribe = () => void; + +/** + * A realtime subscription event delivered to the client. + * + * @typeParam T - The row type of the subscribed table + */ +export interface SubscriptionEvent { + /** The DML operation that triggered this event */ + operation: SubscriptionOperation; + /** The current row data (null for DELETE if row is no longer visible) */ + data: T | null; + /** Previous field values (populated on UPDATE when available) */ + previousValues?: Partial; + /** Server-side timestamp of when the change occurred */ + timestamp: string; +} + +/** + * Options for creating a subscription. + * + * @typeParam T - The row type of the subscribed table + * @typeParam TFilter - The filter type for the table + */ +export interface SubscribeOptions> { + /** Server-side filter to limit which events are delivered */ + filter?: TFilter; + /** Called when a subscription event is received */ + onEvent: (event: SubscriptionEvent) => void; + /** Called when the subscription encounters an error */ + onError?: (error: Error) => void; + /** Called when the subscription completes (server-initiated close) */ + onComplete?: () => void; +} + +/** + * Metadata about a subscription field, used internally to map + * table names to GraphQL subscription field names and types. + */ +export interface SubscriptionFieldMeta { + /** The GraphQL subscription field name (e.g., 'onContactChanged') */ + fieldName: string; + /** The table name in the source schema (e.g., 'contact') */ + tableName: string; + /** The data field name inside the subscription payload (e.g., 'contact') */ + dataFieldName: string; +} + +/** + * Configuration for the realtime (WebSocket) connection. + * Pass this as the `realtime` option in OrmClientConfig. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * + * const client = createOrmClient({ + * endpoint: 'https://api.example.com/graphql', + * realtime: { + * client: createClient({ url: 'wss://api.example.com/graphql' }), + * }, + * }); + * ``` + */ +export interface RealtimeConfig { + /** + * A graphql-ws Client instance (or any object satisfying WsClient). + * The consumer creates this themselves, giving full control over + * connection options, auth, and transport. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * const wsClient = createClient({ url: 'wss://...' }); + * ``` + */ + client: WsClient; +} + +// ============================================================================ +// RealtimeManager +// ============================================================================ + +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +export class RealtimeManager { + private wsClient: WsClient; + private connectionState: ConnectionState = 'disconnected'; + private stateListeners: Set = new Set(); + private activeSubscriptions = 0; + + constructor(config: RealtimeConfig) { + this.wsClient = config.client; + } + + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + this.activeSubscriptions++; + let disposed = false; + + const cleanup = this.wsClient.subscribe>( + { query: document, variables }, + { + next: (result) => { + if (disposed) return; + if (result.errors) { + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); + return; + } + + const payload = result.data?.[meta.fieldName] as + | { event?: string; [key: string]: unknown } + | undefined; + + if (!payload) return; + + const event: SubscriptionEvent = { + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', + data: (payload[meta.dataFieldName] as T) ?? null, + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), + }; + options.onEvent(event); + }, + error: (err) => { + if (disposed) return; + options.onError?.(err instanceof Error ? err : new Error(String(err))); + }, + complete: () => { + if (disposed) return; + options.onComplete?.(); + }, + } + ); + + return () => { + if (disposed) return; + disposed = true; + this.activeSubscriptions--; + cleanup(); + }; + } + + /** Register a listener for connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + this.stateListeners.add(listener); + return () => { + this.stateListeners.delete(listener); + }; + } + + /** Get current connection state */ + getConnectionState(): ConnectionState { + return this.connectionState; + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.activeSubscriptions; + } + + /** Dispose the manager and close the WebSocket connection */ + dispose(): void { + this.wsClient.dispose(); + this.stateListeners.clear(); + this.activeSubscriptions = 0; + this.setConnectionState('disconnected'); + } + + private setConnectionState(state: ConnectionState): void { + if (this.connectionState === state) return; + this.connectionState = state; + for (const listener of this.stateListeners) { + listener(state); + } + } +} diff --git a/sdk/constructive-sdk/src/compute/orm/select-types.ts b/sdk/constructive-sdk/src/compute/orm/select-types.ts new file mode 100644 index 0000000000..4b39d7e820 --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/select-types.ts @@ -0,0 +1,169 @@ +/** + * Type utilities for select inference + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} + +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} + +export interface FindManyArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +export interface FindFirstArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; +} + +export interface CreateArgs { + data: TData; + select?: TSelect; +} + +export interface UpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export type FindOneArgs = { + select?: TSelect; +} & Record; + +export interface DeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkInsertArgs { + data: TData[]; + select?: TSelect; + onConflict?: TOnConflict; +} + +export interface BulkUpsertArgs { + data: TData[]; + select?: TSelect; + onConflict: TOnConflict; +} + +export interface BulkUpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export interface BulkDeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkMutationResult { + affectedCount: number; + returning: T[]; +} + +type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +type DecrementDepth = { + 0: 0; + 1: 0; + 2: 1; + 3: 2; + 4: 3; + 5: 4; + 6: 5; + 7: 6; + 8: 7; + 9: 8; + 10: 9; +}; + +/** + * Recursively validates select objects, rejecting unknown keys. + * + * NOTE: Depth is intentionally capped to avoid circular-instantiation issues + * in very large cyclic schemas. + */ +export type DeepExact = Depth extends 0 + ? T extends Shape + ? T + : never + : T extends Shape + ? Exclude extends never + ? { + [K in keyof T]: K extends keyof Shape + ? T[K] extends { select: infer NS } + ? Extract extends { + select?: infer ShapeNS; + } + ? DeepExact< + Omit & { + select: DeepExact, DecrementDepth[Depth]>; + }, + Extract, + DecrementDepth[Depth] + > + : never + : T[K] + : never; + } + : never + : never; + +/** + * Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`. + * Use this as an intersection in overloads: + * `{ select: S } & StrictSelect`. + */ +export type StrictSelect = S extends DeepExact ? {} : never; + +/** + * Hook-optimized strict select variant. + * + * Uses a shallower recursion depth to keep editor autocomplete responsive + * in large schemas while still validating common nested-select mistakes. + */ +export type HookStrictSelect = S extends DeepExact ? {} : never; + +/** + * Infer result type from select configuration + */ +export type InferSelectResult = TSelect extends undefined + ? TEntity + : { + [K in keyof TSelect as TSelect[K] extends false | undefined + ? never + : K]: TSelect[K] extends true + ? K extends keyof TEntity + ? TEntity[K] + : never + : TSelect[K] extends { select: infer NestedSelect } + ? K extends keyof TEntity + ? NonNullable extends ConnectionResult + ? ConnectionResult> + : + | InferSelectResult, NestedSelect> + | (null extends TEntity[K] ? null : never) + : never + : K extends keyof TEntity + ? TEntity[K] + : never; + }; diff --git a/sdk/constructive-sdk/src/compute/orm/types.ts b/sdk/constructive-sdk/src/compute/orm/types.ts new file mode 100644 index 0000000000..7c1120bcdf --- /dev/null +++ b/sdk/constructive-sdk/src/compute/orm/types.ts @@ -0,0 +1,8 @@ +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// Re-export all types from input-types +export * from './input-types'; diff --git a/sdk/constructive-sdk/src/config/README.md b/sdk/constructive-sdk/src/config/README.md new file mode 100644 index 0000000000..e03942d1f5 --- /dev/null +++ b/sdk/constructive-sdk/src/config/README.md @@ -0,0 +1,41 @@ +# Generated GraphQL SDK + +

+ +

+ + + +## Overview + +- **Tables:** 2 +- **Custom queries:** 0 +- **Custom mutations:** 9 + +**Generators:** ORM + +## Modules + +### ORM Client (`./orm`) + +Prisma-like ORM client for programmatic GraphQL access. + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', +}); +``` + +See [orm/README.md](./orm/README.md) for full API reference. + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-sdk/src/config/index.ts b/sdk/constructive-sdk/src/config/index.ts new file mode 100644 index 0000000000..654223e7a5 --- /dev/null +++ b/sdk/constructive-sdk/src/config/index.ts @@ -0,0 +1,5 @@ +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +export * from './orm'; diff --git a/sdk/constructive-sdk/src/config/orm/README.md b/sdk/constructive-sdk/src/config/orm/README.md new file mode 100644 index 0000000000..803661dc8e --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/README.md @@ -0,0 +1,252 @@ +# ORM Client + +

+ +

+ + + +## Setup + +```typescript +import { createClient } from './orm'; + +const db = createClient({ + endpoint: 'https://api.example.com/graphql', + headers: { Authorization: 'Bearer ' }, +}); +``` + +## Models + +| Model | Operations | +|-------|------------| +| `platformConfigDefinition` | findMany, findOne, create, update, delete | +| `platformConfig` | findMany, findOne, create, update, delete | + +## Table Operations + +### `db.platformConfigDefinition` + +CRUD operations for PlatformConfigDefinition records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `name` | String | Yes | +| `description` | String | Yes | +| `defaultValue` | String | Yes | +| `isBuiltIn` | Boolean | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | + +**Operations:** + +```typescript +// List all platformConfigDefinition records +const items = await db.platformConfigDefinition.findMany({ select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }).execute(); + +// Get one by id +const item = await db.platformConfigDefinition.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, name: true, description: true, defaultValue: true, isBuiltIn: true, labels: true, annotations: true } }).execute(); + +// Create +const created = await db.platformConfigDefinition.create({ data: { name: '', description: '', defaultValue: '', isBuiltIn: '', labels: '', annotations: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.platformConfigDefinition.update({ where: { id: '' }, data: { name: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.platformConfigDefinition.delete({ where: { id: '' } }).execute(); +``` + +### `db.platformConfig` + +CRUD operations for PlatformConfig records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `namespaceId` | UUID | Yes | +| `name` | String | Yes | +| `value` | String | Yes | +| `labels` | JSON | Yes | +| `annotations` | JSON | Yes | +| `description` | String | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `expiresAt` | Datetime | Yes | + +**Operations:** + +```typescript +// List all platformConfig records +const items = await db.platformConfig.findMany({ select: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }).execute(); + +// Get one by id +const item = await db.platformConfig.findOne({ id: '', select: { id: true, namespaceId: true, name: true, value: true, labels: true, annotations: true, description: true, createdAt: true, updatedAt: true, expiresAt: true } }).execute(); + +// Create +const created = await db.platformConfig.create({ data: { namespaceId: '', name: '', value: '', labels: '', annotations: '', description: '', expiresAt: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.platformConfig.update({ where: { id: '' }, data: { namespaceId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.platformConfig.delete({ where: { id: '' } }).execute(); +``` + +## Custom Operations + +### `db.mutation.platformSecretsDel` + +platformSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsDelInput (required) | + +```typescript +const result = await db.mutation.platformSecretsDel({ input: { secretName: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.orgSecretsDel` + +orgSecretsDel + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsDelInput (required) | + +```typescript +const result = await db.mutation.orgSecretsDel({ input: { ownerId: '', secretName: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.platformSecretsRemoveArray` + +platformSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRemoveArrayInput (required) | + +```typescript +const result = await db.mutation.platformSecretsRemoveArray({ input: { secretNames: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.orgSecretsRemoveArray` + +orgSecretsRemoveArray + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRemoveArrayInput (required) | + +```typescript +const result = await db.mutation.orgSecretsRemoveArray({ input: { ownerId: '', secretNames: '', namespaceId: '' } }).execute(); +``` + +### `db.mutation.platformSecretsRotate` + +platformSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsRotateInput (required) | + +```typescript +const result = await db.mutation.platformSecretsRotate({ input: { secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.platformSecretsSet` + +platformSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | PlatformSecretsSetInput (required) | + +```typescript +const result = await db.mutation.platformSecretsSet({ input: { secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.orgSecretsRotate` + +orgSecretsRotate + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsRotateInput (required) | + +```typescript +const result = await db.mutation.orgSecretsRotate({ input: { ownerId: '', secretName: '', secretValue: '', namespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.orgSecretsSet` + +orgSecretsSet + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | OrgSecretsSetInput (required) | + +```typescript +const result = await db.mutation.orgSecretsSet({ input: { scopeOwnerId: '', secretName: '', secretValue: '', secretNamespaceId: '', algo: '' } }).execute(); +``` + +### `db.mutation.provisionBucket` + +Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | ProvisionBucketInput (required) | + +```typescript +const result = await db.mutation.provisionBucket({ input: { bucketKey: '', ownerId: '' } }).execute(); +``` + +--- + +Built by the [Constructive](https://constructive.io) team. + +## Disclaimer + +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. + +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. diff --git a/sdk/constructive-sdk/src/config/orm/client.ts b/sdk/constructive-sdk/src/config/orm/client.ts new file mode 100644 index 0000000000..16e683c712 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/client.ts @@ -0,0 +1,244 @@ +/** + * ORM Client - Runtime GraphQL executor + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; +import { createFetch } from '@constructive-io/graphql-query/runtime'; + +import type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + Unsubscribe, +} from './realtime'; +import { RealtimeManager } from './realtime'; + +export type { + GraphQLAdapter, + GraphQLError, + QueryResult, +} from '@constructive-io/graphql-query/runtime'; + +export type { + ConnectionState, + ConnectionStateListener, + RealtimeConfig, + SubscribeOptions, + SubscriptionEvent, + SubscriptionFieldMeta, + SubscriptionOperation, + Unsubscribe, + WsClient, +} from './realtime'; +export { RealtimeManager } from './realtime'; + +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +export class FetchAdapter implements GraphQLAdapter { + private headers: Record; + private fetchFn: typeof globalThis.fetch; + + constructor( + private endpoint: string, + headers?: Record, + fetchFn?: typeof globalThis.fetch + ) { + this.headers = headers ?? {}; + this.fetchFn = (fetchFn ?? createFetch()).bind(globalThis); + } + + async execute(document: string, variables?: Record): Promise> { + const response = await this.fetchFn(this.endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + ...this.headers, + }, + body: JSON.stringify({ + query: document, + variables: variables ?? {}, + }), + }); + + if (!response.ok) { + return { + ok: false, + data: null, + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], + }; + } + + const json = (await response.json()) as { + data?: T; + errors?: GraphQLError[]; + }; + + if (json.errors && json.errors.length > 0) { + return { + ok: false, + data: null, + errors: json.errors, + }; + } + + return { + ok: true, + data: json.data as T, + errors: undefined, + }; + } + + setHeaders(headers: Record): void { + this.headers = { ...this.headers, ...headers }; + } + + getEndpoint(): string { + return this.endpoint; + } +} + +/** + * Configuration for creating an ORM client. + * Either provide endpoint (and optional headers/fetch) for HTTP requests, + * or provide a custom adapter for alternative execution strategies. + */ +export interface OrmClientConfig { + /** GraphQL endpoint URL (required if adapter not provided) */ + endpoint?: string; + /** Default headers for HTTP requests (only used with endpoint) */ + headers?: Record; + /** + * Custom fetch implementation. Defaults to createFetch() from + * @constructive-io/graphql-query/runtime which handles *.localhost + * DNS and Host headers in Node.js. Pass your own for test mocking + * or custom proxy/credentials. + */ + fetch?: typeof globalThis.fetch; + /** Custom adapter for GraphQL execution (overrides endpoint/headers/fetch) */ + adapter?: GraphQLAdapter; + /** + * Optional realtime (WebSocket) configuration. + * When provided, enables subscription methods on models. + * The WebSocket connection is created lazily on first subscribe(). + */ + realtime?: RealtimeConfig; +} + +/** + * Error thrown when GraphQL request fails + */ +export class GraphQLRequestError extends Error { + constructor( + public readonly errors: GraphQLError[], + public readonly data: unknown = null + ) { + const messages = errors.map((e) => e.message).join('; '); + super(`GraphQL Error: ${messages}`); + this.name = 'GraphQLRequestError'; + } +} + +export class OrmClient { + private adapter: GraphQLAdapter; + private realtimeManager?: RealtimeManager; + + constructor(config: OrmClientConfig) { + if (config.adapter) { + this.adapter = config.adapter; + } else if (config.endpoint) { + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); + } else { + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); + } + + if (config.realtime) { + this.realtimeManager = new RealtimeManager(config.realtime); + } + } + + async execute(document: string, variables?: Record): Promise> { + return this.adapter.execute(document, variables); + } + + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + if (!this.realtimeManager) { + throw new Error( + 'Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.' + ); + } + return this.realtimeManager.subscribe(meta, document, variables, options); + } + + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers: Record): void { + if (this.adapter.setHeaders) { + this.adapter.setHeaders(headers); + } + } + + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint(): string { + return this.adapter.getEndpoint?.() ?? ''; + } + + /** Get current WebSocket connection state */ + getConnectionState(): ConnectionState { + return this.realtimeManager?.getConnectionState() ?? 'disconnected'; + } + + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + if (!this.realtimeManager) return () => {}; + return this.realtimeManager.onConnectionStateChange(listener); + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.realtimeManager?.getActiveSubscriptionCount() ?? 0; + } + + /** Whether realtime is configured */ + get isRealtimeEnabled(): boolean { + return this.realtimeManager !== undefined; + } + + /** Dispose the realtime manager (close WebSocket) */ + dispose(): void { + this.realtimeManager?.dispose(); + } +} diff --git a/sdk/constructive-sdk/src/config/orm/index.ts b/sdk/constructive-sdk/src/config/orm/index.ts new file mode 100644 index 0000000000..9ea4028079 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/index.ts @@ -0,0 +1,47 @@ +/** + * ORM Client - createClient factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from './client'; +import type { OrmClientConfig } from './client'; +import { PlatformConfigDefinitionModel } from './models/platformConfigDefinition'; +import { PlatformConfigModel } from './models/platformConfig'; +import { createMutationOperations } from './mutation'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +export function createClient(config: OrmClientConfig) { + const client = new OrmClient(config); + return { + platformConfigDefinition: new PlatformConfigDefinitionModel(client), + platformConfig: new PlatformConfigModel(client), + mutation: createMutationOperations(client), + }; +} diff --git a/sdk/constructive-sdk/src/config/orm/input-types.ts b/sdk/constructive-sdk/src/config/orm/input-types.ts new file mode 100644 index 0000000000..693309a1fb --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/input-types.ts @@ -0,0 +1,774 @@ +/** + * GraphQL types for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// ============ Scalar Filter Types ============ +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: Record; + containedBy?: Record; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containsOrEqualTo?: string; + containedBy?: string; + containedByOrEqualTo?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +/** Registry of valid config keys — declares which config entries the platform recognizes */ +// ============ Entity Types ============ +export interface PlatformConfigDefinition { + /** Unique identifier for this config definition */ + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** Config key name (must match config table name for resolution) */ + name?: string | null; + /** Human-readable description of what this config key controls */ + description?: string | null; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string | null; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean | null; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: Record | null; + /** Freeform metadata annotations for config definitions */ + annotations?: Record | null; +} +/** App-level plaintext key-value config store (like a k8s ConfigMap); admin-only, fully CRUD-exposed */ +export interface PlatformConfig { + /** Unique identifier for this config entry */ + id: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId?: string | null; + /** Key name identifying the config entry */ + name?: string | null; + /** Plaintext config value */ + value?: string | null; + /** Key/value pairs for selecting/filtering config entries */ + labels?: Record | null; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record | null; + /** Human-readable note about this config entry */ + description?: string | null; + createdAt?: string | null; + updatedAt?: string | null; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string | null; +} +// ============ Relation Helper Types ============ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +// ============ Entity Relation Types ============ +export interface PlatformConfigDefinitionRelations {} +export interface PlatformConfigRelations {} +// ============ Entity Types With Relations ============ +export type PlatformConfigDefinitionWithRelations = PlatformConfigDefinition & + PlatformConfigDefinitionRelations; +export type PlatformConfigWithRelations = PlatformConfig & PlatformConfigRelations; +// ============ Entity Select Types ============ +export type PlatformConfigDefinitionSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + name?: boolean; + description?: boolean; + defaultValue?: boolean; + isBuiltIn?: boolean; + labels?: boolean; + annotations?: boolean; +}; +export type PlatformConfigSelect = { + id?: boolean; + namespaceId?: boolean; + name?: boolean; + value?: boolean; + labels?: boolean; + annotations?: boolean; + description?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + expiresAt?: boolean; +}; +// ============ Table Filter Types ============ +export interface PlatformConfigDefinitionFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `defaultValue` field. */ + defaultValue?: StringFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigDefinitionFilter[]; + /** Negates the expression. */ + not?: PlatformConfigDefinitionFilter; +} +export interface PlatformConfigFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `value` field. */ + value?: StringFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: PlatformConfigFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformConfigFilter[]; + /** Negates the expression. */ + not?: PlatformConfigFilter; +} +// ============ OrderBy Types ============ +export type PlatformConfigDefinitionOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'DEFAULT_VALUE_ASC' + | 'DEFAULT_VALUE_DESC' + | 'IS_BUILT_IN_ASC' + | 'IS_BUILT_IN_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC'; +export type PlatformConfigOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'NAMESPACE_ID_ASC' + | 'NAMESPACE_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'VALUE_ASC' + | 'VALUE_DESC' + | 'LABELS_ASC' + | 'LABELS_DESC' + | 'ANNOTATIONS_ASC' + | 'ANNOTATIONS_DESC' + | 'DESCRIPTION_ASC' + | 'DESCRIPTION_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC'; +// ============ CRUD Input Types ============ +export interface CreatePlatformConfigDefinitionInput { + clientMutationId?: string; + platformConfigDefinition: { + name: string; + description?: string; + defaultValue?: string; + isBuiltIn?: boolean; + labels?: Record; + annotations?: Record; + }; +} +export interface PlatformConfigDefinitionPatch { + name?: string | null; + description?: string | null; + defaultValue?: string | null; + isBuiltIn?: boolean | null; + labels?: Record | null; + annotations?: Record | null; +} +export interface UpdatePlatformConfigDefinitionInput { + clientMutationId?: string; + id: string; + platformConfigDefinitionPatch: PlatformConfigDefinitionPatch; +} +export interface DeletePlatformConfigDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformConfigInput { + clientMutationId?: string; + platformConfig: { + namespaceId: string; + name: string; + value?: string; + labels?: Record; + annotations?: Record; + description?: string; + expiresAt?: string; + }; +} +export interface PlatformConfigPatch { + namespaceId?: string | null; + name?: string | null; + value?: string | null; + labels?: Record | null; + annotations?: Record | null; + description?: string | null; + expiresAt?: string | null; +} +export interface UpdatePlatformConfigInput { + clientMutationId?: string; + id: string; + platformConfigPatch: PlatformConfigPatch; +} +export interface DeletePlatformConfigInput { + clientMutationId?: string; + id: string; +} +// ============ Connection Fields Map ============ +export const connectionFieldsMap = {} as Record>; +// ============ Custom Input Types (from schema) ============ +export interface PlatformSecretsDelInput { + clientMutationId?: string; + secretName?: string; + namespaceId?: string; +} +export interface OrgSecretsDelInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + namespaceId?: string; +} +export interface PlatformSecretsRemoveArrayInput { + clientMutationId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface OrgSecretsRemoveArrayInput { + clientMutationId?: string; + ownerId?: string; + secretNames?: string[]; + namespaceId?: string; +} +export interface PlatformSecretsRotateInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface PlatformSecretsSetInput { + clientMutationId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface OrgSecretsRotateInput { + clientMutationId?: string; + ownerId?: string; + secretName?: string; + secretValue?: string; + namespaceId?: string; + algo?: string; +} +export interface OrgSecretsSetInput { + clientMutationId?: string; + scopeOwnerId?: string; + secretName?: string; + secretValue?: string; + secretNamespaceId?: string; + algo?: string; +} +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +/** An input for mutations affecting `PlatformConfigDefinition` */ +export interface PlatformConfigDefinitionInput { + /** Unique identifier for this config definition */ + id?: string; + createdAt?: string; + updatedAt?: string; + /** Config key name (must match config table name for resolution) */ + name: string; + /** Human-readable description of what this config key controls */ + description?: string; + /** Default value used when no config entry exists for a namespace */ + defaultValue?: string; + /** Whether this row was seeded as a built-in config definition */ + isBuiltIn?: boolean; + /** Key-value metadata for filtering and grouping config definitions */ + labels?: Record; + /** Freeform metadata annotations for config definitions */ + annotations?: Record; +} +/** An input for mutations affecting `PlatformConfig` */ +export interface PlatformConfigInput { + /** Unique identifier for this config entry */ + id?: string; + /** FK to namespaces — logical grouping for config entries */ + namespaceId: string; + /** Key name identifying the config entry */ + name: string; + /** Plaintext config value */ + value?: string; + /** Key/value pairs for selecting/filtering config entries */ + labels?: Record; + /** Freeform metadata for tooling and operational notes */ + annotations?: Record; + /** Human-readable note about this config entry */ + description?: string; + createdAt?: string; + updatedAt?: string; + /** Optional expiration timestamp for time-limited config entries */ + expiresAt?: string; +} +// ============ Payload/Return Types (for custom operations) ============ +export interface PlatformSecretsDelPayload { + clientMutationId?: string | null; +} +export type PlatformSecretsDelPayloadSelect = { + clientMutationId?: boolean; +}; +export interface OrgSecretsDelPayload { + clientMutationId?: string | null; +} +export type OrgSecretsDelPayloadSelect = { + clientMutationId?: boolean; +}; +export interface PlatformSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export type PlatformSecretsRemoveArrayPayloadSelect = { + clientMutationId?: boolean; +}; +export interface OrgSecretsRemoveArrayPayload { + clientMutationId?: string | null; +} +export type OrgSecretsRemoveArrayPayloadSelect = { + clientMutationId?: boolean; +}; +export interface PlatformSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type PlatformSecretsRotatePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface PlatformSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type PlatformSecretsSetPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface OrgSecretsRotatePayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type OrgSecretsRotatePayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface OrgSecretsSetPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type OrgSecretsSetPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +export type ProvisionBucketPayloadSelect = { + success?: boolean; + bucketName?: boolean; + accessType?: boolean; + provider?: boolean; + endpoint?: boolean; + error?: boolean; +}; +export interface CreatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was created by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type CreatePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface UpdatePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was updated by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type UpdatePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface DeletePlatformConfigDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformConfigDefinition` that was deleted by this mutation. */ + platformConfigDefinition?: PlatformConfigDefinition | null; + platformConfigDefinitionEdge?: PlatformConfigDefinitionEdge | null; +} +export type DeletePlatformConfigDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformConfigDefinition?: { + select: PlatformConfigDefinitionSelect; + }; + platformConfigDefinitionEdge?: { + select: PlatformConfigDefinitionEdgeSelect; + }; +}; +export interface CreatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was created by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type CreatePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +export interface UpdatePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was updated by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type UpdatePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +export interface DeletePlatformConfigPayload { + clientMutationId?: string | null; + /** The `PlatformConfig` that was deleted by this mutation. */ + platformConfig?: PlatformConfig | null; + platformConfigEdge?: PlatformConfigEdge | null; +} +export type DeletePlatformConfigPayloadSelect = { + clientMutationId?: boolean; + platformConfig?: { + select: PlatformConfigSelect; + }; + platformConfigEdge?: { + select: PlatformConfigEdgeSelect; + }; +}; +/** A `PlatformConfigDefinition` edge in the connection. */ +export interface PlatformConfigDefinitionEdge { + cursor?: string | null; + /** The `PlatformConfigDefinition` at the end of the edge. */ + node?: PlatformConfigDefinition | null; +} +export type PlatformConfigDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformConfigDefinitionSelect; + }; +}; +/** A `PlatformConfig` edge in the connection. */ +export interface PlatformConfigEdge { + cursor?: string | null; + /** The `PlatformConfig` at the end of the edge. */ + node?: PlatformConfig | null; +} +export type PlatformConfigEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformConfigSelect; + }; +}; diff --git a/sdk/constructive-sdk/src/config/orm/models/index.ts b/sdk/constructive-sdk/src/config/orm/models/index.ts new file mode 100644 index 0000000000..c641a1f3e5 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/models/index.ts @@ -0,0 +1,7 @@ +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export { PlatformConfigDefinitionModel } from './platformConfigDefinition'; +export { PlatformConfigModel } from './platformConfig'; diff --git a/sdk/constructive-sdk/src/config/orm/models/platformConfig.ts b/sdk/constructive-sdk/src/config/orm/models/platformConfig.ts new file mode 100644 index 0000000000..43634e7a80 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/models/platformConfig.ts @@ -0,0 +1,245 @@ +/** + * PlatformConfig model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfig, + PlatformConfigWithRelations, + PlatformConfigSelect, + PlatformConfigFilter, + PlatformConfigOrderBy, + CreatePlatformConfigInput, + UpdatePlatformConfigInput, + PlatformConfigPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PlatformConfigModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigs: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfigs', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfig: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', + document, + variables, + transform: (data: { + platformConfigs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfig: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfig', + 'platformConfigs', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PlatformConfigFilter', + 'PlatformConfigOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfig', + fieldName: 'platformConfig', + document, + variables, + transform: (data: { + platformConfigs?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfig: data.platformConfigs?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PlatformConfig', + 'createPlatformConfig', + 'platformConfig', + args.select, + args.data, + 'CreatePlatformConfigInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'createPlatformConfig', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfig', + 'updatePlatformConfig', + 'platformConfig', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigInput', + 'id', + 'platformConfigPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'updatePlatformConfig', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePlatformConfig: { + platformConfig: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfig', + 'deletePlatformConfig', + 'platformConfig', + { + id: args.where.id, + }, + 'DeletePlatformConfigInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfig', + fieldName: 'deletePlatformConfig', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/config/orm/models/platformConfigDefinition.ts b/sdk/constructive-sdk/src/config/orm/models/platformConfigDefinition.ts new file mode 100644 index 0000000000..c28ff1566e --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/models/platformConfigDefinition.ts @@ -0,0 +1,247 @@ +/** + * PlatformConfigDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + PlatformConfigDefinition, + PlatformConfigDefinitionWithRelations, + PlatformConfigDefinitionSelect, + PlatformConfigDefinitionFilter, + PlatformConfigDefinitionOrderBy, + CreatePlatformConfigDefinitionInput, + UpdatePlatformConfigDefinitionInput, + PlatformConfigDefinitionPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PlatformConfigDefinitionModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinitions: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinitions', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinition', + document, + variables, + transform: (data: { + platformConfigDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfigDefinition: data.platformConfigDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + platformConfigDefinition: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PlatformConfigDefinition', + 'platformConfigDefinitions', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PlatformConfigDefinitionFilter', + 'PlatformConfigDefinitionOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformConfigDefinition', + fieldName: 'platformConfigDefinition', + document, + variables, + transform: (data: { + platformConfigDefinitions?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + platformConfigDefinition: data.platformConfigDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PlatformConfigDefinition', + 'createPlatformConfigDefinition', + 'platformConfigDefinition', + args.select, + args.data, + 'CreatePlatformConfigDefinitionInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'createPlatformConfigDefinition', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PlatformConfigDefinitionPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PlatformConfigDefinition', + 'updatePlatformConfigDefinition', + 'platformConfigDefinition', + args.select, + args.where.id, + args.data, + 'UpdatePlatformConfigDefinitionInput', + 'id', + 'platformConfigDefinitionPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'updatePlatformConfigDefinition', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePlatformConfigDefinition: { + platformConfigDefinition: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PlatformConfigDefinition', + 'deletePlatformConfigDefinition', + 'platformConfigDefinition', + { + id: args.where.id, + }, + 'DeletePlatformConfigDefinitionInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformConfigDefinition', + fieldName: 'deletePlatformConfigDefinition', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/config/orm/mutation/index.ts b/sdk/constructive-sdk/src/config/orm/mutation/index.ts new file mode 100644 index 0000000000..b9ef205a98 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/mutation/index.ts @@ -0,0 +1,337 @@ +/** + * Custom mutation operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder, buildCustomDocument } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { + PlatformSecretsDelInput, + OrgSecretsDelInput, + PlatformSecretsRemoveArrayInput, + OrgSecretsRemoveArrayInput, + PlatformSecretsRotateInput, + PlatformSecretsSetInput, + OrgSecretsRotateInput, + OrgSecretsSetInput, + ProvisionBucketInput, + PlatformSecretsDelPayload, + OrgSecretsDelPayload, + PlatformSecretsRemoveArrayPayload, + OrgSecretsRemoveArrayPayload, + PlatformSecretsRotatePayload, + PlatformSecretsSetPayload, + OrgSecretsRotatePayload, + OrgSecretsSetPayload, + ProvisionBucketPayload, + PlatformSecretsDelPayloadSelect, + OrgSecretsDelPayloadSelect, + PlatformSecretsRemoveArrayPayloadSelect, + OrgSecretsRemoveArrayPayloadSelect, + PlatformSecretsRotatePayloadSelect, + PlatformSecretsSetPayloadSelect, + OrgSecretsRotatePayloadSelect, + OrgSecretsSetPayloadSelect, + ProvisionBucketPayloadSelect, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export interface PlatformSecretsDelVariables { + input: PlatformSecretsDelInput; +} +export interface OrgSecretsDelVariables { + input: OrgSecretsDelInput; +} +export interface PlatformSecretsRemoveArrayVariables { + input: PlatformSecretsRemoveArrayInput; +} +export interface OrgSecretsRemoveArrayVariables { + input: OrgSecretsRemoveArrayInput; +} +export interface PlatformSecretsRotateVariables { + input: PlatformSecretsRotateInput; +} +export interface PlatformSecretsSetVariables { + input: PlatformSecretsSetInput; +} +export interface OrgSecretsRotateVariables { + input: OrgSecretsRotateInput; +} +export interface OrgSecretsSetVariables { + input: OrgSecretsSetInput; +} +/** + * Variables for provisionBucket + * Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + */ +export interface ProvisionBucketVariables { + input: ProvisionBucketInput; +} +export function createMutationOperations(client: OrmClient) { + return { + platformSecretsDel: ( + args: PlatformSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsDel', + fieldName: 'platformSecretsDel', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsDel', + 'platformSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsDelPayload' + ), + }), + orgSecretsDel: ( + args: OrgSecretsDelVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsDel: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsDel', + fieldName: 'orgSecretsDel', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsDel', + 'orgSecretsDel', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsDelInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsDelPayload' + ), + }), + platformSecretsRemoveArray: ( + args: PlatformSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRemoveArray', + fieldName: 'platformSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRemoveArray', + 'platformSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRemoveArrayPayload' + ), + }), + orgSecretsRemoveArray: ( + args: OrgSecretsRemoveArrayVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsRemoveArray: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsRemoveArray', + fieldName: 'orgSecretsRemoveArray', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsRemoveArray', + 'orgSecretsRemoveArray', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsRemoveArrayInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsRemoveArrayPayload' + ), + }), + platformSecretsRotate: ( + args: PlatformSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsRotate', + fieldName: 'platformSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsRotate', + 'platformSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsRotatePayload' + ), + }), + platformSecretsSet: ( + args: PlatformSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + platformSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'PlatformSecretsSet', + fieldName: 'platformSecretsSet', + ...buildCustomDocument( + 'mutation', + 'PlatformSecretsSet', + 'platformSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'PlatformSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'PlatformSecretsSetPayload' + ), + }), + orgSecretsRotate: ( + args: OrgSecretsRotateVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsRotate: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsRotate', + fieldName: 'orgSecretsRotate', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsRotate', + 'orgSecretsRotate', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsRotateInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsRotatePayload' + ), + }), + orgSecretsSet: ( + args: OrgSecretsSetVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + orgSecretsSet: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'OrgSecretsSet', + fieldName: 'orgSecretsSet', + ...buildCustomDocument( + 'mutation', + 'OrgSecretsSet', + 'orgSecretsSet', + options.select, + args, + [ + { + name: 'input', + type: 'OrgSecretsSetInput!', + }, + ], + connectionFieldsMap, + 'OrgSecretsSetPayload' + ), + }), + provisionBucket: ( + args: ProvisionBucketVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...buildCustomDocument( + 'mutation', + 'ProvisionBucket', + 'provisionBucket', + options.select, + args, + [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], + connectionFieldsMap, + 'ProvisionBucketPayload' + ), + }), + }; +} diff --git a/sdk/constructive-sdk/src/config/orm/query-builder.ts b/sdk/constructive-sdk/src/config/orm/query-builder.ts new file mode 100644 index 0000000000..fd785bbae6 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/query-builder.ts @@ -0,0 +1,1047 @@ +/** + * Query Builder - Builds and executes GraphQL operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { parseType, print } from '@constructive-io/graphql-query/runtime'; +import * as t from 'gql-ast'; +import type { ArgumentNode, EnumValueNode, FieldNode, VariableDefinitionNode } from 'graphql'; + +import { GraphQLRequestError, OrmClient, QueryResult } from './client'; + +export interface QueryBuilderConfig { + client: OrmClient; + operation: 'query' | 'mutation'; + operationName: string; + fieldName: string; + document: string; + variables?: Record; + transform?: (data: any) => TResult; +} + +export class QueryBuilder { + private config: QueryBuilderConfig; + + constructor(config: QueryBuilderConfig) { + this.config = config; + } + + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + async execute(): Promise> { + const rawResult = await this.config.client.execute( + this.config.document, + this.config.variables + ); + if (!rawResult.ok) { + return rawResult; + } + if (!this.config.transform) { + return rawResult as unknown as QueryResult; + } + return { + ok: true, + data: this.config.transform(rawResult.data), + errors: undefined, + }; + } + + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + async unwrap(): Promise { + const result = await this.execute(); + if (!result.ok) { + throw new GraphQLRequestError(result.errors, result.data); + } + return result.data; + } + + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + async unwrapOr(defaultValue: D): Promise { + const result = await this.execute(); + if (!result.ok) { + return defaultValue; + } + return result.data; + } + + /** + * Execute and unwrap, calling onError callback on failure + */ + async unwrapOrElse( + onError: (errors: import('./client').GraphQLError[]) => D + ): Promise { + const result = await this.execute(); + if (!result.ok) { + return onError(result.errors); + } + return result.data; + } + + toGraphQL(): string { + return this.config.document; + } + + getVariables(): Record | undefined { + return this.config.variables; + } +} + +const OP_QUERY = 'query' as unknown as import('graphql').OperationTypeNode; +const OP_MUTATION = 'mutation' as unknown as import('graphql').OperationTypeNode; +const ENUM_VALUE_KIND = 'EnumValue' as unknown as EnumValueNode['kind']; + +// ============================================================================ +// Selection Builders +// ============================================================================ + +export function buildSelections( + select: Record | undefined, + connectionFieldsMap?: Record>, + entityType?: string +): FieldNode[] { + if (!select) { + return []; + } + + const fields: FieldNode[] = []; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; + + for (const [key, value] of Object.entries(select)) { + if (value === false || value === undefined) { + continue; + } + + if (value === true) { + fields.push(t.field({ name: key })); + continue; + } + + if (typeof value === 'object' && value !== null) { + const nested = value as { + select?: Record; + args?: Record; + first?: number; + filter?: Record; + orderBy?: string[]; + connection?: boolean; + }; + + // Field with arguments (e.g. requestUploadUrl on bucket types) + if (nested.args && typeof nested.args === 'object') { + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => + t.argument({ name: argName, value: buildValueAst(argValue) }) + ); + const nestedSelect = nested.select; + if (nestedSelect && typeof nestedSelect === 'object') { + const subSelections = Object.entries(nestedSelect) + .filter(([, v]) => v) + .map(([name]) => t.field({ name })); + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: subSelections.length + ? t.selectionSet({ selections: subSelections }) + : undefined, + }) + ); + } else { + fields.push( + t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + }) + ); + } + continue; + } + + if (!nested.select || typeof nested.select !== 'object') { + throw new Error( + `Invalid selection for field "${key}": nested selections must include a "select" object.` + ); + } + + const relatedEntityType = entityConnections?.[key]; + const nestedSelections = buildSelections( + nested.select, + connectionFieldsMap, + relatedEntityType + ); + const isConnection = + nested.connection === true || + nested.first !== undefined || + nested.filter !== undefined || + relatedEntityType !== undefined; + const args = buildArgs([ + buildOptionalArg('first', nested.first), + nested.filter + ? t.argument({ + name: 'filter', + value: buildValueAst(nested.filter), + }) + : null, + buildEnumListArg('orderBy', nested.orderBy), + ]); + + if (isConnection) { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(nestedSelections), + }), + }) + ); + } else { + fields.push( + t.field({ + name: key, + args, + selectionSet: t.selectionSet({ selections: nestedSelections }), + }) + ); + } + } + } + + return fields; +} + +// ============================================================================ +// Document Builders +// ============================================================================ + +export function buildFindManyDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { + where?: TWhere; + orderBy?: string[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; + }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'first', typeName: 'Int', value: args.first }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'last', typeName: 'Int', value: args.last }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'after', typeName: 'Cursor', value: args.after }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'before', typeName: 'Cursor', value: args.before }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { varName: 'offset', typeName: 'Int', value: args.offset }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs.length ? queryArgs : undefined, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(selections), + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildFindFirstDocument( + operationName: string, + queryField: string, + select: TSelect, + args: { where?: TWhere; orderBy?: string[] }, + filterTypeName: string, + orderByTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = []; + const queryArgs: ArgumentNode[] = []; + const variables: Record = {}; + + // Always add first: 1 for findFirst + addVariable( + { varName: 'first', typeName: 'Int', value: 1 }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, + variableDefinitions, + queryArgs, + variables + ); + addVariable( + { + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, + variableDefinitions, + queryArgs, + variables + ); + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }), + }), + ], + }); + + return { document: print(document), variables }; +} + +export function buildCreateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [entityField]: data, + }, + }, + }; +} + +export function buildUpdateDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + patchFieldName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + id: where.id, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildUpdateByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + select: TSelect, + id: string | number, + data: TData, + inputTypeName: string, + idFieldName: string, + patchFieldName: string, + connectionFieldsMap?: Record>, + extraKeys?: Record +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [idFieldName]: id, + ...extraKeys, + [patchFieldName]: data, + }, + }, + }; +} + +export function buildFindOneDocument( + operationName: string, + queryField: string, + id: string | number, + select: TSelect, + idArgName: string, + idTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + const variableDefinitions: VariableDefinitionNode[] = [ + t.variableDefinition({ + variable: t.variable({ name: idArgName }), + type: parseType(idTypeName), + }), + ]; + + const queryArgs: ArgumentNode[] = [ + t.argument({ + name: idArgName, + value: t.variable({ name: idArgName }), + }), + ]; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: { [idArgName]: id }, + }; +} + +export function buildDeleteDocument( + operationName: string, + mutationField: string, + entityField: string, + where: TWhere, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ + selections: entitySelections, + }), + }), + ], + }), + variables: { + input: { + id: where.id, + }, + }, + }; +} + +export function buildDeleteByPkDocument( + operationName: string, + mutationField: string, + entityField: string, + keys: Record, + inputTypeName: string, + select?: TSelect, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const entitySelections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections: entitySelections }), + }), + ], + }), + variables: { + input: keys, + }, + }; +} + +export function buildJunctionRemoveDocument( + operationName: string, + mutationField: string, + keys: Record, + inputTypeName: string +): { document: string; variables: Record } { + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [t.field({ name: 'clientMutationId' })], + }), + variables: { + input: keys, + }, + }; +} + +export function buildCustomDocument( + operationType: 'query' | 'mutation', + operationName: string, + fieldName: string, + select: TSelect, + args: TArgs, + variableDefinitions: Array<{ name: string; type: string }>, + connectionFieldsMap?: Record>, + entityType?: string +): { document: string; variables: Record } { + let actualSelect: TSelect = select; + let isConnection = false; + + if (isCustomSelectionWrapper(select)) { + actualSelect = select.select as TSelect; + isConnection = select.connection === true; + } + + const selections = actualSelect + ? buildSelections(actualSelect as Record, connectionFieldsMap, entityType) + : []; + + const variableDefs = variableDefinitions.map((definition) => + t.variableDefinition({ + variable: t.variable({ name: definition.name }), + type: parseType(definition.type), + }) + ); + const fieldArgs = variableDefinitions.map((definition) => + t.argument({ + name: definition.name, + value: t.variable({ name: definition.name }), + }) + ); + + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; + + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY, + name: operationName, + variableDefinitions: variableDefs.length ? variableDefs : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: fieldName, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: fieldSelections.length + ? t.selectionSet({ selections: fieldSelections }) + : undefined, + }), + ], + }), + }), + ], + }); + + return { + document: print(document), + variables: (args ?? {}) as Record, + }; +} + +function isCustomSelectionWrapper( + value: unknown +): value is { select: Record; connection?: boolean } { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + + const record = value as Record; + const keys = Object.keys(record); + + if (!keys.includes('select') || !keys.includes('connection')) { + return false; + } + + if (keys.some((key) => key !== 'select' && key !== 'connection')) { + return false; + } + + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); +} + +// ============================================================================ +// Helper Functions +// ============================================================================ + +function buildArgs(args: Array): ArgumentNode[] { + return args.filter((arg): arg is ArgumentNode => arg !== null); +} + +function buildOptionalArg(name: string, value: number | string | undefined): ArgumentNode | null { + if (value === undefined) { + return null; + } + const valueNode = + typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); + return t.argument({ name, value: valueNode }); +} + +function buildEnumListArg(name: string, values: string[] | undefined): ArgumentNode | null { + if (!values || values.length === 0) { + return null; + } + return t.argument({ + name, + value: t.listValue({ + values: values.map((value) => buildEnumValue(value)), + }), + }); +} + +function buildEnumValue(value: string): EnumValueNode { + return { + kind: ENUM_VALUE_KIND, + value, + }; +} + +function buildPageInfoSelections(): FieldNode[] { + return [ + t.field({ name: 'hasNextPage' }), + t.field({ name: 'hasPreviousPage' }), + t.field({ name: 'startCursor' }), + t.field({ name: 'endCursor' }), + ]; +} + +function buildConnectionSelections(nodeSelections: FieldNode[]): FieldNode[] { + return [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections: nodeSelections }), + }), + t.field({ name: 'totalCount' }), + t.field({ + name: 'pageInfo', + selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }), + }), + ]; +} + +interface VariableSpec { + varName: string; + argName?: string; + typeName?: string; + value: unknown; +} + +interface InputMutationConfig { + operationName: string; + mutationField: string; + inputTypeName: string; + resultSelections: FieldNode[]; +} + +function buildInputMutationDocument(config: InputMutationConfig): string { + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_MUTATION, + name: config.operationName + 'Mutation', + variableDefinitions: [ + t.variableDefinition({ + variable: t.variable({ name: 'input' }), + type: parseType(config.inputTypeName + '!'), + }), + ], + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: config.mutationField, + args: [ + t.argument({ + name: 'input', + value: t.variable({ name: 'input' }), + }), + ], + selectionSet: t.selectionSet({ + selections: config.resultSelections, + }), + }), + ], + }), + }), + ], + }); + return print(document); +} + +function addVariable( + spec: VariableSpec, + definitions: VariableDefinitionNode[], + args: ArgumentNode[], + variables: Record +): void { + if (spec.value === undefined || !spec.typeName) return; + + definitions.push( + t.variableDefinition({ + variable: t.variable({ name: spec.varName }), + type: parseType(spec.typeName), + }) + ); + args.push( + t.argument({ + name: spec.argName ?? spec.varName, + value: t.variable({ name: spec.varName }), + }) + ); + variables[spec.varName] = spec.value; +} + +function buildValueAst( + value: unknown +): + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | ReturnType + | EnumValueNode { + if (value === null) { + return t.nullValue(); + } + + if (typeof value === 'boolean') { + return t.booleanValue({ value }); + } + + if (typeof value === 'number') { + return Number.isInteger(value) + ? t.intValue({ value: value.toString() }) + : t.floatValue({ value: value.toString() }); + } + + if (typeof value === 'string') { + return t.stringValue({ value }); + } + + if (Array.isArray(value)) { + return t.listValue({ + values: value.map((item) => buildValueAst(item)), + }); + } + + if (typeof value === 'object' && value !== null) { + const obj = value as Record; + return t.objectValue({ + fields: Object.entries(obj).map(([key, val]) => + t.objectField({ + name: key, + value: buildValueAst(val), + }) + ), + }); + } + + throw new Error('Unsupported value type: ' + typeof value); +} + +// ============================================================================ +// Bulk Mutation Document Builders +// ============================================================================ + +export function buildBulkInsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict?: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + ...(onConflict ? { onConflict } : {}), + }, + }, + }; +} + +export function buildBulkUpsertDocument( + operationName: string, + mutationField: string, + select: TSelect, + data: TData[], + inputTypeName: string, + onConflict: unknown, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + onConflict, + }, + }, + }; +} + +export function buildBulkUpdateDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + data: TData, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + patch: data, + }, + }, + }; +} + +export function buildBulkDeleteDocument( + operationName: string, + mutationField: string, + select: TSelect, + where: TWhere, + inputTypeName: string, + connectionFieldsMap?: Record> +): { document: string; variables: Record } { + const selections = select + ? buildSelections(select as Record, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + }, + }, + }; +} diff --git a/sdk/constructive-sdk/src/config/orm/realtime.ts b/sdk/constructive-sdk/src/config/orm/realtime.ts new file mode 100644 index 0000000000..214eb56203 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/realtime.ts @@ -0,0 +1,244 @@ +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// Minimal type shims so this module compiles without graphql-ws +// installed. Consumers supply a WsClient via RealtimeConfig; +// the SDK itself never imports or requires graphql-ws. + +interface WsGraphQLError { + readonly message: string; + readonly [key: string]: unknown; +} + +interface WsExecutionResult> { + data?: TData | null; + errors?: readonly WsGraphQLError[]; + extensions?: Record; +} + +interface WsSink { + next(value: T): void; + error(error: unknown): void; + complete(): void; +} + +/** + * Minimal interface matching the graphql-ws Client. + * Consumers pass a concrete instance via RealtimeConfig.client. + */ +export interface WsClient { + subscribe>( + payload: { query: string; variables?: Record }, + sink: WsSink> + ): () => void; + dispose(): void; +} + +// ============================================================================ +// Types +// ============================================================================ + +/** The DML operation that triggered the subscription event */ +export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; + +/** Connection state of the WebSocket */ +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; + +/** Listener for connection state changes */ +export type ConnectionStateListener = (state: ConnectionState) => void; + +/** Function returned by subscribe() to cancel the subscription */ +export type Unsubscribe = () => void; + +/** + * A realtime subscription event delivered to the client. + * + * @typeParam T - The row type of the subscribed table + */ +export interface SubscriptionEvent { + /** The DML operation that triggered this event */ + operation: SubscriptionOperation; + /** The current row data (null for DELETE if row is no longer visible) */ + data: T | null; + /** Previous field values (populated on UPDATE when available) */ + previousValues?: Partial; + /** Server-side timestamp of when the change occurred */ + timestamp: string; +} + +/** + * Options for creating a subscription. + * + * @typeParam T - The row type of the subscribed table + * @typeParam TFilter - The filter type for the table + */ +export interface SubscribeOptions> { + /** Server-side filter to limit which events are delivered */ + filter?: TFilter; + /** Called when a subscription event is received */ + onEvent: (event: SubscriptionEvent) => void; + /** Called when the subscription encounters an error */ + onError?: (error: Error) => void; + /** Called when the subscription completes (server-initiated close) */ + onComplete?: () => void; +} + +/** + * Metadata about a subscription field, used internally to map + * table names to GraphQL subscription field names and types. + */ +export interface SubscriptionFieldMeta { + /** The GraphQL subscription field name (e.g., 'onContactChanged') */ + fieldName: string; + /** The table name in the source schema (e.g., 'contact') */ + tableName: string; + /** The data field name inside the subscription payload (e.g., 'contact') */ + dataFieldName: string; +} + +/** + * Configuration for the realtime (WebSocket) connection. + * Pass this as the `realtime` option in OrmClientConfig. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * + * const client = createOrmClient({ + * endpoint: 'https://api.example.com/graphql', + * realtime: { + * client: createClient({ url: 'wss://api.example.com/graphql' }), + * }, + * }); + * ``` + */ +export interface RealtimeConfig { + /** + * A graphql-ws Client instance (or any object satisfying WsClient). + * The consumer creates this themselves, giving full control over + * connection options, auth, and transport. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * const wsClient = createClient({ url: 'wss://...' }); + * ``` + */ + client: WsClient; +} + +// ============================================================================ +// RealtimeManager +// ============================================================================ + +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +export class RealtimeManager { + private wsClient: WsClient; + private connectionState: ConnectionState = 'disconnected'; + private stateListeners: Set = new Set(); + private activeSubscriptions = 0; + + constructor(config: RealtimeConfig) { + this.wsClient = config.client; + } + + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe( + meta: SubscriptionFieldMeta, + document: string, + variables: Record, + options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + } + ): Unsubscribe { + this.activeSubscriptions++; + let disposed = false; + + const cleanup = this.wsClient.subscribe>( + { query: document, variables }, + { + next: (result) => { + if (disposed) return; + if (result.errors) { + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); + return; + } + + const payload = result.data?.[meta.fieldName] as + | { event?: string; [key: string]: unknown } + | undefined; + + if (!payload) return; + + const event: SubscriptionEvent = { + operation: (payload.event as SubscriptionOperation) ?? 'UPDATE', + data: (payload[meta.dataFieldName] as T) ?? null, + previousValues: payload.previousValues as Partial | undefined, + timestamp: (payload.timestamp as string) ?? new Date().toISOString(), + }; + options.onEvent(event); + }, + error: (err) => { + if (disposed) return; + options.onError?.(err instanceof Error ? err : new Error(String(err))); + }, + complete: () => { + if (disposed) return; + options.onComplete?.(); + }, + } + ); + + return () => { + if (disposed) return; + disposed = true; + this.activeSubscriptions--; + cleanup(); + }; + } + + /** Register a listener for connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe { + this.stateListeners.add(listener); + return () => { + this.stateListeners.delete(listener); + }; + } + + /** Get current connection state */ + getConnectionState(): ConnectionState { + return this.connectionState; + } + + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number { + return this.activeSubscriptions; + } + + /** Dispose the manager and close the WebSocket connection */ + dispose(): void { + this.wsClient.dispose(); + this.stateListeners.clear(); + this.activeSubscriptions = 0; + this.setConnectionState('disconnected'); + } + + private setConnectionState(state: ConnectionState): void { + if (this.connectionState === state) return; + this.connectionState = state; + for (const listener of this.stateListeners) { + listener(state); + } + } +} diff --git a/sdk/constructive-sdk/src/config/orm/select-types.ts b/sdk/constructive-sdk/src/config/orm/select-types.ts new file mode 100644 index 0000000000..4b39d7e820 --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/select-types.ts @@ -0,0 +1,169 @@ +/** + * Type utilities for select inference + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} + +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} + +export interface FindManyArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} + +export interface FindFirstArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; +} + +export interface CreateArgs { + data: TData; + select?: TSelect; +} + +export interface UpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export type FindOneArgs = { + select?: TSelect; +} & Record; + +export interface DeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkInsertArgs { + data: TData[]; + select?: TSelect; + onConflict?: TOnConflict; +} + +export interface BulkUpsertArgs { + data: TData[]; + select?: TSelect; + onConflict: TOnConflict; +} + +export interface BulkUpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} + +export interface BulkDeleteArgs { + where: TWhere; + select?: TSelect; +} + +export interface BulkMutationResult { + affectedCount: number; + returning: T[]; +} + +type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +type DecrementDepth = { + 0: 0; + 1: 0; + 2: 1; + 3: 2; + 4: 3; + 5: 4; + 6: 5; + 7: 6; + 8: 7; + 9: 8; + 10: 9; +}; + +/** + * Recursively validates select objects, rejecting unknown keys. + * + * NOTE: Depth is intentionally capped to avoid circular-instantiation issues + * in very large cyclic schemas. + */ +export type DeepExact = Depth extends 0 + ? T extends Shape + ? T + : never + : T extends Shape + ? Exclude extends never + ? { + [K in keyof T]: K extends keyof Shape + ? T[K] extends { select: infer NS } + ? Extract extends { + select?: infer ShapeNS; + } + ? DeepExact< + Omit & { + select: DeepExact, DecrementDepth[Depth]>; + }, + Extract, + DecrementDepth[Depth] + > + : never + : T[K] + : never; + } + : never + : never; + +/** + * Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`. + * Use this as an intersection in overloads: + * `{ select: S } & StrictSelect`. + */ +export type StrictSelect = S extends DeepExact ? {} : never; + +/** + * Hook-optimized strict select variant. + * + * Uses a shallower recursion depth to keep editor autocomplete responsive + * in large schemas while still validating common nested-select mistakes. + */ +export type HookStrictSelect = S extends DeepExact ? {} : never; + +/** + * Infer result type from select configuration + */ +export type InferSelectResult = TSelect extends undefined + ? TEntity + : { + [K in keyof TSelect as TSelect[K] extends false | undefined + ? never + : K]: TSelect[K] extends true + ? K extends keyof TEntity + ? TEntity[K] + : never + : TSelect[K] extends { select: infer NestedSelect } + ? K extends keyof TEntity + ? NonNullable extends ConnectionResult + ? ConnectionResult> + : + | InferSelectResult, NestedSelect> + | (null extends TEntity[K] ? null : never) + : never + : K extends keyof TEntity + ? TEntity[K] + : never; + }; diff --git a/sdk/constructive-sdk/src/config/orm/types.ts b/sdk/constructive-sdk/src/config/orm/types.ts new file mode 100644 index 0000000000..7c1120bcdf --- /dev/null +++ b/sdk/constructive-sdk/src/config/orm/types.ts @@ -0,0 +1,8 @@ +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ + +// Re-export all types from input-types +export * from './input-types'; diff --git a/sdk/constructive-sdk/src/index.ts b/sdk/constructive-sdk/src/index.ts index dca8c56ed3..eb54985786 100644 --- a/sdk/constructive-sdk/src/index.ts +++ b/sdk/constructive-sdk/src/index.ts @@ -10,6 +10,8 @@ export * as admin from './admin'; export * as agent from './agent'; export * as api from './api'; export * as auth from './auth'; +export * as compute from './compute'; +export * as config from './config'; export * as modules from './modules'; export * as objects from './objects'; export * as usage from './usage'; diff --git a/sdk/constructive-sdk/src/modules/README.md b/sdk/constructive-sdk/src/modules/README.md index aa2f7100c0..da85bdefa2 100644 --- a/sdk/constructive-sdk/src/modules/README.md +++ b/sdk/constructive-sdk/src/modules/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 57 +- **Tables:** 59 - **Custom queries:** 2 - **Custom mutations:** 10 diff --git a/sdk/constructive-sdk/src/modules/orm/README.md b/sdk/constructive-sdk/src/modules/orm/README.md index 029e5d6ca7..495d56755f 100644 --- a/sdk/constructive-sdk/src/modules/orm/README.md +++ b/sdk/constructive-sdk/src/modules/orm/README.md @@ -57,14 +57,16 @@ const db = createClient({ | `functionInvocationModule` | findMany, findOne, create, update, delete | | `functionModule` | findMany, findOne, create, update, delete | | `invitesModule` | findMany, findOne, create, update, delete | -| `namespaceModule` | findMany, findOne, create, update, delete | | `computeLogModule` | findMany, findOne, create, update, delete | | `inferenceLogModule` | findMany, findOne, create, update, delete | +| `namespaceModule` | findMany, findOne, create, update, delete | | `storageLogModule` | findMany, findOne, create, update, delete | | `transferLogModule` | findMany, findOne, create, update, delete | +| `functionDeploymentModule` | findMany, findOne, create, update, delete | | `plansModule` | findMany, findOne, create, update, delete | | `billingProviderModule` | findMany, findOne, create, update, delete | | `dbUsageModule` | findMany, findOne, create, update, delete | +| `graphExecutionModule` | findMany, findOne, create, update, delete | | `hierarchyModule` | findMany, findOne, create, update, delete | | `permissionsModule` | findMany, findOne, create, update, delete | | `notificationsModule` | findMany, findOne, create, update, delete | @@ -1113,8 +1115,6 @@ CRUD operations for GraphModule records. | `prefix` | String | Yes | | `merkleStoreModuleId` | UUID | Yes | | `graphsTableId` | UUID | Yes | -| `executionsTableId` | UUID | Yes | -| `outputsTableId` | UUID | Yes | | `apiName` | String | Yes | | `privateApiName` | String | Yes | | `entityTableId` | UUID | Yes | @@ -1127,13 +1127,13 @@ CRUD operations for GraphModule records. ```typescript // List all graphModule records -const items = await db.graphModule.findMany({ select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const items = await db.graphModule.findMany({ select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Get one by id -const item = await db.graphModule.findOne({ id: '', select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, executionsTableId: true, outputsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const item = await db.graphModule.findOne({ id: '', select: { id: true, databaseId: true, publicSchemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, scope: true, prefix: true, merkleStoreModuleId: true, graphsTableId: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Create -const created = await db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', executionsTableId: '', outputsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); +const created = await db.graphModule.create({ data: { databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); // Update const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); @@ -1498,52 +1498,6 @@ const updated = await db.invitesModule.update({ where: { id: '' }, data: { const deleted = await db.invitesModule.delete({ where: { id: '' } }).execute(); ``` -### `db.namespaceModule` - -CRUD operations for NamespaceModule records. - -**Fields:** - -| Field | Type | Editable | -|-------|------|----------| -| `id` | UUID | No | -| `databaseId` | UUID | Yes | -| `schemaId` | UUID | Yes | -| `privateSchemaId` | UUID | Yes | -| `publicSchemaName` | String | Yes | -| `privateSchemaName` | String | Yes | -| `namespacesTableId` | UUID | Yes | -| `namespaceEventsTableId` | UUID | Yes | -| `namespacesTableName` | String | Yes | -| `namespaceEventsTableName` | String | Yes | -| `apiName` | String | Yes | -| `privateApiName` | String | Yes | -| `scope` | String | Yes | -| `prefix` | String | Yes | -| `entityTableId` | UUID | Yes | -| `policies` | JSON | Yes | -| `provisions` | JSON | Yes | -| `defaultPermissions` | String | Yes | - -**Operations:** - -```typescript -// List all namespaceModule records -const items = await db.namespaceModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); - -// Get one by id -const item = await db.namespaceModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); - -// Create -const created = await db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); - -// Update -const updated = await db.namespaceModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); - -// Delete -const deleted = await db.namespaceModule.delete({ where: { id: '' } }).execute(); -``` - ### `db.computeLogModule` CRUD operations for ComputeLogModule records. @@ -1638,6 +1592,53 @@ const updated = await db.inferenceLogModule.update({ where: { id: '' }, da const deleted = await db.inferenceLogModule.delete({ where: { id: '' } }).execute(); ``` +### `db.namespaceModule` + +CRUD operations for NamespaceModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `namespacesTableId` | UUID | Yes | +| `namespaceEventsTableId` | UUID | Yes | +| `namespacesTableName` | String | Yes | +| `namespaceEventsTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `entityTableId` | UUID | Yes | +| `platformNamespacesTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | + +**Operations:** + +```typescript +// List all namespaceModule records +const items = await db.namespaceModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Get one by id +const item = await db.namespaceModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, namespacesTableId: true, namespaceEventsTableId: true, namespacesTableName: true, namespaceEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, platformNamespacesTableId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Create +const created = await db.namespaceModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', namespacesTableId: '', namespaceEventsTableId: '', namespacesTableName: '', namespaceEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', platformNamespacesTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.namespaceModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.namespaceModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.storageLogModule` CRUD operations for StorageLogModule records. @@ -1732,6 +1733,54 @@ const updated = await db.transferLogModule.update({ where: { id: '' }, dat const deleted = await db.transferLogModule.delete({ where: { id: '' } }).execute(); ``` +### `db.functionDeploymentModule` + +CRUD operations for FunctionDeploymentModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `deploymentsTableId` | UUID | Yes | +| `deploymentEventsTableId` | UUID | Yes | +| `deploymentsTableName` | String | Yes | +| `deploymentEventsTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `entityTableId` | UUID | Yes | +| `functionModuleId` | UUID | Yes | +| `namespaceModuleId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | + +**Operations:** + +```typescript +// List all functionDeploymentModule records +const items = await db.functionDeploymentModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Get one by id +const item = await db.functionDeploymentModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, deploymentsTableId: true, deploymentEventsTableId: true, deploymentsTableName: true, deploymentEventsTableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, functionModuleId: true, namespaceModuleId: true, policies: true, provisions: true, defaultPermissions: true } }).execute(); + +// Create +const created = await db.functionDeploymentModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', deploymentsTableId: '', deploymentEventsTableId: '', deploymentsTableName: '', deploymentEventsTableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', functionModuleId: '', namespaceModuleId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.functionDeploymentModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.functionDeploymentModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.plansModule` CRUD operations for PlansModule records. @@ -1881,6 +1930,56 @@ const updated = await db.dbUsageModule.update({ where: { id: '' }, data: { const deleted = await db.dbUsageModule.delete({ where: { id: '' } }).execute(); ``` +### `db.graphExecutionModule` + +CRUD operations for GraphExecutionModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `graphModuleId` | UUID | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `executionsTableId` | UUID | Yes | +| `outputsTableId` | UUID | Yes | +| `nodeStatesTableId` | UUID | Yes | +| `executionsTableName` | String | Yes | +| `outputsTableName` | String | Yes | +| `nodeStatesTableName` | String | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `entityTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | +| `createdAt` | Datetime | No | + +**Operations:** + +```typescript +// List all graphExecutionModule records +const items = await db.graphExecutionModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); + +// Get one by id +const item = await db.graphExecutionModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, graphModuleId: true, scope: true, prefix: true, executionsTableId: true, outputsTableId: true, nodeStatesTableId: true, executionsTableName: true, outputsTableName: true, nodeStatesTableName: true, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); + +// Create +const created = await db.graphExecutionModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', graphModuleId: '', scope: '', prefix: '', executionsTableId: '', outputsTableId: '', nodeStatesTableId: '', executionsTableName: '', outputsTableName: '', nodeStatesTableName: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.graphExecutionModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.graphExecutionModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.hierarchyModule` CRUD operations for HierarchyModule records. diff --git a/sdk/constructive-sdk/src/modules/orm/index.ts b/sdk/constructive-sdk/src/modules/orm/index.ts index e8c151cfdb..7c5a882c52 100644 --- a/sdk/constructive-sdk/src/modules/orm/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/index.ts @@ -41,14 +41,16 @@ import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; import { FunctionModuleModel } from './models/functionModule'; import { InvitesModuleModel } from './models/invitesModule'; -import { NamespaceModuleModel } from './models/namespaceModule'; import { ComputeLogModuleModel } from './models/computeLogModule'; import { InferenceLogModuleModel } from './models/inferenceLogModule'; +import { NamespaceModuleModel } from './models/namespaceModule'; import { StorageLogModuleModel } from './models/storageLogModule'; import { TransferLogModuleModel } from './models/transferLogModule'; +import { FunctionDeploymentModuleModel } from './models/functionDeploymentModule'; import { PlansModuleModel } from './models/plansModule'; import { BillingProviderModuleModel } from './models/billingProviderModule'; import { DbUsageModuleModel } from './models/dbUsageModule'; +import { GraphExecutionModuleModel } from './models/graphExecutionModule'; import { HierarchyModuleModel } from './models/hierarchyModule'; import { PermissionsModuleModel } from './models/permissionsModule'; import { NotificationsModuleModel } from './models/notificationsModule'; @@ -133,14 +135,16 @@ export function createClient(config: OrmClientConfig) { functionInvocationModule: new FunctionInvocationModuleModel(client), functionModule: new FunctionModuleModel(client), invitesModule: new InvitesModuleModel(client), - namespaceModule: new NamespaceModuleModel(client), computeLogModule: new ComputeLogModuleModel(client), inferenceLogModule: new InferenceLogModuleModel(client), + namespaceModule: new NamespaceModuleModel(client), storageLogModule: new StorageLogModuleModel(client), transferLogModule: new TransferLogModuleModel(client), + functionDeploymentModule: new FunctionDeploymentModuleModel(client), plansModule: new PlansModuleModel(client), billingProviderModule: new BillingProviderModuleModel(client), dbUsageModule: new DbUsageModuleModel(client), + graphExecutionModule: new GraphExecutionModuleModel(client), hierarchyModule: new HierarchyModuleModel(client), permissionsModule: new PermissionsModuleModel(client), notificationsModule: new NotificationsModuleModel(client), diff --git a/sdk/constructive-sdk/src/modules/orm/input-types.ts b/sdk/constructive-sdk/src/modules/orm/input-types.ts index 62271cf277..ddd8bf6a34 100644 --- a/sdk/constructive-sdk/src/modules/orm/input-types.ts +++ b/sdk/constructive-sdk/src/modules/orm/input-types.ts @@ -635,8 +635,6 @@ export interface GraphModule { prefix?: string | null; merkleStoreModuleId?: string | null; graphsTableId?: string | null; - executionsTableId?: string | null; - outputsTableId?: string | null; apiName?: string | null; privateApiName?: string | null; entityTableId?: string | null; @@ -808,26 +806,6 @@ export interface InvitesModule { apiName?: string | null; privateApiName?: string | null; } -export interface NamespaceModule { - id: string; - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - namespacesTableId?: string | null; - namespaceEventsTableId?: string | null; - namespacesTableName?: string | null; - namespaceEventsTableName?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; -} export interface ComputeLogModule { id: string; databaseId?: string | null; @@ -870,6 +848,27 @@ export interface InferenceLogModule { apiName?: string | null; privateApiName?: string | null; } +export interface NamespaceModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + namespacesTableId?: string | null; + namespaceEventsTableId?: string | null; + namespacesTableName?: string | null; + namespaceEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + platformNamespacesTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} export interface StorageLogModule { id: string; databaseId?: string | null; @@ -912,6 +911,28 @@ export interface TransferLogModule { apiName?: string | null; privateApiName?: string | null; } +export interface FunctionDeploymentModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + deploymentsTableId?: string | null; + deploymentEventsTableId?: string | null; + deploymentsTableName?: string | null; + deploymentEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + functionModuleId?: string | null; + namespaceModuleId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} export interface PlansModule { id: string; databaseId?: string | null; @@ -983,6 +1004,30 @@ export interface DbUsageModule { apiName?: string | null; privateApiName?: string | null; } +export interface GraphExecutionModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + graphModuleId?: string | null; + scope?: string | null; + prefix?: string | null; + executionsTableId?: string | null; + outputsTableId?: string | null; + nodeStatesTableId?: string | null; + executionsTableName?: string | null; + outputsTableName?: string | null; + nodeStatesTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; + createdAt?: string | null; +} export interface HierarchyModule { id: string; databaseId?: string | null; @@ -1800,14 +1845,21 @@ export interface WebauthnAuthModuleRelations {} export interface FunctionInvocationModuleRelations {} export interface FunctionModuleRelations {} export interface InvitesModuleRelations {} -export interface NamespaceModuleRelations {} export interface ComputeLogModuleRelations {} export interface InferenceLogModuleRelations {} +export interface NamespaceModuleRelations {} export interface StorageLogModuleRelations {} export interface TransferLogModuleRelations {} +export interface FunctionDeploymentModuleRelations { + functionModule?: FunctionModule | null; + namespaceModule?: NamespaceModule | null; +} export interface PlansModuleRelations {} export interface BillingProviderModuleRelations {} export interface DbUsageModuleRelations {} +export interface GraphExecutionModuleRelations { + graphModule?: GraphModule | null; +} export interface HierarchyModuleRelations {} export interface PermissionsModuleRelations {} export interface NotificationsModuleRelations {} @@ -1873,15 +1925,19 @@ export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; -export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; +export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; export type StorageLogModuleWithRelations = StorageLogModule & StorageLogModuleRelations; export type TransferLogModuleWithRelations = TransferLogModule & TransferLogModuleRelations; +export type FunctionDeploymentModuleWithRelations = FunctionDeploymentModule & + FunctionDeploymentModuleRelations; export type PlansModuleWithRelations = PlansModule & PlansModuleRelations; export type BillingProviderModuleWithRelations = BillingProviderModule & BillingProviderModuleRelations; export type DbUsageModuleWithRelations = DbUsageModule & DbUsageModuleRelations; +export type GraphExecutionModuleWithRelations = GraphExecutionModule & + GraphExecutionModuleRelations; export type HierarchyModuleWithRelations = HierarchyModule & HierarchyModuleRelations; export type PermissionsModuleWithRelations = PermissionsModule & PermissionsModuleRelations; export type NotificationsModuleWithRelations = NotificationsModule & NotificationsModuleRelations; @@ -2252,8 +2308,6 @@ export type GraphModuleSelect = { prefix?: boolean; merkleStoreModuleId?: boolean; graphsTableId?: boolean; - executionsTableId?: boolean; - outputsTableId?: boolean; apiName?: boolean; privateApiName?: boolean; entityTableId?: boolean; @@ -2413,26 +2467,6 @@ export type InvitesModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; -export type NamespaceModuleSelect = { - id?: boolean; - databaseId?: boolean; - schemaId?: boolean; - privateSchemaId?: boolean; - publicSchemaName?: boolean; - privateSchemaName?: boolean; - namespacesTableId?: boolean; - namespaceEventsTableId?: boolean; - namespacesTableName?: boolean; - namespaceEventsTableName?: boolean; - apiName?: boolean; - privateApiName?: boolean; - scope?: boolean; - prefix?: boolean; - entityTableId?: boolean; - policies?: boolean; - provisions?: boolean; - defaultPermissions?: boolean; -}; export type ComputeLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2475,6 +2509,27 @@ export type InferenceLogModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type NamespaceModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + namespacesTableId?: boolean; + namespaceEventsTableId?: boolean; + namespacesTableName?: boolean; + namespaceEventsTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + scope?: boolean; + prefix?: boolean; + entityTableId?: boolean; + platformNamespacesTableId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; +}; export type StorageLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2517,6 +2572,34 @@ export type TransferLogModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type FunctionDeploymentModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + deploymentsTableId?: boolean; + deploymentEventsTableId?: boolean; + deploymentsTableName?: boolean; + deploymentEventsTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + scope?: boolean; + prefix?: boolean; + entityTableId?: boolean; + functionModuleId?: boolean; + namespaceModuleId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; + functionModule?: { + select: FunctionModuleSelect; + }; + namespaceModule?: { + select: NamespaceModuleSelect; + }; +}; export type PlansModuleSelect = { id?: boolean; databaseId?: boolean; @@ -2588,6 +2671,33 @@ export type DbUsageModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type GraphExecutionModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + privateSchemaId?: boolean; + publicSchemaName?: boolean; + privateSchemaName?: boolean; + graphModuleId?: boolean; + scope?: boolean; + prefix?: boolean; + executionsTableId?: boolean; + outputsTableId?: boolean; + nodeStatesTableId?: boolean; + executionsTableName?: boolean; + outputsTableName?: boolean; + nodeStatesTableName?: boolean; + apiName?: boolean; + privateApiName?: boolean; + entityTableId?: boolean; + policies?: boolean; + provisions?: boolean; + defaultPermissions?: boolean; + createdAt?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; +}; export type HierarchyModuleSelect = { id?: boolean; databaseId?: boolean; @@ -3796,10 +3906,6 @@ export interface GraphModuleFilter { merkleStoreModuleId?: UUIDFilter; /** Filter by the object’s `graphsTableId` field. */ graphsTableId?: UUIDFilter; - /** Filter by the object’s `executionsTableId` field. */ - executionsTableId?: UUIDFilter; - /** Filter by the object’s `outputsTableId` field. */ - outputsTableId?: UUIDFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ @@ -4151,50 +4257,6 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } -export interface NamespaceModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `schemaId` field. */ - schemaId?: UUIDFilter; - /** Filter by the object’s `privateSchemaId` field. */ - privateSchemaId?: UUIDFilter; - /** Filter by the object’s `publicSchemaName` field. */ - publicSchemaName?: StringFilter; - /** Filter by the object’s `privateSchemaName` field. */ - privateSchemaName?: StringFilter; - /** Filter by the object’s `namespacesTableId` field. */ - namespacesTableId?: UUIDFilter; - /** Filter by the object’s `namespaceEventsTableId` field. */ - namespaceEventsTableId?: UUIDFilter; - /** Filter by the object’s `namespacesTableName` field. */ - namespacesTableName?: StringFilter; - /** Filter by the object’s `namespaceEventsTableName` field. */ - namespaceEventsTableName?: StringFilter; - /** Filter by the object’s `apiName` field. */ - apiName?: StringFilter; - /** Filter by the object’s `privateApiName` field. */ - privateApiName?: StringFilter; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Filter by the object’s `entityTableId` field. */ - entityTableId?: UUIDFilter; - /** Filter by the object’s `policies` field. */ - policies?: JSONFilter; - /** Filter by the object’s `provisions` field. */ - provisions?: JSONFilter; - /** Filter by the object’s `defaultPermissions` field. */ - defaultPermissions?: StringListFilter; - /** Checks for all expressions in this list. */ - and?: NamespaceModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: NamespaceModuleFilter[]; - /** Negates the expression. */ - not?: NamespaceModuleFilter; -} export interface ComputeLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -4287,7 +4349,7 @@ export interface InferenceLogModuleFilter { /** Negates the expression. */ not?: InferenceLogModuleFilter; } -export interface StorageLogModuleFilter { +export interface NamespaceModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -4300,40 +4362,86 @@ export interface StorageLogModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `storageLogTableId` field. */ - storageLogTableId?: UUIDFilter; - /** Filter by the object’s `storageLogTableName` field. */ - storageLogTableName?: StringFilter; - /** Filter by the object’s `usageDailyTableId` field. */ - usageDailyTableId?: UUIDFilter; - /** Filter by the object’s `usageDailyTableName` field. */ - usageDailyTableName?: StringFilter; - /** Filter by the object’s `interval` field. */ - interval?: StringFilter; - /** Filter by the object’s `retention` field. */ - retention?: StringFilter; - /** Filter by the object’s `premake` field. */ - premake?: IntFilter; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `actorFkTableId` field. */ - actorFkTableId?: UUIDFilter; - /** Filter by the object’s `entityFkTableId` field. */ - entityFkTableId?: UUIDFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; + /** Filter by the object’s `namespacesTableId` field. */ + namespacesTableId?: UUIDFilter; + /** Filter by the object’s `namespaceEventsTableId` field. */ + namespaceEventsTableId?: UUIDFilter; + /** Filter by the object’s `namespacesTableName` field. */ + namespacesTableName?: StringFilter; + /** Filter by the object’s `namespaceEventsTableName` field. */ + namespaceEventsTableName?: StringFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ privateApiName?: StringFilter; - /** Checks for all expressions in this list. */ - and?: StorageLogModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: StorageLogModuleFilter[]; - /** Negates the expression. */ - not?: StorageLogModuleFilter; -} -export interface TransferLogModuleFilter { + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `platformNamespacesTableId` field. */ + platformNamespacesTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: NamespaceModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: NamespaceModuleFilter[]; + /** Negates the expression. */ + not?: NamespaceModuleFilter; +} +export interface StorageLogModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `storageLogTableId` field. */ + storageLogTableId?: UUIDFilter; + /** Filter by the object’s `storageLogTableName` field. */ + storageLogTableName?: StringFilter; + /** Filter by the object’s `usageDailyTableId` field. */ + usageDailyTableId?: UUIDFilter; + /** Filter by the object’s `usageDailyTableName` field. */ + usageDailyTableName?: StringFilter; + /** Filter by the object’s `interval` field. */ + interval?: StringFilter; + /** Filter by the object’s `retention` field. */ + retention?: StringFilter; + /** Filter by the object’s `premake` field. */ + premake?: IntFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `actorFkTableId` field. */ + actorFkTableId?: UUIDFilter; + /** Filter by the object’s `entityFkTableId` field. */ + entityFkTableId?: UUIDFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: StorageLogModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: StorageLogModuleFilter[]; + /** Negates the expression. */ + not?: StorageLogModuleFilter; +} +export interface TransferLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -4379,6 +4487,62 @@ export interface TransferLogModuleFilter { /** Negates the expression. */ not?: TransferLogModuleFilter; } +export interface FunctionDeploymentModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `deploymentsTableId` field. */ + deploymentsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentEventsTableId` field. */ + deploymentEventsTableId?: UUIDFilter; + /** Filter by the object’s `deploymentsTableName` field. */ + deploymentsTableName?: StringFilter; + /** Filter by the object’s `deploymentEventsTableName` field. */ + deploymentEventsTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `functionModuleId` field. */ + functionModuleId?: UUIDFilter; + /** Filter by the object’s `namespaceModuleId` field. */ + namespaceModuleId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Checks for all expressions in this list. */ + and?: FunctionDeploymentModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: FunctionDeploymentModuleFilter[]; + /** Negates the expression. */ + not?: FunctionDeploymentModuleFilter; + /** Filter by the object’s `functionModule` relation. */ + functionModule?: FunctionModuleFilter; + /** A related `functionModule` exists. */ + functionModuleExists?: boolean; + /** Filter by the object’s `namespaceModule` relation. */ + namespaceModule?: NamespaceModuleFilter; + /** A related `namespaceModule` exists. */ + namespaceModuleExists?: boolean; +} export interface PlansModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -4533,6 +4697,60 @@ export interface DbUsageModuleFilter { /** Negates the expression. */ not?: DbUsageModuleFilter; } +export interface GraphExecutionModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `schemaId` field. */ + schemaId?: UUIDFilter; + /** Filter by the object’s `privateSchemaId` field. */ + privateSchemaId?: UUIDFilter; + /** Filter by the object’s `publicSchemaName` field. */ + publicSchemaName?: StringFilter; + /** Filter by the object’s `privateSchemaName` field. */ + privateSchemaName?: StringFilter; + /** Filter by the object’s `graphModuleId` field. */ + graphModuleId?: UUIDFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `executionsTableId` field. */ + executionsTableId?: UUIDFilter; + /** Filter by the object’s `outputsTableId` field. */ + outputsTableId?: UUIDFilter; + /** Filter by the object’s `nodeStatesTableId` field. */ + nodeStatesTableId?: UUIDFilter; + /** Filter by the object’s `executionsTableName` field. */ + executionsTableName?: StringFilter; + /** Filter by the object’s `outputsTableName` field. */ + outputsTableName?: StringFilter; + /** Filter by the object’s `nodeStatesTableName` field. */ + nodeStatesTableName?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Filter by the object’s `privateApiName` field. */ + privateApiName?: StringFilter; + /** Filter by the object’s `entityTableId` field. */ + entityTableId?: UUIDFilter; + /** Filter by the object’s `policies` field. */ + policies?: JSONFilter; + /** Filter by the object’s `provisions` field. */ + provisions?: JSONFilter; + /** Filter by the object’s `defaultPermissions` field. */ + defaultPermissions?: StringListFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: GraphExecutionModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: GraphExecutionModuleFilter[]; + /** Negates the expression. */ + not?: GraphExecutionModuleFilter; + /** Filter by the object’s `graphModule` relation. */ + graphModule?: GraphModuleFilter; +} export interface HierarchyModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -6090,10 +6308,6 @@ export type GraphModuleOrderBy = | 'MERKLE_STORE_MODULE_ID_DESC' | 'GRAPHS_TABLE_ID_ASC' | 'GRAPHS_TABLE_ID_DESC' - | 'EXECUTIONS_TABLE_ID_ASC' - | 'EXECUTIONS_TABLE_ID_DESC' - | 'OUTPUTS_TABLE_ID_ASC' - | 'OUTPUTS_TABLE_ID_DESC' | 'API_NAME_ASC' | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' @@ -6404,46 +6618,6 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; -export type NamespaceModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'SCHEMA_ID_ASC' - | 'SCHEMA_ID_DESC' - | 'PRIVATE_SCHEMA_ID_ASC' - | 'PRIVATE_SCHEMA_ID_DESC' - | 'PUBLIC_SCHEMA_NAME_ASC' - | 'PUBLIC_SCHEMA_NAME_DESC' - | 'PRIVATE_SCHEMA_NAME_ASC' - | 'PRIVATE_SCHEMA_NAME_DESC' - | 'NAMESPACES_TABLE_ID_ASC' - | 'NAMESPACES_TABLE_ID_DESC' - | 'NAMESPACE_EVENTS_TABLE_ID_ASC' - | 'NAMESPACE_EVENTS_TABLE_ID_DESC' - | 'NAMESPACES_TABLE_NAME_ASC' - | 'NAMESPACES_TABLE_NAME_DESC' - | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' - | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' - | 'API_NAME_ASC' - | 'API_NAME_DESC' - | 'PRIVATE_API_NAME_ASC' - | 'PRIVATE_API_NAME_DESC' - | 'SCOPE_ASC' - | 'SCOPE_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC' - | 'ENTITY_TABLE_ID_ASC' - | 'ENTITY_TABLE_ID_DESC' - | 'POLICIES_ASC' - | 'POLICIES_DESC' - | 'PROVISIONS_ASC' - | 'PROVISIONS_DESC' - | 'DEFAULT_PERMISSIONS_ASC' - | 'DEFAULT_PERMISSIONS_DESC'; export type ComputeLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6528,6 +6702,48 @@ export type InferenceLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type NamespaceModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'NAMESPACES_TABLE_ID_ASC' + | 'NAMESPACES_TABLE_ID_DESC' + | 'NAMESPACE_EVENTS_TABLE_ID_ASC' + | 'NAMESPACE_EVENTS_TABLE_ID_DESC' + | 'NAMESPACES_TABLE_NAME_ASC' + | 'NAMESPACES_TABLE_NAME_DESC' + | 'NAMESPACE_EVENTS_TABLE_NAME_ASC' + | 'NAMESPACE_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'PLATFORM_NAMESPACES_TABLE_ID_ASC' + | 'PLATFORM_NAMESPACES_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; export type StorageLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6612,6 +6828,50 @@ export type TransferLogModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type FunctionDeploymentModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'DEPLOYMENTS_TABLE_ID_ASC' + | 'DEPLOYMENTS_TABLE_ID_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_ID_DESC' + | 'DEPLOYMENTS_TABLE_NAME_ASC' + | 'DEPLOYMENTS_TABLE_NAME_DESC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_ASC' + | 'DEPLOYMENT_EVENTS_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'FUNCTION_MODULE_ID_ASC' + | 'FUNCTION_MODULE_ID_DESC' + | 'NAMESPACE_MODULE_ID_ASC' + | 'NAMESPACE_MODULE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC'; export type PlansModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6754,6 +7014,54 @@ export type DbUsageModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type GraphExecutionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRIVATE_SCHEMA_ID_ASC' + | 'PRIVATE_SCHEMA_ID_DESC' + | 'PUBLIC_SCHEMA_NAME_ASC' + | 'PUBLIC_SCHEMA_NAME_DESC' + | 'PRIVATE_SCHEMA_NAME_ASC' + | 'PRIVATE_SCHEMA_NAME_DESC' + | 'GRAPH_MODULE_ID_ASC' + | 'GRAPH_MODULE_ID_DESC' + | 'SCOPE_ASC' + | 'SCOPE_DESC' + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'EXECUTIONS_TABLE_ID_ASC' + | 'EXECUTIONS_TABLE_ID_DESC' + | 'OUTPUTS_TABLE_ID_ASC' + | 'OUTPUTS_TABLE_ID_DESC' + | 'NODE_STATES_TABLE_ID_ASC' + | 'NODE_STATES_TABLE_ID_DESC' + | 'EXECUTIONS_TABLE_NAME_ASC' + | 'EXECUTIONS_TABLE_NAME_DESC' + | 'OUTPUTS_TABLE_NAME_ASC' + | 'OUTPUTS_TABLE_NAME_DESC' + | 'NODE_STATES_TABLE_NAME_ASC' + | 'NODE_STATES_TABLE_NAME_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC' + | 'PRIVATE_API_NAME_ASC' + | 'PRIVATE_API_NAME_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'DEFAULT_PERMISSIONS_ASC' + | 'DEFAULT_PERMISSIONS_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; export type HierarchyModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -8503,8 +8811,6 @@ export interface CreateGraphModuleInput { prefix?: string; merkleStoreModuleId: string; graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; apiName?: string; privateApiName?: string; entityTableId?: string; @@ -8523,8 +8829,6 @@ export interface GraphModulePatch { prefix?: string | null; merkleStoreModuleId?: string | null; graphsTableId?: string | null; - executionsTableId?: string | null; - outputsTableId?: string | null; apiName?: string | null; privateApiName?: string | null; entityTableId?: string | null; @@ -8913,56 +9217,6 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } -export interface CreateNamespaceModuleInput { - clientMutationId?: string; - namespaceModule: { - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - defaultPermissions?: string[]; - }; -} -export interface NamespaceModulePatch { - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - namespacesTableId?: string | null; - namespaceEventsTableId?: string | null; - namespacesTableName?: string | null; - namespaceEventsTableName?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; -} -export interface UpdateNamespaceModuleInput { - clientMutationId?: string; - id: string; - namespaceModulePatch: NamespaceModulePatch; -} -export interface DeleteNamespaceModuleInput { - clientMutationId?: string; - id: string; -} export interface CreateComputeLogModuleInput { clientMutationId?: string; computeLogModule: { @@ -9067,6 +9321,58 @@ export interface DeleteInferenceLogModuleInput { clientMutationId?: string; id: string; } +export interface CreateNamespaceModuleInput { + clientMutationId?: string; + namespaceModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface NamespaceModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + namespacesTableId?: string | null; + namespaceEventsTableId?: string | null; + namespacesTableName?: string | null; + namespaceEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + platformNamespacesTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} +export interface UpdateNamespaceModuleInput { + clientMutationId?: string; + id: string; + namespaceModulePatch: NamespaceModulePatch; +} +export interface DeleteNamespaceModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateStorageLogModuleInput { clientMutationId?: string; storageLogModule: { @@ -9171,6 +9477,60 @@ export interface DeleteTransferLogModuleInput { clientMutationId?: string; id: string; } +export interface CreateFunctionDeploymentModuleInput { + clientMutationId?: string; + functionDeploymentModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface FunctionDeploymentModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + deploymentsTableId?: string | null; + deploymentEventsTableId?: string | null; + deploymentsTableName?: string | null; + deploymentEventsTableName?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + prefix?: string | null; + entityTableId?: string | null; + functionModuleId?: string | null; + namespaceModuleId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; +} +export interface UpdateFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; + functionDeploymentModulePatch: FunctionDeploymentModulePatch; +} +export interface DeleteFunctionDeploymentModuleInput { + clientMutationId?: string; + id: string; +} export interface CreatePlansModuleInput { clientMutationId?: string; plansModule: { @@ -9330,16 +9690,72 @@ export interface DbUsageModulePatch { premake?: number | null; scope?: string | null; prefix?: string | null; - defaultPermissions?: string[] | null; + defaultPermissions?: string[] | null; + apiName?: string | null; + privateApiName?: string | null; +} +export interface UpdateDbUsageModuleInput { + clientMutationId?: string; + id: string; + dbUsageModulePatch: DbUsageModulePatch; +} +export interface DeleteDbUsageModuleInput { + clientMutationId?: string; + id: string; +} +export interface CreateGraphExecutionModuleInput { + clientMutationId?: string; + graphExecutionModule: { + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + }; +} +export interface GraphExecutionModulePatch { + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + graphModuleId?: string | null; + scope?: string | null; + prefix?: string | null; + executionsTableId?: string | null; + outputsTableId?: string | null; + nodeStatesTableId?: string | null; + executionsTableName?: string | null; + outputsTableName?: string | null; + nodeStatesTableName?: string | null; apiName?: string | null; privateApiName?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + defaultPermissions?: string[] | null; } -export interface UpdateDbUsageModuleInput { +export interface UpdateGraphExecutionModuleInput { clientMutationId?: string; id: string; - dbUsageModulePatch: DbUsageModulePatch; + graphExecutionModulePatch: GraphExecutionModulePatch; } -export interface DeleteDbUsageModuleInput { +export interface DeleteGraphExecutionModuleInput { clientMutationId?: string; id: string; } @@ -10963,8 +11379,6 @@ export interface GraphModuleInput { prefix?: string; merkleStoreModuleId: string; graphsTableId?: string; - executionsTableId?: string; - outputsTableId?: string; apiName?: string; privateApiName?: string; entityTableId?: string; @@ -11138,27 +11552,6 @@ export interface InvitesModuleInput { apiName?: string; privateApiName?: string; } -/** An input for mutations affecting `NamespaceModule` */ -export interface NamespaceModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - namespacesTableId?: string; - namespaceEventsTableId?: string; - namespacesTableName?: string; - namespaceEventsTableName?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - defaultPermissions?: string[]; -} /** An input for mutations affecting `ComputeLogModule` */ export interface ComputeLogModuleInput { id?: string; @@ -11203,6 +11596,28 @@ export interface InferenceLogModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `NamespaceModule` */ +export interface NamespaceModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + namespacesTableId?: string; + namespaceEventsTableId?: string; + namespacesTableName?: string; + namespaceEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + platformNamespacesTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; +} /** An input for mutations affecting `StorageLogModule` */ export interface StorageLogModuleInput { id?: string; @@ -11247,6 +11662,29 @@ export interface TransferLogModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `FunctionDeploymentModule` */ +export interface FunctionDeploymentModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + deploymentsTableId?: string; + deploymentEventsTableId?: string; + deploymentsTableName?: string; + deploymentEventsTableName?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + prefix?: string; + entityTableId?: string; + functionModuleId?: string; + namespaceModuleId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; +} /** An input for mutations affecting `PlansModule` */ export interface PlansModuleInput { id?: string; @@ -11321,6 +11759,31 @@ export interface DbUsageModuleInput { apiName?: string; privateApiName?: string; } +/** An input for mutations affecting `GraphExecutionModule` */ +export interface GraphExecutionModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + graphModuleId: string; + scope?: string; + prefix?: string; + executionsTableId?: string; + outputsTableId?: string; + nodeStatesTableId?: string; + executionsTableName?: string; + outputsTableName?: string; + nodeStatesTableName?: string; + apiName?: string; + privateApiName?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + defaultPermissions?: string[]; + createdAt?: string; +} /** An input for mutations affecting `HierarchyModule` */ export interface HierarchyModuleInput { id?: string; @@ -12226,10 +12689,6 @@ export interface GraphModuleFilter { merkleStoreModuleId?: UUIDFilter; /** Filter by the object’s `graphsTableId` field. */ graphsTableId?: UUIDFilter; - /** Filter by the object’s `executionsTableId` field. */ - executionsTableId?: UUIDFilter; - /** Filter by the object’s `outputsTableId` field. */ - outputsTableId?: UUIDFilter; /** Filter by the object’s `apiName` field. */ apiName?: StringFilter; /** Filter by the object’s `privateApiName` field. */ @@ -14239,51 +14698,6 @@ export type DeleteInvitesModulePayloadSelect = { select: InvitesModuleEdgeSelect; }; }; -export interface CreateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was created by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type CreateNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; -export interface UpdateNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was updated by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type UpdateNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; -export interface DeleteNamespaceModulePayload { - clientMutationId?: string | null; - /** The `NamespaceModule` that was deleted by this mutation. */ - namespaceModule?: NamespaceModule | null; - namespaceModuleEdge?: NamespaceModuleEdge | null; -} -export type DeleteNamespaceModulePayloadSelect = { - clientMutationId?: boolean; - namespaceModule?: { - select: NamespaceModuleSelect; - }; - namespaceModuleEdge?: { - select: NamespaceModuleEdgeSelect; - }; -}; export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ @@ -14374,6 +14788,51 @@ export type DeleteInferenceLogModulePayloadSelect = { select: InferenceLogModuleEdgeSelect; }; }; +export interface CreateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was created by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type CreateNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; +export interface UpdateNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was updated by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type UpdateNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; +export interface DeleteNamespaceModulePayload { + clientMutationId?: string | null; + /** The `NamespaceModule` that was deleted by this mutation. */ + namespaceModule?: NamespaceModule | null; + namespaceModuleEdge?: NamespaceModuleEdge | null; +} +export type DeleteNamespaceModulePayloadSelect = { + clientMutationId?: boolean; + namespaceModule?: { + select: NamespaceModuleSelect; + }; + namespaceModuleEdge?: { + select: NamespaceModuleEdgeSelect; + }; +}; export interface CreateStorageLogModulePayload { clientMutationId?: string | null; /** The `StorageLogModule` that was created by this mutation. */ @@ -14464,6 +14923,51 @@ export type DeleteTransferLogModulePayloadSelect = { select: TransferLogModuleEdgeSelect; }; }; +export interface CreateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was created by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type CreateFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; +export interface UpdateFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was updated by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type UpdateFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; +export interface DeleteFunctionDeploymentModulePayload { + clientMutationId?: string | null; + /** The `FunctionDeploymentModule` that was deleted by this mutation. */ + functionDeploymentModule?: FunctionDeploymentModule | null; + functionDeploymentModuleEdge?: FunctionDeploymentModuleEdge | null; +} +export type DeleteFunctionDeploymentModulePayloadSelect = { + clientMutationId?: boolean; + functionDeploymentModule?: { + select: FunctionDeploymentModuleSelect; + }; + functionDeploymentModuleEdge?: { + select: FunctionDeploymentModuleEdgeSelect; + }; +}; export interface CreatePlansModulePayload { clientMutationId?: string | null; /** The `PlansModule` that was created by this mutation. */ @@ -14599,6 +15103,51 @@ export type DeleteDbUsageModulePayloadSelect = { select: DbUsageModuleEdgeSelect; }; }; +export interface CreateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was created by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type CreateGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; +export interface UpdateGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was updated by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type UpdateGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; +export interface DeleteGraphExecutionModulePayload { + clientMutationId?: string | null; + /** The `GraphExecutionModule` that was deleted by this mutation. */ + graphExecutionModule?: GraphExecutionModule | null; + graphExecutionModuleEdge?: GraphExecutionModuleEdge | null; +} +export type DeleteGraphExecutionModulePayloadSelect = { + clientMutationId?: boolean; + graphExecutionModule?: { + select: GraphExecutionModuleSelect; + }; + graphExecutionModuleEdge?: { + select: GraphExecutionModuleEdgeSelect; + }; +}; export interface CreateHierarchyModulePayload { clientMutationId?: string | null; /** The `HierarchyModule` that was created by this mutation. */ @@ -15636,18 +16185,6 @@ export type InvitesModuleEdgeSelect = { select: InvitesModuleSelect; }; }; -/** A `NamespaceModule` edge in the connection. */ -export interface NamespaceModuleEdge { - cursor?: string | null; - /** The `NamespaceModule` at the end of the edge. */ - node?: NamespaceModule | null; -} -export type NamespaceModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: NamespaceModuleSelect; - }; -}; /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; @@ -15672,6 +16209,18 @@ export type InferenceLogModuleEdgeSelect = { select: InferenceLogModuleSelect; }; }; +/** A `NamespaceModule` edge in the connection. */ +export interface NamespaceModuleEdge { + cursor?: string | null; + /** The `NamespaceModule` at the end of the edge. */ + node?: NamespaceModule | null; +} +export type NamespaceModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: NamespaceModuleSelect; + }; +}; /** A `StorageLogModule` edge in the connection. */ export interface StorageLogModuleEdge { cursor?: string | null; @@ -15696,6 +16245,18 @@ export type TransferLogModuleEdgeSelect = { select: TransferLogModuleSelect; }; }; +/** A `FunctionDeploymentModule` edge in the connection. */ +export interface FunctionDeploymentModuleEdge { + cursor?: string | null; + /** The `FunctionDeploymentModule` at the end of the edge. */ + node?: FunctionDeploymentModule | null; +} +export type FunctionDeploymentModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: FunctionDeploymentModuleSelect; + }; +}; /** A `PlansModule` edge in the connection. */ export interface PlansModuleEdge { cursor?: string | null; @@ -15732,6 +16293,18 @@ export type DbUsageModuleEdgeSelect = { select: DbUsageModuleSelect; }; }; +/** A `GraphExecutionModule` edge in the connection. */ +export interface GraphExecutionModuleEdge { + cursor?: string | null; + /** The `GraphExecutionModule` at the end of the edge. */ + node?: GraphExecutionModule | null; +} +export type GraphExecutionModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: GraphExecutionModuleSelect; + }; +}; /** A `HierarchyModule` edge in the connection. */ export interface HierarchyModuleEdge { cursor?: string | null; diff --git a/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts b/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts index ad2ea4a388..ec52583704 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/agentModule.ts @@ -196,7 +196,8 @@ export class AgentModuleModel { 'UpdateAgentModuleInput', 'id', 'agentModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts b/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts index 712d75ae7b..432eb970f3 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/billingModule.ts @@ -196,7 +196,8 @@ export class BillingModuleModel { 'UpdateBillingModuleInput', 'id', 'billingModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts b/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts index a7e3345201..16a8a68460 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/billingProviderModule.ts @@ -198,7 +198,8 @@ export class BillingProviderModuleModel { 'UpdateBillingProviderModuleInput', 'id', 'billingProviderModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts b/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts index 239c50eb99..48e4dc3d89 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/blueprint.ts @@ -196,7 +196,8 @@ export class BlueprintModel { 'UpdateBlueprintInput', 'id', 'blueprintPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts b/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts index dad6db0bff..ee6a157760 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/blueprintConstruction.ts @@ -198,7 +198,8 @@ export class BlueprintConstructionModel { 'UpdateBlueprintConstructionInput', 'id', 'blueprintConstructionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts b/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts index 1f957cdeda..486ef1c8e2 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/blueprintTemplate.ts @@ -196,7 +196,8 @@ export class BlueprintTemplateModel { 'UpdateBlueprintTemplateInput', 'id', 'blueprintTemplatePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts index 2e36321ef1..3451b45608 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/computeLogModule.ts @@ -196,7 +196,8 @@ export class ComputeLogModuleModel { 'UpdateComputeLogModuleInput', 'id', 'computeLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/configSecretsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/configSecretsModule.ts index 5d482c9ccf..59a6edd5cd 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/configSecretsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/configSecretsModule.ts @@ -196,7 +196,8 @@ export class ConfigSecretsModuleModel { 'UpdateConfigSecretsModuleInput', 'id', 'configSecretsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/configSecretsOrgModule.ts b/sdk/constructive-sdk/src/modules/orm/models/configSecretsOrgModule.ts index ef53f2d5cd..08969c552d 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/configSecretsOrgModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/configSecretsOrgModule.ts @@ -198,7 +198,8 @@ export class ConfigSecretsOrgModuleModel { 'UpdateConfigSecretsOrgModuleInput', 'id', 'configSecretsOrgModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts b/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts index b1b8f0cacb..bd97e5bf01 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/configSecretsUserModule.ts @@ -198,7 +198,8 @@ export class ConfigSecretsUserModuleModel { 'UpdateConfigSecretsUserModuleInput', 'id', 'configSecretsUserModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts index 226307b4b8..64b1dc5c4c 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/connectedAccountsModule.ts @@ -198,7 +198,8 @@ export class ConnectedAccountsModuleModel { 'UpdateConnectedAccountsModuleInput', 'id', 'connectedAccountsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts index 6618ae4e90..c7797726bf 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/cryptoAddressesModule.ts @@ -198,7 +198,8 @@ export class CryptoAddressesModuleModel { 'UpdateCryptoAddressesModuleInput', 'id', 'cryptoAddressesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts index c90349b9d4..d975e75267 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/cryptoAuthModule.ts @@ -196,7 +196,8 @@ export class CryptoAuthModuleModel { 'UpdateCryptoAuthModuleInput', 'id', 'cryptoAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts b/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts index 4cf322de69..1d9457eed6 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/databaseProvisionModule.ts @@ -198,7 +198,8 @@ export class DatabaseProvisionModuleModel { 'UpdateDatabaseProvisionModuleInput', 'id', 'databaseProvisionModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts b/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts index 69aa58b980..45fc6b2a64 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/dbUsageModule.ts @@ -196,7 +196,8 @@ export class DbUsageModuleModel { 'UpdateDbUsageModuleInput', 'id', 'dbUsageModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts index 9553db8ed7..957d0061e4 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/defaultIdsModule.ts @@ -196,7 +196,8 @@ export class DefaultIdsModuleModel { 'UpdateDefaultIdsModuleInput', 'id', 'defaultIdsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts b/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts index 881f2ffdb7..bdc83099a2 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/denormalizedTableField.ts @@ -198,7 +198,8 @@ export class DenormalizedTableFieldModel { 'UpdateDenormalizedTableFieldInput', 'id', 'denormalizedTableFieldPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts index 8c9a7e06ee..8dc6cf5282 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/devicesModule.ts @@ -196,7 +196,8 @@ export class DevicesModuleModel { 'UpdateDevicesModuleInput', 'id', 'devicesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts index e95985b852..f3a2297a8a 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/emailsModule.ts @@ -196,7 +196,8 @@ export class EmailsModuleModel { 'UpdateEmailsModuleInput', 'id', 'emailsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts b/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts index 93373a3dd4..c8e87d8f9c 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/entityTypeProvision.ts @@ -196,7 +196,8 @@ export class EntityTypeProvisionModel { 'UpdateEntityTypeProvisionInput', 'id', 'entityTypeProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts index fb45e27ce3..0f07d39979 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/eventsModule.ts @@ -196,7 +196,8 @@ export class EventsModuleModel { 'UpdateEventsModuleInput', 'id', 'eventsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/functionDeploymentModule.ts b/sdk/constructive-sdk/src/modules/orm/models/functionDeploymentModule.ts new file mode 100644 index 0000000000..afe50267f8 --- /dev/null +++ b/sdk/constructive-sdk/src/modules/orm/models/functionDeploymentModule.ts @@ -0,0 +1,247 @@ +/** + * FunctionDeploymentModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + FunctionDeploymentModule, + FunctionDeploymentModuleWithRelations, + FunctionDeploymentModuleSelect, + FunctionDeploymentModuleFilter, + FunctionDeploymentModuleOrderBy, + CreateFunctionDeploymentModuleInput, + UpdateFunctionDeploymentModuleInput, + FunctionDeploymentModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class FunctionDeploymentModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModules: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', + document, + variables, + transform: (data: { + functionDeploymentModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + functionDeploymentModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'FunctionDeploymentModule', + 'functionDeploymentModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'FunctionDeploymentModuleFilter', + 'FunctionDeploymentModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'FunctionDeploymentModule', + fieldName: 'functionDeploymentModule', + document, + variables, + transform: (data: { + functionDeploymentModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + functionDeploymentModule: data.functionDeploymentModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'FunctionDeploymentModule', + 'createFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.data, + 'CreateFunctionDeploymentModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'createFunctionDeploymentModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + FunctionDeploymentModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'FunctionDeploymentModule', + 'updateFunctionDeploymentModule', + 'functionDeploymentModule', + args.select, + args.where.id, + args.data, + 'UpdateFunctionDeploymentModuleInput', + 'id', + 'functionDeploymentModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'updateFunctionDeploymentModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteFunctionDeploymentModule: { + functionDeploymentModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'FunctionDeploymentModule', + 'deleteFunctionDeploymentModule', + 'functionDeploymentModule', + { + id: args.where.id, + }, + 'DeleteFunctionDeploymentModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'FunctionDeploymentModule', + fieldName: 'deleteFunctionDeploymentModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts b/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts index f8b9e92fc1..ba40e892ea 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/functionInvocationModule.ts @@ -198,7 +198,8 @@ export class FunctionInvocationModuleModel { 'UpdateFunctionInvocationModuleInput', 'id', 'functionInvocationModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts b/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts index 5c0e724d4c..7e127377dd 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/functionModule.ts @@ -196,7 +196,8 @@ export class FunctionModuleModel { 'UpdateFunctionModuleInput', 'id', 'functionModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/graphExecutionModule.ts b/sdk/constructive-sdk/src/modules/orm/models/graphExecutionModule.ts new file mode 100644 index 0000000000..9f1866c036 --- /dev/null +++ b/sdk/constructive-sdk/src/modules/orm/models/graphExecutionModule.ts @@ -0,0 +1,247 @@ +/** + * GraphExecutionModule model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { + QueryBuilder, + buildFindManyDocument, + buildFindFirstDocument, + buildFindOneDocument, + buildCreateDocument, + buildUpdateByPkDocument, + buildDeleteByPkDocument, +} from '../query-builder'; +import type { + ConnectionResult, + FindManyArgs, + FindFirstArgs, + CreateArgs, + UpdateArgs, + DeleteArgs, + InferSelectResult, + StrictSelect, +} from '../select-types'; +import type { + GraphExecutionModule, + GraphExecutionModuleWithRelations, + GraphExecutionModuleSelect, + GraphExecutionModuleFilter, + GraphExecutionModuleOrderBy, + CreateGraphExecutionModuleInput, + UpdateGraphExecutionModuleInput, + GraphExecutionModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class GraphExecutionModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModules: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', + document, + variables, + transform: (data: { + graphExecutionModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + graphExecutionModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'GraphExecutionModule', + 'graphExecutionModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'GraphExecutionModuleFilter', + 'GraphExecutionModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'GraphExecutionModule', + fieldName: 'graphExecutionModule', + document, + variables, + transform: (data: { + graphExecutionModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + graphExecutionModule: data.graphExecutionModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'GraphExecutionModule', + 'createGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.data, + 'CreateGraphExecutionModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'createGraphExecutionModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + GraphExecutionModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updateGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'GraphExecutionModule', + 'updateGraphExecutionModule', + 'graphExecutionModule', + args.select, + args.where.id, + args.data, + 'UpdateGraphExecutionModuleInput', + 'id', + 'graphExecutionModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'updateGraphExecutionModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deleteGraphExecutionModule: { + graphExecutionModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'GraphExecutionModule', + 'deleteGraphExecutionModule', + 'graphExecutionModule', + { + id: args.where.id, + }, + 'DeleteGraphExecutionModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'GraphExecutionModule', + fieldName: 'deleteGraphExecutionModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts b/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts index deaa311f4c..f337b77ed9 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/graphModule.ts @@ -196,7 +196,8 @@ export class GraphModuleModel { 'UpdateGraphModuleInput', 'id', 'graphModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts b/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts index e1eca248c8..16e9170d2b 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/hierarchyModule.ts @@ -196,7 +196,8 @@ export class HierarchyModuleModel { 'UpdateHierarchyModuleInput', 'id', 'hierarchyModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts b/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts index a1162a5f5f..014ecefd15 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/i18NModule.ts @@ -196,7 +196,8 @@ export class I18NModuleModel { 'UpdateI18NModuleInput', 'id', 'i18NModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts index 86a507559d..bc564b56d1 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/identityProvidersModule.ts @@ -198,7 +198,8 @@ export class IdentityProvidersModuleModel { 'UpdateIdentityProvidersModuleInput', 'id', 'identityProvidersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/index.ts b/sdk/constructive-sdk/src/modules/orm/models/index.ts index f478d2642f..2ff305f2fc 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/index.ts @@ -39,14 +39,16 @@ export { WebauthnAuthModuleModel } from './webauthnAuthModule'; export { FunctionInvocationModuleModel } from './functionInvocationModule'; export { FunctionModuleModel } from './functionModule'; export { InvitesModuleModel } from './invitesModule'; -export { NamespaceModuleModel } from './namespaceModule'; export { ComputeLogModuleModel } from './computeLogModule'; export { InferenceLogModuleModel } from './inferenceLogModule'; +export { NamespaceModuleModel } from './namespaceModule'; export { StorageLogModuleModel } from './storageLogModule'; export { TransferLogModuleModel } from './transferLogModule'; +export { FunctionDeploymentModuleModel } from './functionDeploymentModule'; export { PlansModuleModel } from './plansModule'; export { BillingProviderModuleModel } from './billingProviderModule'; export { DbUsageModuleModel } from './dbUsageModule'; +export { GraphExecutionModuleModel } from './graphExecutionModule'; export { HierarchyModuleModel } from './hierarchyModule'; export { PermissionsModuleModel } from './permissionsModule'; export { NotificationsModuleModel } from './notificationsModule'; diff --git a/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts index f6f4ab2452..f4c0f77d3b 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/inferenceLogModule.ts @@ -196,7 +196,8 @@ export class InferenceLogModuleModel { 'UpdateInferenceLogModuleInput', 'id', 'inferenceLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts index b31e122a08..b244078720 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/invitesModule.ts @@ -196,7 +196,8 @@ export class InvitesModuleModel { 'UpdateInvitesModuleInput', 'id', 'invitesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts index 60dec78148..50d0d76ba5 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/limitsModule.ts @@ -196,7 +196,8 @@ export class LimitsModuleModel { 'UpdateLimitsModuleInput', 'id', 'limitsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts index cf72c91fa9..9eeb67961f 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/membershipTypesModule.ts @@ -198,7 +198,8 @@ export class MembershipTypesModuleModel { 'UpdateMembershipTypesModuleInput', 'id', 'membershipTypesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts index 5709ac9049..66b41bce21 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/membershipsModule.ts @@ -196,7 +196,8 @@ export class MembershipsModuleModel { 'UpdateMembershipsModuleInput', 'id', 'membershipsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts b/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts index 9cf13ba7ca..d3bb9d0c67 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/merkleStoreModule.ts @@ -196,7 +196,8 @@ export class MerkleStoreModuleModel { 'UpdateMerkleStoreModuleInput', 'id', 'merkleStoreModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts b/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts index 9d37ad714a..bd5c681504 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/namespaceModule.ts @@ -196,7 +196,8 @@ export class NamespaceModuleModel { 'UpdateNamespaceModuleInput', 'id', 'namespaceModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts index dc44d0d696..a629d81108 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/notificationsModule.ts @@ -196,7 +196,8 @@ export class NotificationsModuleModel { 'UpdateNotificationsModuleInput', 'id', 'notificationsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts index 5fb22b44da..2a330457b5 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/permissionsModule.ts @@ -196,7 +196,8 @@ export class PermissionsModuleModel { 'UpdatePermissionsModuleInput', 'id', 'permissionsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts index 55f64339ee..42cbdfc98f 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/phoneNumbersModule.ts @@ -196,7 +196,8 @@ export class PhoneNumbersModuleModel { 'UpdatePhoneNumbersModuleInput', 'id', 'phoneNumbersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts b/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts index f13f1849b8..545fbdd7cb 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/plansModule.ts @@ -196,7 +196,8 @@ export class PlansModuleModel { 'UpdatePlansModuleInput', 'id', 'plansModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts b/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts index f1c152e779..15d5a94e79 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/profilesModule.ts @@ -196,7 +196,8 @@ export class ProfilesModuleModel { 'UpdateProfilesModuleInput', 'id', 'profilesModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts index 888855807c..1205e581d8 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/rateLimitMetersModule.ts @@ -198,7 +198,8 @@ export class RateLimitMetersModuleModel { 'UpdateRateLimitMetersModuleInput', 'id', 'rateLimitMetersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts index 9567ccaa2d..dbf9501696 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/rateLimitsModule.ts @@ -196,7 +196,8 @@ export class RateLimitsModuleModel { 'UpdateRateLimitsModuleInput', 'id', 'rateLimitsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts b/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts index d3035f9d59..2cb1075457 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/realtimeModule.ts @@ -196,7 +196,8 @@ export class RealtimeModuleModel { 'UpdateRealtimeModuleInput', 'id', 'realtimeModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts b/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts index eea0a01010..c8bc481ca9 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/relationProvision.ts @@ -196,7 +196,8 @@ export class RelationProvisionModel { 'UpdateRelationProvisionInput', 'id', 'relationProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts index 5e1ed1afc3..6a1c7cae75 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/rlsModule.ts @@ -196,7 +196,8 @@ export class RlsModuleModel { 'UpdateRlsModuleInput', 'id', 'rlsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts b/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts index ca0ef2a686..88e10489d0 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/secureTableProvision.ts @@ -198,7 +198,8 @@ export class SecureTableProvisionModel { 'UpdateSecureTableProvisionInput', 'id', 'secureTableProvisionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts index 474a953202..9460af6349 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/sessionSecretsModule.ts @@ -198,7 +198,8 @@ export class SessionSecretsModuleModel { 'UpdateSessionSecretsModuleInput', 'id', 'sessionSecretsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts index b66cc7be34..324773df9f 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/sessionsModule.ts @@ -196,7 +196,8 @@ export class SessionsModuleModel { 'UpdateSessionsModuleInput', 'id', 'sessionsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts index 60e0b45cac..a53edf15d1 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/storageLogModule.ts @@ -196,7 +196,8 @@ export class StorageLogModuleModel { 'UpdateStorageLogModuleInput', 'id', 'storageLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts b/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts index e359f6471c..f69dd6e624 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/storageModule.ts @@ -196,7 +196,8 @@ export class StorageModuleModel { 'UpdateStorageModuleInput', 'id', 'storageModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts b/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts index dd1b30c286..cab2bec096 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/transferLogModule.ts @@ -196,7 +196,8 @@ export class TransferLogModuleModel { 'UpdateTransferLogModuleInput', 'id', 'transferLogModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts index 15fe6a854a..341885e14c 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userAuthModule.ts @@ -196,7 +196,8 @@ export class UserAuthModuleModel { 'UpdateUserAuthModuleInput', 'id', 'userAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts index 90ada31d7a..9e9bc0b2aa 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userCredentialsModule.ts @@ -198,7 +198,8 @@ export class UserCredentialsModuleModel { 'UpdateUserCredentialsModuleInput', 'id', 'userCredentialsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts index 5a905d30b4..252d0cc8bf 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userSettingsModule.ts @@ -196,7 +196,8 @@ export class UserSettingsModuleModel { 'UpdateUserSettingsModuleInput', 'id', 'userSettingsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts b/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts index 6070cfbd00..86999c74ae 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/userStateModule.ts @@ -196,7 +196,8 @@ export class UserStateModuleModel { 'UpdateUserStateModuleInput', 'id', 'userStateModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts b/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts index de86bbbfb8..950038fcf0 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/usersModule.ts @@ -196,7 +196,8 @@ export class UsersModuleModel { 'UpdateUsersModuleInput', 'id', 'usersModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts index 14ebdd6f29..e8cdb4eb61 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/webauthnAuthModule.ts @@ -196,7 +196,8 @@ export class WebauthnAuthModuleModel { 'UpdateWebauthnAuthModuleInput', 'id', 'webauthnAuthModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts b/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts index ee66831a79..fd73e47620 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/webauthnCredentialsModule.ts @@ -198,7 +198,8 @@ export class WebauthnCredentialsModuleModel { 'UpdateWebauthnCredentialsModuleInput', 'id', 'webauthnCredentialsModulePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/modules/orm/query-builder.ts b/sdk/constructive-sdk/src/modules/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/modules/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/modules/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-sdk/src/objects/orm/models/commit.ts b/sdk/constructive-sdk/src/objects/orm/models/commit.ts index 70f5c59605..9f20aeeefc 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/commit.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/commit.ts @@ -176,6 +176,7 @@ export class CommitModel { S, { id: string; + databaseId: string; }, CommitPatch > & { @@ -196,7 +197,10 @@ export class CommitModel { 'UpdateCommitInput', 'id', 'commitPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class CommitModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -227,6 +232,7 @@ export class CommitModel { 'commit', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteCommitInput', args.select, diff --git a/sdk/constructive-sdk/src/objects/orm/models/object.ts b/sdk/constructive-sdk/src/objects/orm/models/object.ts index 8a685b1df7..9470d460f6 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/object.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/object.ts @@ -162,6 +162,7 @@ export class ObjectModel { S, { id: string; + databaseId: string; }, ObjectPatch > & { @@ -182,7 +183,10 @@ export class ObjectModel { 'UpdateObjectInput', 'id', 'objectPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -197,6 +201,7 @@ export class ObjectModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -213,6 +218,7 @@ export class ObjectModel { 'object', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteObjectInput', args.select, diff --git a/sdk/constructive-sdk/src/objects/orm/models/ref.ts b/sdk/constructive-sdk/src/objects/orm/models/ref.ts index 5c3419d89d..d29b2308a0 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/ref.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/ref.ts @@ -176,6 +176,7 @@ export class RefModel { S, { id: string; + databaseId: string; }, RefPatch > & { @@ -196,7 +197,10 @@ export class RefModel { 'UpdateRefInput', 'id', 'refPatch', - connectionFieldsMap + connectionFieldsMap, + { + databaseId: args.where.databaseId, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class RefModel { args: DeleteArgs< { id: string; + databaseId: string; }, S > & { @@ -227,6 +232,7 @@ export class RefModel { 'ref', { id: args.where.id, + databaseId: args.where.databaseId, }, 'DeleteRefInput', args.select, diff --git a/sdk/constructive-sdk/src/objects/orm/models/store.ts b/sdk/constructive-sdk/src/objects/orm/models/store.ts index f80e638901..3e81e5f9ca 100644 --- a/sdk/constructive-sdk/src/objects/orm/models/store.ts +++ b/sdk/constructive-sdk/src/objects/orm/models/store.ts @@ -196,7 +196,8 @@ export class StoreModel { 'UpdateStoreInput', 'id', 'storePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/objects/orm/query-builder.ts b/sdk/constructive-sdk/src/objects/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/objects/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/objects/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts index 2e109cb07e..e1903aae36 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimit.ts @@ -196,7 +196,8 @@ export class AppLimitModel { 'UpdateAppLimitInput', 'id', 'appLimitPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts index 3359af7c92..9f93b87628 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCap.ts @@ -196,7 +196,8 @@ export class AppLimitCapModel { 'UpdateAppLimitCapInput', 'id', 'appLimitCapPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts index 0eac9c6f8b..3b0ac8a23b 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCapsDefault.ts @@ -196,7 +196,8 @@ export class AppLimitCapsDefaultModel { 'UpdateAppLimitCapsDefaultInput', 'id', 'appLimitCapsDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts index 87ef262696..7f66c4eb09 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCredit.ts @@ -196,7 +196,8 @@ export class AppLimitCreditModel { 'UpdateAppLimitCreditInput', 'id', 'appLimitCreditPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts index 1d21f2d211..a449fef840 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCode.ts @@ -196,7 +196,8 @@ export class AppLimitCreditCodeModel { 'UpdateAppLimitCreditCodeInput', 'id', 'appLimitCreditCodePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts index ade7d6cdc0..5f37d3fbe0 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditCodeItem.ts @@ -198,7 +198,8 @@ export class AppLimitCreditCodeItemModel { 'UpdateAppLimitCreditCodeItemInput', 'id', 'appLimitCreditCodeItemPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts index f60a8e62f9..582960bd9f 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitCreditRedemption.ts @@ -198,7 +198,8 @@ export class AppLimitCreditRedemptionModel { 'UpdateAppLimitCreditRedemptionInput', 'id', 'appLimitCreditRedemptionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts index f9df6376e5..f0eb49d31f 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitDefault.ts @@ -196,7 +196,8 @@ export class AppLimitDefaultModel { 'UpdateAppLimitDefaultInput', 'id', 'appLimitDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts index ef7249f3e9..17fd7e8866 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitEvent.ts @@ -176,6 +176,7 @@ export class AppLimitEventModel { S, { id: string; + createdAt: string; }, AppLimitEventPatch > & { @@ -196,7 +197,10 @@ export class AppLimitEventModel { 'UpdateAppLimitEventInput', 'id', 'appLimitEventPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class AppLimitEventModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class AppLimitEventModel { 'appLimitEvent', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteAppLimitEventInput', args.select, diff --git a/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts b/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts index 8366dd8336..4d31d5490a 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/appLimitWarning.ts @@ -196,7 +196,8 @@ export class AppLimitWarningModel { 'UpdateAppLimitWarningInput', 'id', 'appLimitWarningPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts index 48a3932f23..188531420f 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimit.ts @@ -196,7 +196,8 @@ export class OrgLimitModel { 'UpdateOrgLimitInput', 'id', 'orgLimitPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts index d74b9e7d92..43f24e6d05 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitAggregate.ts @@ -196,7 +196,8 @@ export class OrgLimitAggregateModel { 'UpdateOrgLimitAggregateInput', 'id', 'orgLimitAggregatePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts index 6755eea460..0877ea93fd 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCap.ts @@ -196,7 +196,8 @@ export class OrgLimitCapModel { 'UpdateOrgLimitCapInput', 'id', 'orgLimitCapPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts index 7884189152..de62c801b7 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCapsDefault.ts @@ -196,7 +196,8 @@ export class OrgLimitCapsDefaultModel { 'UpdateOrgLimitCapsDefaultInput', 'id', 'orgLimitCapsDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts index 560f611013..497dd5d807 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitCredit.ts @@ -196,7 +196,8 @@ export class OrgLimitCreditModel { 'UpdateOrgLimitCreditInput', 'id', 'orgLimitCreditPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts index 7e55bfd1f7..3c91177b9c 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitDefault.ts @@ -196,7 +196,8 @@ export class OrgLimitDefaultModel { 'UpdateOrgLimitDefaultInput', 'id', 'orgLimitDefaultPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts index 2eb9796e2a..419737757d 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitEvent.ts @@ -176,6 +176,7 @@ export class OrgLimitEventModel { S, { id: string; + createdAt: string; }, OrgLimitEventPatch > & { @@ -196,7 +197,10 @@ export class OrgLimitEventModel { 'UpdateOrgLimitEventInput', 'id', 'orgLimitEventPatch', - connectionFieldsMap + connectionFieldsMap, + { + createdAt: args.where.createdAt, + } ); return new QueryBuilder({ client: this.client, @@ -211,6 +215,7 @@ export class OrgLimitEventModel { args: DeleteArgs< { id: string; + createdAt: string; }, S > & { @@ -227,6 +232,7 @@ export class OrgLimitEventModel { 'orgLimitEvent', { id: args.where.id, + createdAt: args.where.createdAt, }, 'DeleteOrgLimitEventInput', args.select, diff --git a/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts b/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts index e496b69fef..67d887241a 100644 --- a/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts +++ b/sdk/constructive-sdk/src/usage/orm/models/orgLimitWarning.ts @@ -196,7 +196,8 @@ export class OrgLimitWarningModel { 'UpdateOrgLimitWarningInput', 'id', 'orgLimitWarningPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/constructive-sdk/src/usage/orm/query-builder.ts b/sdk/constructive-sdk/src/usage/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/constructive-sdk/src/usage/orm/query-builder.ts +++ b/sdk/constructive-sdk/src/usage/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, }, diff --git a/sdk/migrate-client/schemas/migrate.graphql b/sdk/migrate-client/schemas/migrate.graphql index 745ff03df3..b8ed08d620 100644 --- a/sdk/migrate-client/schemas/migrate.graphql +++ b/sdk/migrate-client/schemas/migrate.graphql @@ -698,6 +698,18 @@ type MetaTable { relations: MetaRelations! inflection: MetaInflection! query: MetaQuery! + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime } """Information about a table field/column""" @@ -709,6 +721,9 @@ type MetaField { isPrimaryKey: Boolean! isForeignKey: Boolean! description: String + + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum } """Information about a PostgreSQL type""" @@ -721,6 +736,15 @@ type MetaType { subtype: String } +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! + + """Allowed values for this enum""" + values: [String!]! +} + """Information about a database index""" type MetaIndex { name: String! @@ -830,6 +854,78 @@ type MetaQuery { delete: String } +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage files table""" + isFilesTable: Boolean! + + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! +} + +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! + + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! + + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! + + """Per-table search configuration""" + config: MetaSearchConfig +} + +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Column name (camelCase)""" + name: String! + + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! +} + +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """JSON-encoded per-adapter score weights""" + weights: String + + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """Field used for recency decay""" + boostRecencyField: String + + """Exponential decay factor per day""" + boostRecencyDecay: Float +} + +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Name of the translation table""" + translationTable: String! + + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! +} + +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! + + """PostgreSQL column type (text, citext)""" + type: String! +} + +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} + """ The root mutation type which contains root level fields which mutate data. """ diff --git a/sdk/migrate-client/src/migrate/orm/models/migrateFile.ts b/sdk/migrate-client/src/migrate/orm/models/migrateFile.ts index 18b8369ead..f16827a83b 100644 --- a/sdk/migrate-client/src/migrate/orm/models/migrateFile.ts +++ b/sdk/migrate-client/src/migrate/orm/models/migrateFile.ts @@ -196,7 +196,8 @@ export class MigrateFileModel { 'UpdateMigrateFileInput', 'id', 'migrateFilePatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts b/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts index 62857f6bed..f57e125239 100644 --- a/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts +++ b/sdk/migrate-client/src/migrate/orm/models/sqlAction.ts @@ -196,7 +196,8 @@ export class SqlActionModel { 'UpdateSqlActionInput', 'id', 'sqlActionPatch', - connectionFieldsMap + connectionFieldsMap, + undefined ); return new QueryBuilder({ client: this.client, diff --git a/sdk/migrate-client/src/migrate/orm/query-builder.ts b/sdk/migrate-client/src/migrate/orm/query-builder.ts index fcf3e63f28..fd785bbae6 100644 --- a/sdk/migrate-client/src/migrate/orm/query-builder.ts +++ b/sdk/migrate-client/src/migrate/orm/query-builder.ts @@ -473,7 +473,8 @@ export function buildUpdateByPkDocument( inputTypeName: string, idFieldName: string, patchFieldName: string, - connectionFieldsMap?: Record> + connectionFieldsMap?: Record>, + extraKeys?: Record ): { document: string; variables: Record } { const selections = select ? buildSelections(select as Record, connectionFieldsMap, operationName) @@ -494,6 +495,7 @@ export function buildUpdateByPkDocument( variables: { input: { [idFieldName]: id, + ...extraKeys, [patchFieldName]: data, }, },