From 8cabaebfc40f0dcf16b5b80168f7f52d53bd68ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 28 Jun 2026 20:32:55 +0000 Subject: [PATCH] chore: update schemas and regenerate all SDK clients Auto-generated by schema-propagation workflow. Source: constructive-db@c9be1b6fb9 --- .agents/skills/cli-auth/SKILL.md | 28 +- .../cli-auth/references/create-api-key.md | 4 +- .../cli-auth/references/create-org-api-key.md | 19 + .../references/create-org-principal.md | 19 + .../references/delete-org-principal.md | 19 + .../cli-auth/references/org-api-key-list.md | 68 + .../cli-auth/references/principal-entity.md | 68 + .../references/principal-scope-override.md | 68 + .../skills/cli-auth/references/principal.md | 68 + .../cli-auth/references/revoke-org-api-key.md | 19 + .agents/skills/cli-compute/SKILL.md | 4 +- .../references/function-graph-execution.md | 6 +- .../cli-compute/references/function-graph.md | 6 +- .../references/import-graph-json.md | 4 +- .agents/skills/cli-modules/SKILL.md | 9 +- .../references/merkle-store-module.md | 6 +- .../references/principal-auth-module.md | 68 + .agents/skills/hooks-auth/SKILL.md | 20 +- .../hooks-auth/references/create-api-key.md | 4 +- .../references/create-org-api-key.md | 20 + .../references/create-org-principal.md | 20 + .../references/delete-org-principal.md | 20 + .../hooks-auth/references/org-api-key-list.md | 34 + .../hooks-auth/references/principal-entity.md | 34 + .../references/principal-scope-override.md | 34 + .../skills/hooks-auth/references/principal.md | 34 + .../references/revoke-org-api-key.md | 20 + .agents/skills/hooks-compute/SKILL.md | 4 +- .../references/function-graph-execution.md | 8 +- .../references/function-graph.md | 8 +- .agents/skills/hooks-modules/SKILL.md | 9 +- .../references/merkle-store-module.md | 8 +- .../references/principal-auth-module.md | 34 + .agents/skills/orm-auth/SKILL.md | 18 +- .../orm-auth/references/create-api-key.md | 4 +- .../orm-auth/references/create-org-api-key.md | 19 + .../references/create-org-principal.md | 19 + .../references/delete-org-principal.md | 19 + .../orm-auth/references/org-api-key-list.md | 34 + .../orm-auth/references/principal-entity.md | 34 + .../references/principal-scope-override.md | 34 + .../skills/orm-auth/references/principal.md | 34 + .../orm-auth/references/revoke-org-api-key.md | 19 + .agents/skills/orm-compute/SKILL.md | 4 +- .../references/function-graph-execution.md | 4 +- .../orm-compute/references/function-graph.md | 4 +- .agents/skills/orm-modules/SKILL.md | 9 +- .../references/merkle-store-module.md | 4 +- .../references/principal-auth-module.md | 34 + sdk/constructive-cli/src/auth/README.md | 4 +- sdk/constructive-cli/src/auth/cli/README.md | 192 +- sdk/constructive-cli/src/auth/cli/commands.ts | 22 +- .../auth/cli/commands/create-org-api-key.ts | 51 + .../auth/cli/commands/create-org-principal.ts | 53 + .../auth/cli/commands/delete-org-principal.ts | 53 + .../src/auth/cli/commands/org-api-key-list.ts | 248 ++ .../src/auth/cli/commands/principal-entity.ts | 303 +++ .../cli/commands/principal-scope-override.ts | 203 ++ .../src/auth/cli/commands/principal.ts | 274 +++ .../auth/cli/commands/revoke-org-api-key.ts | 51 + sdk/constructive-cli/src/auth/orm/README.md | 225 +- sdk/constructive-cli/src/auth/orm/index.ts | 8 + .../src/auth/orm/input-types.ts | 1079 ++++++++- .../src/auth/orm/models/index.ts | 4 + .../src/auth/orm/models/orgApiKeyList.ts | 174 ++ .../src/auth/orm/models/principal.ts | 208 ++ .../src/auth/orm/models/principalEntity.ts | 245 ++ .../auth/orm/models/principalScopeOverride.ts | 176 ++ .../src/auth/orm/mutation/index.ts | 140 ++ .../src/auth/orm/query/index.ts | 24 +- .../src/compute/cli/README.md | 109 +- .../src/compute/cli/commands.ts | 10 +- .../cli/commands/function-graph-execution.ts | 22 - .../compute/cli/commands/function-graph.ts | 20 - .../src/compute/orm/README.md | 106 +- sdk/constructive-cli/src/compute/orm/index.ts | 4 +- .../src/compute/orm/input-types.ts | 427 ++-- .../src/compute/orm/models/index.ts | 2 +- .../src/compute/orm/mutation/index.ts | 70 +- sdk/constructive-cli/src/modules/README.md | 2 +- .../src/modules/cli/README.md | 181 +- .../src/modules/cli/commands.ts | 12 +- .../cli/commands/merkle-store-module.ts | 22 + .../cli/commands/principal-auth-module.ts | 611 +++++ .../src/modules/orm/README.md | 194 +- sdk/constructive-cli/src/modules/orm/index.ts | 10 +- .../src/modules/orm/input-types.ts | 1184 ++++++---- .../src/modules/orm/models/index.ts | 5 +- .../modules/orm/models/principalAuthModule.ts | 245 ++ sdk/constructive-react/src/auth/README.md | 4 +- .../src/auth/hooks/README.md | 162 +- .../src/auth/hooks/index.ts | 2 +- .../src/auth/hooks/invalidation.ts | 101 + .../src/auth/hooks/mutation-keys.ts | 58 + .../src/auth/hooks/mutations/index.ts | 11 + .../useCreateOrgApiKeyListMutation.ts | 88 + .../mutations/useCreateOrgApiKeyMutation.ts | 55 + .../useCreateOrgPrincipalMutation.ts | 58 + .../useCreatePrincipalEntityMutation.ts | 91 + .../mutations/useCreatePrincipalMutation.ts | 88 + ...useCreatePrincipalScopeOverrideMutation.ts | 91 + .../useDeleteOrgPrincipalMutation.ts | 58 + .../useDeletePrincipalEntityMutation.ts | 98 + .../mutations/useDeletePrincipalMutation.ts | 98 + .../mutations/useRevokeOrgApiKeyMutation.ts | 55 + .../useUpdatePrincipalEntityMutation.ts | 116 + .../src/auth/hooks/queries/index.ts | 10 +- .../hooks/queries/useOrgApiKeyListQuery.ts | 138 ++ .../hooks/queries/useOrgApiKeyListsQuery.ts | 151 ++ .../queries/usePrincipalEntitiesQuery.ts | 163 ++ .../hooks/queries/usePrincipalEntityQuery.ts | 138 ++ .../auth/hooks/queries/usePrincipalQuery.ts | 138 ++ .../queries/usePrincipalScopeOverrideQuery.ts | 146 ++ .../usePrincipalScopeOverridesQuery.ts | 180 ++ .../auth/hooks/queries/usePrincipalsQuery.ts | 145 ++ .../src/auth/hooks/query-keys.ts | 42 +- sdk/constructive-react/src/auth/orm/README.md | 225 +- sdk/constructive-react/src/auth/orm/index.ts | 8 + .../src/auth/orm/input-types.ts | 1079 ++++++++- .../src/auth/orm/models/index.ts | 4 + .../src/auth/orm/models/orgApiKeyList.ts | 174 ++ .../src/auth/orm/models/principal.ts | 208 ++ .../src/auth/orm/models/principalEntity.ts | 245 ++ .../auth/orm/models/principalScopeOverride.ts | 176 ++ .../src/auth/orm/mutation/index.ts | 140 ++ .../src/auth/orm/query/index.ts | 24 +- .../src/auth/schema-types.ts | 652 +++++- sdk/constructive-react/src/auth/types.ts | 43 + .../src/compute/hooks/README.md | 76 +- .../src/compute/hooks/index.ts | 2 +- .../src/compute/hooks/invalidation.ts | 42 +- .../src/compute/hooks/mutation-keys.ts | 28 +- .../src/compute/hooks/mutations/index.ts | 8 +- .../src/compute/hooks/queries/index.ts | 4 +- .../src/compute/hooks/query-keys.ts | 20 +- .../src/compute/orm/README.md | 106 +- .../src/compute/orm/index.ts | 4 +- .../src/compute/orm/input-types.ts | 427 ++-- .../src/compute/orm/models/index.ts | 2 +- .../src/compute/orm/mutation/index.ts | 70 +- .../src/compute/schema-types.ts | 294 ++- sdk/constructive-react/src/compute/types.ts | 30 +- sdk/constructive-react/src/modules/README.md | 2 +- .../src/modules/hooks/README.md | 126 +- .../src/modules/hooks/index.ts | 2 +- .../src/modules/hooks/invalidation.ts | 102 +- .../src/modules/hooks/mutation-keys.ts | 50 +- .../src/modules/hooks/mutations/index.ts | 15 +- .../useCreatePrincipalAuthModuleMutation.ts | 91 + .../useDeletePrincipalAuthModuleMutation.ts | 104 + .../useUpdatePrincipalAuthModuleMutation.ts | 116 + .../src/modules/hooks/queries/index.ts | 10 +- .../queries/usePrincipalAuthModuleQuery.ts | 144 ++ .../queries/usePrincipalAuthModulesQuery.ts | 174 ++ .../src/modules/hooks/query-keys.ts | 50 +- .../src/modules/orm/README.md | 194 +- .../src/modules/orm/index.ts | 10 +- .../src/modules/orm/input-types.ts | 1184 ++++++---- .../src/modules/orm/models/index.ts | 5 +- .../modules/orm/models/principalAuthModule.ts | 245 ++ .../src/modules/schema-types.ts | 697 ++++-- sdk/constructive-react/src/modules/types.ts | 87 +- sdk/constructive-sdk/schemas/auth.graphql | 2073 ++++++++++++++--- sdk/constructive-sdk/schemas/compute.graphql | 673 +++--- sdk/constructive-sdk/schemas/modules.graphql | 1798 ++++++++------ sdk/constructive-sdk/src/auth/README.md | 4 +- sdk/constructive-sdk/src/auth/orm/README.md | 225 +- sdk/constructive-sdk/src/auth/orm/index.ts | 8 + .../src/auth/orm/input-types.ts | 1079 ++++++++- .../src/auth/orm/models/index.ts | 4 + .../src/auth/orm/models/orgApiKeyList.ts | 174 ++ .../src/auth/orm/models/principal.ts | 208 ++ .../src/auth/orm/models/principalEntity.ts | 245 ++ .../auth/orm/models/principalScopeOverride.ts | 176 ++ .../src/auth/orm/mutation/index.ts | 140 ++ .../src/auth/orm/query/index.ts | 24 +- .../src/compute/orm/README.md | 106 +- sdk/constructive-sdk/src/compute/orm/index.ts | 4 +- .../src/compute/orm/input-types.ts | 427 ++-- .../src/compute/orm/models/index.ts | 2 +- .../src/compute/orm/mutation/index.ts | 70 +- sdk/constructive-sdk/src/modules/README.md | 2 +- .../src/modules/orm/README.md | 194 +- sdk/constructive-sdk/src/modules/orm/index.ts | 10 +- .../src/modules/orm/input-types.ts | 1184 ++++++---- .../src/modules/orm/models/index.ts | 5 +- .../modules/orm/models/principalAuthModule.ts | 245 ++ 187 files changed, 21670 insertions(+), 5454 deletions(-) create mode 100644 .agents/skills/cli-auth/references/create-org-api-key.md create mode 100644 .agents/skills/cli-auth/references/create-org-principal.md create mode 100644 .agents/skills/cli-auth/references/delete-org-principal.md create mode 100644 .agents/skills/cli-auth/references/org-api-key-list.md create mode 100644 .agents/skills/cli-auth/references/principal-entity.md create mode 100644 .agents/skills/cli-auth/references/principal-scope-override.md create mode 100644 .agents/skills/cli-auth/references/principal.md create mode 100644 .agents/skills/cli-auth/references/revoke-org-api-key.md create mode 100644 .agents/skills/cli-modules/references/principal-auth-module.md create mode 100644 .agents/skills/hooks-auth/references/create-org-api-key.md create mode 100644 .agents/skills/hooks-auth/references/create-org-principal.md create mode 100644 .agents/skills/hooks-auth/references/delete-org-principal.md create mode 100644 .agents/skills/hooks-auth/references/org-api-key-list.md create mode 100644 .agents/skills/hooks-auth/references/principal-entity.md create mode 100644 .agents/skills/hooks-auth/references/principal-scope-override.md create mode 100644 .agents/skills/hooks-auth/references/principal.md create mode 100644 .agents/skills/hooks-auth/references/revoke-org-api-key.md create mode 100644 .agents/skills/hooks-modules/references/principal-auth-module.md create mode 100644 .agents/skills/orm-auth/references/create-org-api-key.md create mode 100644 .agents/skills/orm-auth/references/create-org-principal.md create mode 100644 .agents/skills/orm-auth/references/delete-org-principal.md create mode 100644 .agents/skills/orm-auth/references/org-api-key-list.md create mode 100644 .agents/skills/orm-auth/references/principal-entity.md create mode 100644 .agents/skills/orm-auth/references/principal-scope-override.md create mode 100644 .agents/skills/orm-auth/references/principal.md create mode 100644 .agents/skills/orm-auth/references/revoke-org-api-key.md create mode 100644 .agents/skills/orm-modules/references/principal-auth-module.md create mode 100644 sdk/constructive-cli/src/auth/cli/commands/create-org-api-key.ts create mode 100644 sdk/constructive-cli/src/auth/cli/commands/create-org-principal.ts create mode 100644 sdk/constructive-cli/src/auth/cli/commands/delete-org-principal.ts create mode 100644 sdk/constructive-cli/src/auth/cli/commands/org-api-key-list.ts create mode 100644 sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts create mode 100644 sdk/constructive-cli/src/auth/cli/commands/principal-scope-override.ts create mode 100644 sdk/constructive-cli/src/auth/cli/commands/principal.ts create mode 100644 sdk/constructive-cli/src/auth/cli/commands/revoke-org-api-key.ts create mode 100644 sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts create mode 100644 sdk/constructive-cli/src/auth/orm/models/principal.ts create mode 100644 sdk/constructive-cli/src/auth/orm/models/principalEntity.ts create mode 100644 sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts create mode 100644 sdk/constructive-cli/src/modules/cli/commands/principal-auth-module.ts create mode 100644 sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgPrincipalMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListsQuery.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntitiesQuery.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntityQuery.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/usePrincipalQuery.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverrideQuery.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverridesQuery.ts create mode 100644 sdk/constructive-react/src/auth/hooks/queries/usePrincipalsQuery.ts create mode 100644 sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts create mode 100644 sdk/constructive-react/src/auth/orm/models/principal.ts create mode 100644 sdk/constructive-react/src/auth/orm/models/principalEntity.ts create mode 100644 sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts create mode 100644 sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts create mode 100644 sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts create mode 100644 sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts create mode 100644 sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts create mode 100644 sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModulesQuery.ts create mode 100644 sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts create mode 100644 sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts create mode 100644 sdk/constructive-sdk/src/auth/orm/models/principal.ts create mode 100644 sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts create mode 100644 sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts create mode 100644 sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts diff --git a/.agents/skills/cli-auth/SKILL.md b/.agents/skills/cli-auth/SKILL.md index 5e6256b4ed..a734d7daff 100644 --- a/.agents/skills/cli-auth/SKILL.md +++ b/.agents/skills/cli-auth/SKILL.md @@ -1,13 +1,13 @@ --- name: cli-auth -description: CLI tool (csdk) for the auth API — provides CRUD commands for 9 tables and 30 custom operations +description: CLI tool (csdk) for the auth API — provides CRUD commands for 13 tables and 34 custom operations --- # cli-auth -CLI tool (csdk) for the auth API — provides CRUD commands for 9 tables and 30 custom operations +CLI tool (csdk) for the auth API — provides CRUD commands for 13 tables and 34 custom operations ## Usage @@ -23,13 +23,13 @@ csdk auth set-token csdk config set csdk config get -# CRUD for any table (e.g. email) -csdk email list -csdk email get --id -csdk email create -- +# CRUD for any table (e.g. principal) +csdk principal list +csdk principal get --id +csdk principal create -- # Non-interactive mode (skip all prompts, use flags only) -csdk --no-tty email list +csdk --no-tty principal list ``` ## Examples @@ -40,13 +40,13 @@ csdk --no-tty email list csdk context create local --endpoint http://localhost:5000/graphql csdk context use local csdk auth set-token -csdk email list +csdk principal list ``` ### Non-interactive mode (for scripts and CI) ```bash -csdk --no-tty email create -- +csdk --no-tty principal create -- ``` ## References @@ -56,6 +56,9 @@ See the `references/` directory for detailed per-entity API documentation: - [context](references/context.md) - [auth](references/auth.md) - [config](references/config.md) +- [principal](references/principal.md) +- [principal-entity](references/principal-entity.md) +- [principal-scope-override](references/principal-scope-override.md) - [email](references/email.md) - [phone-number](references/phone-number.md) - [crypto-address](references/crypto-address.md) @@ -64,21 +67,24 @@ See the `references/` directory for detailed per-entity API documentation: - [identity-provider](references/identity-provider.md) - [role-type](references/role-type.md) - [user-connected-account](references/user-connected-account.md) +- [org-api-key-list](references/org-api-key-list.md) - [user](references/user.md) - [current-user-agent](references/current-user-agent.md) -- [current-ip-address](references/current-ip-address.md) - [current-user-id](references/current-user-id.md) +- [current-ip-address](references/current-ip-address.md) - [require-step-up](references/require-step-up.md) - [current-user](references/current-user.md) - [sign-out](references/sign-out.md) - [send-account-deletion-email](references/send-account-deletion-email.md) - [check-password](references/check-password.md) +- [delete-org-principal](references/delete-org-principal.md) - [disconnect-account](references/disconnect-account.md) - [revoke-api-key](references/revoke-api-key.md) - [revoke-session](references/revoke-session.md) - [verify-password](references/verify-password.md) - [verify-totp](references/verify-totp.md) - [confirm-delete-account](references/confirm-delete-account.md) +- [revoke-org-api-key](references/revoke-org-api-key.md) - [set-password](references/set-password.md) - [verify-email](references/verify-email.md) - [provision-new-user](references/provision-new-user.md) @@ -89,7 +95,9 @@ See the `references/` directory for detailed per-entity API documentation: - [sign-up](references/sign-up.md) - [sign-in](references/sign-in.md) - [link-identity](references/link-identity.md) +- [create-org-principal](references/create-org-principal.md) - [extend-token-expires](references/extend-token-expires.md) +- [create-org-api-key](references/create-org-api-key.md) - [create-api-key](references/create-api-key.md) - [request-cross-origin-token](references/request-cross-origin-token.md) - [forgot-password](references/forgot-password.md) diff --git a/.agents/skills/cli-auth/references/create-api-key.md b/.agents/skills/cli-auth/references/create-api-key.md index 64e63332bc..3a4d58eb50 100644 --- a/.agents/skills/cli-auth/references/create-api-key.md +++ b/.agents/skills/cli-auth/references/create-api-key.md @@ -7,7 +7,7 @@ Execute the createApiKey mutation ## Usage ```bash -csdk create-api-key --input.clientMutationId --input.keyName --input.accessLevel --input.mfaLevel --input.expiresIn +csdk create-api-key --input.clientMutationId --input.keyName --input.accessLevel --input.mfaLevel --input.expiresIn --input.principalId ``` ## Examples @@ -15,5 +15,5 @@ csdk create-api-key --input.clientMutationId --input.keyName - ### Run createApiKey ```bash -csdk create-api-key --input.clientMutationId --input.keyName --input.accessLevel --input.mfaLevel --input.expiresIn +csdk create-api-key --input.clientMutationId --input.keyName --input.accessLevel --input.mfaLevel --input.expiresIn --input.principalId ``` diff --git a/.agents/skills/cli-auth/references/create-org-api-key.md b/.agents/skills/cli-auth/references/create-org-api-key.md new file mode 100644 index 0000000000..b797b00a2f --- /dev/null +++ b/.agents/skills/cli-auth/references/create-org-api-key.md @@ -0,0 +1,19 @@ +# createOrgApiKey + + + +Execute the createOrgApiKey mutation + +## Usage + +```bash +csdk create-org-api-key --input.clientMutationId --input.orgId --input.principalId --input.keyName --input.accessLevel --input.mfaLevel --input.expiresIn +``` + +## Examples + +### Run createOrgApiKey + +```bash +csdk create-org-api-key --input.clientMutationId --input.orgId --input.principalId --input.keyName --input.accessLevel --input.mfaLevel --input.expiresIn +``` diff --git a/.agents/skills/cli-auth/references/create-org-principal.md b/.agents/skills/cli-auth/references/create-org-principal.md new file mode 100644 index 0000000000..f6f6d52944 --- /dev/null +++ b/.agents/skills/cli-auth/references/create-org-principal.md @@ -0,0 +1,19 @@ +# createOrgPrincipal + + + +Execute the createOrgPrincipal mutation + +## Usage + +```bash +csdk create-org-principal --input.clientMutationId --input.name --input.orgId --input.allowedMask --input.isReadOnly --input.bypassStepUp +``` + +## Examples + +### Run createOrgPrincipal + +```bash +csdk create-org-principal --input.clientMutationId --input.name --input.orgId --input.allowedMask --input.isReadOnly --input.bypassStepUp +``` diff --git a/.agents/skills/cli-auth/references/delete-org-principal.md b/.agents/skills/cli-auth/references/delete-org-principal.md new file mode 100644 index 0000000000..8734adcfb0 --- /dev/null +++ b/.agents/skills/cli-auth/references/delete-org-principal.md @@ -0,0 +1,19 @@ +# deleteOrgPrincipal + + + +Execute the deleteOrgPrincipal mutation + +## Usage + +```bash +csdk delete-org-principal --input.clientMutationId --input.principalId +``` + +## Examples + +### Run deleteOrgPrincipal + +```bash +csdk delete-org-principal --input.clientMutationId --input.principalId +``` diff --git a/.agents/skills/cli-auth/references/org-api-key-list.md b/.agents/skills/cli-auth/references/org-api-key-list.md new file mode 100644 index 0000000000..d5ec1acac2 --- /dev/null +++ b/.agents/skills/cli-auth/references/org-api-key-list.md @@ -0,0 +1,68 @@ +# orgApiKeyList + + + +CRUD operations for OrgApiKeyList records via csdk CLI + +## Usage + +```bash +csdk org-api-key-list list +csdk org-api-key-list list --where.. --orderBy +csdk org-api-key-list list --limit 10 --after +csdk org-api-key-list find-first --where.. +csdk org-api-key-list get --id +csdk org-api-key-list create [--keyId ] [--name ] [--principalId ] [--orgId ] [--expiresAt ] [--revokedAt ] [--lastUsedAt ] [--mfaLevel ] [--accessLevel ] +csdk org-api-key-list update --id [--keyId ] [--name ] [--principalId ] [--orgId ] [--expiresAt ] [--revokedAt ] [--lastUsedAt ] [--mfaLevel ] [--accessLevel ] +csdk org-api-key-list delete --id +``` + +## Examples + +### List orgApiKeyList records + +```bash +csdk org-api-key-list list +``` + +### List orgApiKeyList records with pagination + +```bash +csdk org-api-key-list list --limit 10 --offset 0 +``` + +### List orgApiKeyList records with cursor pagination + +```bash +csdk org-api-key-list list --limit 10 --after +``` + +### Find first matching orgApiKeyList + +```bash +csdk org-api-key-list find-first --where.id.equalTo +``` + +### List orgApiKeyList records with field selection + +```bash +csdk org-api-key-list list --select id,id +``` + +### List orgApiKeyList records with filtering and ordering + +```bash +csdk org-api-key-list list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a orgApiKeyList + +```bash +csdk org-api-key-list create [--keyId ] [--name ] [--principalId ] [--orgId ] [--expiresAt ] [--revokedAt ] [--lastUsedAt ] [--mfaLevel ] [--accessLevel ] +``` + +### Get a orgApiKeyList by id + +```bash +csdk org-api-key-list get --id +``` diff --git a/.agents/skills/cli-auth/references/principal-entity.md b/.agents/skills/cli-auth/references/principal-entity.md new file mode 100644 index 0000000000..a28c42b670 --- /dev/null +++ b/.agents/skills/cli-auth/references/principal-entity.md @@ -0,0 +1,68 @@ +# principalEntity + + + +CRUD operations for PrincipalEntity records via csdk CLI + +## Usage + +```bash +csdk principal-entity list +csdk principal-entity list --where.. --orderBy +csdk principal-entity list --limit 10 --after +csdk principal-entity find-first --where.. +csdk principal-entity get --id +csdk principal-entity create --principalId --entityId --ownerId +csdk principal-entity update --id [--principalId ] [--entityId ] [--ownerId ] +csdk principal-entity delete --id +``` + +## Examples + +### List principalEntity records + +```bash +csdk principal-entity list +``` + +### List principalEntity records with pagination + +```bash +csdk principal-entity list --limit 10 --offset 0 +``` + +### List principalEntity records with cursor pagination + +```bash +csdk principal-entity list --limit 10 --after +``` + +### Find first matching principalEntity + +```bash +csdk principal-entity find-first --where.id.equalTo +``` + +### List principalEntity records with field selection + +```bash +csdk principal-entity list --select id,id +``` + +### List principalEntity records with filtering and ordering + +```bash +csdk principal-entity list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a principalEntity + +```bash +csdk principal-entity create --principalId --entityId --ownerId +``` + +### Get a principalEntity by id + +```bash +csdk principal-entity get --id +``` diff --git a/.agents/skills/cli-auth/references/principal-scope-override.md b/.agents/skills/cli-auth/references/principal-scope-override.md new file mode 100644 index 0000000000..e58c3919b1 --- /dev/null +++ b/.agents/skills/cli-auth/references/principal-scope-override.md @@ -0,0 +1,68 @@ +# principalScopeOverride + + + +CRUD operations for PrincipalScopeOverride records via csdk CLI + +## Usage + +```bash +csdk principal-scope-override list +csdk principal-scope-override list --where.. --orderBy +csdk principal-scope-override list --limit 10 --after +csdk principal-scope-override find-first --where.. +csdk principal-scope-override get --id +csdk principal-scope-override create --principalId --membershipType --allowedMask --isAdmin --isReadOnly +csdk principal-scope-override update --id [--principalId ] [--membershipType ] [--allowedMask ] [--isAdmin ] [--isReadOnly ] +csdk principal-scope-override delete --id +``` + +## Examples + +### List principalScopeOverride records + +```bash +csdk principal-scope-override list +``` + +### List principalScopeOverride records with pagination + +```bash +csdk principal-scope-override list --limit 10 --offset 0 +``` + +### List principalScopeOverride records with cursor pagination + +```bash +csdk principal-scope-override list --limit 10 --after +``` + +### Find first matching principalScopeOverride + +```bash +csdk principal-scope-override find-first --where.id.equalTo +``` + +### List principalScopeOverride records with field selection + +```bash +csdk principal-scope-override list --select id,id +``` + +### List principalScopeOverride records with filtering and ordering + +```bash +csdk principal-scope-override list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a principalScopeOverride + +```bash +csdk principal-scope-override create --principalId --membershipType --allowedMask --isAdmin --isReadOnly +``` + +### Get a principalScopeOverride by id + +```bash +csdk principal-scope-override get --id +``` diff --git a/.agents/skills/cli-auth/references/principal.md b/.agents/skills/cli-auth/references/principal.md new file mode 100644 index 0000000000..9b67208a8f --- /dev/null +++ b/.agents/skills/cli-auth/references/principal.md @@ -0,0 +1,68 @@ +# principal + + + +CRUD operations for Principal records via csdk CLI + +## Usage + +```bash +csdk principal list +csdk principal list --where.. --orderBy +csdk principal list --limit 10 --after +csdk principal find-first --where.. +csdk principal get --principalId +csdk principal create --id --ownerId --userId --name --allowedMask --isReadOnly --bypassStepUp +csdk principal update --principalId [--id ] [--ownerId ] [--userId ] [--name ] [--allowedMask ] [--isReadOnly ] [--bypassStepUp ] +csdk principal delete --principalId +``` + +## Examples + +### List principal records + +```bash +csdk principal list +``` + +### List principal records with pagination + +```bash +csdk principal list --limit 10 --offset 0 +``` + +### List principal records with cursor pagination + +```bash +csdk principal list --limit 10 --after +``` + +### Find first matching principal + +```bash +csdk principal find-first --where.principalId.equalTo +``` + +### List principal records with field selection + +```bash +csdk principal list --select id,principalId +``` + +### List principal records with filtering and ordering + +```bash +csdk principal list --where.principalId.equalTo --orderBy PRINCIPAL_ID_ASC +``` + +### Create a principal + +```bash +csdk principal create --id --ownerId --userId --name --allowedMask --isReadOnly --bypassStepUp +``` + +### Get a principal by principalId + +```bash +csdk principal get --principalId +``` diff --git a/.agents/skills/cli-auth/references/revoke-org-api-key.md b/.agents/skills/cli-auth/references/revoke-org-api-key.md new file mode 100644 index 0000000000..2e41bab8d6 --- /dev/null +++ b/.agents/skills/cli-auth/references/revoke-org-api-key.md @@ -0,0 +1,19 @@ +# revokeOrgApiKey + + + +Execute the revokeOrgApiKey mutation + +## Usage + +```bash +csdk revoke-org-api-key --input.clientMutationId --input.keyId --input.orgId +``` + +## Examples + +### Run revokeOrgApiKey + +```bash +csdk revoke-org-api-key --input.clientMutationId --input.keyId --input.orgId +``` diff --git a/.agents/skills/cli-compute/SKILL.md b/.agents/skills/cli-compute/SKILL.md index b46959280f..0579224db4 100644 --- a/.agents/skills/cli-compute/SKILL.md +++ b/.agents/skills/cli-compute/SKILL.md @@ -68,8 +68,8 @@ See the `references/` directory for detailed per-entity API documentation: - [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) +- [function-graph-execution-node-state](references/function-graph-execution-node-state.md) - [org-function-invocation](references/org-function-invocation.md) - [function-invocation](references/function-invocation.md) - [function-graph-execution](references/function-graph-execution.md) @@ -83,9 +83,9 @@ See the `references/` directory for detailed per-entity API documentation: - [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) +- [import-graph-json](references/import-graph-json.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/function-graph-execution.md b/.agents/skills/cli-compute/references/function-graph-execution.md index 95a185fd28..eba250196b 100644 --- a/.agents/skills/cli-compute/references/function-graph-execution.md +++ b/.agents/skills/cli-compute/references/function-graph-execution.md @@ -12,8 +12,8 @@ csdk function-graph-execution list --where.. --orderBy 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 create --graphId --databaseId --outputNode [--startedAt ] [--invocationId ] [--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 ] [--outputNode ] [--outputPort ] [--status ] [--inputPayload ] [--outputPayload ] [--nodeOutputs ] [--executionPlan ] [--currentWave ] [--parentExecutionId ] [--parentNodeName ] [--definitionsCommitId ] [--tickCount ] [--completedAt ] [--maxTicks ] [--maxPendingJobs ] [--timeoutAt ] [--errorCode ] [--errorMessage ] csdk function-graph-execution delete --id ``` @@ -58,7 +58,7 @@ 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 ] +csdk function-graph-execution create --graphId --databaseId --outputNode [--startedAt ] [--invocationId ] [--outputPort ] [--status ] [--inputPayload ] [--outputPayload ] [--nodeOutputs ] [--executionPlan ] [--currentWave ] [--parentExecutionId ] [--parentNodeName ] [--definitionsCommitId ] [--tickCount ] [--completedAt ] [--maxTicks ] [--maxPendingJobs ] [--timeoutAt ] [--errorCode ] [--errorMessage ] ``` ### Get a functionGraphExecution by id diff --git a/.agents/skills/cli-compute/references/function-graph.md b/.agents/skills/cli-compute/references/function-graph.md index 92e2ae6d3b..f3d01a4ac2 100644 --- a/.agents/skills/cli-compute/references/function-graph.md +++ b/.agents/skills/cli-compute/references/function-graph.md @@ -12,8 +12,8 @@ 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 create --databaseId --storeId --context --name --description --definitionsCommitId --isValid --validationErrors --createdBy +csdk function-graph update --id [--databaseId ] [--storeId ] [--context ] [--name ] [--description ] [--definitionsCommitId ] [--isValid ] [--validationErrors ] [--createdBy ] csdk function-graph delete --id ``` @@ -58,7 +58,7 @@ 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 +csdk function-graph create --databaseId --storeId --context --name --description --definitionsCommitId --isValid --validationErrors --createdBy ``` ### Get a functionGraph by id diff --git a/.agents/skills/cli-compute/references/import-graph-json.md b/.agents/skills/cli-compute/references/import-graph-json.md index 8b5ccdb8b5..6fd69cdc6c 100644 --- a/.agents/skills/cli-compute/references/import-graph-json.md +++ b/.agents/skills/cli-compute/references/import-graph-json.md @@ -7,7 +7,7 @@ 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 +csdk import-graph-json --input.clientMutationId --input.databaseId --input.name --input.graphJson --input.context --input.description --input.createdBy --input.definitionsCommitId ``` ## Examples @@ -15,5 +15,5 @@ csdk import-graph-json --input.clientMutationId --input.databaseId --input.databaseId --input.name --input.graphJson --input.context --input.description --input.entityId --input.createdBy --input.definitionsCommitId +csdk import-graph-json --input.clientMutationId --input.databaseId --input.name --input.graphJson --input.context --input.description --input.createdBy --input.definitionsCommitId ``` diff --git a/.agents/skills/cli-modules/SKILL.md b/.agents/skills/cli-modules/SKILL.md index 80381ca57a..e5ab741076 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 59 tables and 12 custom operations +description: CLI tool (csdk) for the modules API — provides CRUD commands for 60 tables and 12 custom operations --- # cli-modules -CLI tool (csdk) for the modules API — provides CRUD commands for 59 tables and 12 custom operations +CLI tool (csdk) for the modules API — provides CRUD commands for 60 tables and 12 custom operations ## Usage @@ -82,16 +82,17 @@ See the `references/` directory for detailed per-entity API documentation: - [crypto-auth-module](references/crypto-auth-module.md) - [sessions-module](references/sessions-module.md) - [secure-table-provision](references/secure-table-provision.md) -- [merkle-store-module](references/merkle-store-module.md) -- [graph-module](references/graph-module.md) - [database-provision-module](references/database-provision-module.md) - [config-secrets-module](references/config-secrets-module.md) +- [graph-module](references/graph-module.md) +- [merkle-store-module](references/merkle-store-module.md) - [rate-limit-meters-module](references/rate-limit-meters-module.md) - [realtime-module](references/realtime-module.md) - [webauthn-auth-module](references/webauthn-auth-module.md) - [function-invocation-module](references/function-invocation-module.md) - [function-module](references/function-module.md) - [invites-module](references/invites-module.md) +- [principal-auth-module](references/principal-auth-module.md) - [compute-log-module](references/compute-log-module.md) - [inference-log-module](references/inference-log-module.md) - [namespace-module](references/namespace-module.md) diff --git a/.agents/skills/cli-modules/references/merkle-store-module.md b/.agents/skills/cli-modules/references/merkle-store-module.md index b74a9fc03a..18876bc5d6 100644 --- a/.agents/skills/cli-modules/references/merkle-store-module.md +++ b/.agents/skills/cli-modules/references/merkle-store-module.md @@ -12,8 +12,8 @@ csdk merkle-store-module list --where.. --orderBy csdk merkle-store-module list --limit 10 --after csdk merkle-store-module find-first --where.. csdk merkle-store-module get --id -csdk merkle-store-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--objectTableId ] [--storeTableId ] [--commitTableId ] [--refTableId ] [--prefix ] [--apiName ] [--privateApiName ] [--scope ] [--functionPrefix ] -csdk merkle-store-module update --id [--databaseId ] [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--objectTableId ] [--storeTableId ] [--commitTableId ] [--refTableId ] [--prefix ] [--apiName ] [--privateApiName ] [--scope ] [--functionPrefix ] +csdk merkle-store-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--objectTableId ] [--storeTableId ] [--commitTableId ] [--refTableId ] [--prefix ] [--apiName ] [--privateApiName ] [--scope ] [--functionPrefix ] [--permissionKey ] +csdk merkle-store-module update --id [--databaseId ] [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--objectTableId ] [--storeTableId ] [--commitTableId ] [--refTableId ] [--prefix ] [--apiName ] [--privateApiName ] [--scope ] [--functionPrefix ] [--permissionKey ] csdk merkle-store-module delete --id ``` @@ -58,7 +58,7 @@ csdk merkle-store-module list --where.id.equalTo --orderBy ID_ASC ### Create a merkleStoreModule ```bash -csdk merkle-store-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--objectTableId ] [--storeTableId ] [--commitTableId ] [--refTableId ] [--prefix ] [--apiName ] [--privateApiName ] [--scope ] [--functionPrefix ] +csdk merkle-store-module create --databaseId [--schemaId ] [--privateSchemaId ] [--publicSchemaName ] [--privateSchemaName ] [--objectTableId ] [--storeTableId ] [--commitTableId ] [--refTableId ] [--prefix ] [--apiName ] [--privateApiName ] [--scope ] [--functionPrefix ] [--permissionKey ] ``` ### Get a merkleStoreModule by id diff --git a/.agents/skills/cli-modules/references/principal-auth-module.md b/.agents/skills/cli-modules/references/principal-auth-module.md new file mode 100644 index 0000000000..201f3f2156 --- /dev/null +++ b/.agents/skills/cli-modules/references/principal-auth-module.md @@ -0,0 +1,68 @@ +# principalAuthModule + + + +CRUD operations for PrincipalAuthModule records via csdk CLI + +## Usage + +```bash +csdk principal-auth-module list +csdk principal-auth-module list --where.. --orderBy +csdk principal-auth-module list --limit 10 --after +csdk principal-auth-module find-first --where.. +csdk principal-auth-module get --id +csdk principal-auth-module create --databaseId [--schemaId ] [--principalsTableId ] [--principalEntitiesTableId ] [--principalScopeOverridesTableId ] [--usersTableId ] [--sessionsTableId ] [--sessionCredentialsTableId ] [--auditsTableId ] [--principalsTableName ] [--createPrincipalFunction ] [--deletePrincipalFunction ] [--createOrgPrincipalFunction ] [--deleteOrgPrincipalFunction ] [--createOrgApiKeyFunction ] [--revokeOrgApiKeyFunction ] [--apiName ] +csdk principal-auth-module update --id [--databaseId ] [--schemaId ] [--principalsTableId ] [--principalEntitiesTableId ] [--principalScopeOverridesTableId ] [--usersTableId ] [--sessionsTableId ] [--sessionCredentialsTableId ] [--auditsTableId ] [--principalsTableName ] [--createPrincipalFunction ] [--deletePrincipalFunction ] [--createOrgPrincipalFunction ] [--deleteOrgPrincipalFunction ] [--createOrgApiKeyFunction ] [--revokeOrgApiKeyFunction ] [--apiName ] +csdk principal-auth-module delete --id +``` + +## Examples + +### List principalAuthModule records + +```bash +csdk principal-auth-module list +``` + +### List principalAuthModule records with pagination + +```bash +csdk principal-auth-module list --limit 10 --offset 0 +``` + +### List principalAuthModule records with cursor pagination + +```bash +csdk principal-auth-module list --limit 10 --after +``` + +### Find first matching principalAuthModule + +```bash +csdk principal-auth-module find-first --where.id.equalTo +``` + +### List principalAuthModule records with field selection + +```bash +csdk principal-auth-module list --select id,id +``` + +### List principalAuthModule records with filtering and ordering + +```bash +csdk principal-auth-module list --where.id.equalTo --orderBy ID_ASC +``` + +### Create a principalAuthModule + +```bash +csdk principal-auth-module create --databaseId [--schemaId ] [--principalsTableId ] [--principalEntitiesTableId ] [--principalScopeOverridesTableId ] [--usersTableId ] [--sessionsTableId ] [--sessionCredentialsTableId ] [--auditsTableId ] [--principalsTableName ] [--createPrincipalFunction ] [--deletePrincipalFunction ] [--createOrgPrincipalFunction ] [--deleteOrgPrincipalFunction ] [--createOrgApiKeyFunction ] [--revokeOrgApiKeyFunction ] [--apiName ] +``` + +### Get a principalAuthModule by id + +```bash +csdk principal-auth-module get --id +``` diff --git a/.agents/skills/hooks-auth/SKILL.md b/.agents/skills/hooks-auth/SKILL.md index 740f8e251c..a315fb815b 100644 --- a/.agents/skills/hooks-auth/SKILL.md +++ b/.agents/skills/hooks-auth/SKILL.md @@ -1,25 +1,25 @@ --- name: hooks-auth -description: React Query hooks for the auth API — provides typed query and mutation hooks for 9 tables and 30 custom operations +description: React Query hooks for the auth API — provides typed query and mutation hooks for 13 tables and 34 custom operations --- # hooks-auth -React Query hooks for the auth API — provides typed query and mutation hooks for 9 tables and 30 custom operations +React Query hooks for the auth API — provides typed query and mutation hooks for 13 tables and 34 custom operations ## Usage ```typescript // Import hooks -import { useEmailsQuery } from './hooks'; +import { usePrincipalsQuery } from './hooks'; // Query hooks: useQuery, usesQuery // Mutation hooks: useCreateMutation, useUpdateMutation, useDeleteMutation // Bulk mutation hooks (when enabled): useBulkCreateMutation, useBulkUpsertMutation, etc. -const { data, isLoading } = useEmailsQuery({ +const { data, isLoading } = usePrincipalsQuery({ selection: { fields: { id: true } }, }); ``` @@ -29,7 +29,7 @@ const { data, isLoading } = useEmailsQuery({ ### Query records ```typescript -const { data, isLoading } = useEmailsQuery({ +const { data, isLoading } = usePrincipalsQuery({ selection: { fields: { id: true } }, }); ``` @@ -38,6 +38,9 @@ const { data, isLoading } = useEmailsQuery({ See the `references/` directory for detailed per-entity API documentation: +- [principal](references/principal.md) +- [principal-entity](references/principal-entity.md) +- [principal-scope-override](references/principal-scope-override.md) - [email](references/email.md) - [phone-number](references/phone-number.md) - [crypto-address](references/crypto-address.md) @@ -46,21 +49,24 @@ See the `references/` directory for detailed per-entity API documentation: - [identity-provider](references/identity-provider.md) - [role-type](references/role-type.md) - [user-connected-account](references/user-connected-account.md) +- [org-api-key-list](references/org-api-key-list.md) - [user](references/user.md) - [current-user-agent](references/current-user-agent.md) -- [current-ip-address](references/current-ip-address.md) - [current-user-id](references/current-user-id.md) +- [current-ip-address](references/current-ip-address.md) - [require-step-up](references/require-step-up.md) - [current-user](references/current-user.md) - [sign-out](references/sign-out.md) - [send-account-deletion-email](references/send-account-deletion-email.md) - [check-password](references/check-password.md) +- [delete-org-principal](references/delete-org-principal.md) - [disconnect-account](references/disconnect-account.md) - [revoke-api-key](references/revoke-api-key.md) - [revoke-session](references/revoke-session.md) - [verify-password](references/verify-password.md) - [verify-totp](references/verify-totp.md) - [confirm-delete-account](references/confirm-delete-account.md) +- [revoke-org-api-key](references/revoke-org-api-key.md) - [set-password](references/set-password.md) - [verify-email](references/verify-email.md) - [provision-new-user](references/provision-new-user.md) @@ -71,7 +77,9 @@ See the `references/` directory for detailed per-entity API documentation: - [sign-up](references/sign-up.md) - [sign-in](references/sign-in.md) - [link-identity](references/link-identity.md) +- [create-org-principal](references/create-org-principal.md) - [extend-token-expires](references/extend-token-expires.md) +- [create-org-api-key](references/create-org-api-key.md) - [create-api-key](references/create-api-key.md) - [request-cross-origin-token](references/request-cross-origin-token.md) - [forgot-password](references/forgot-password.md) diff --git a/.agents/skills/hooks-auth/references/create-api-key.md b/.agents/skills/hooks-auth/references/create-api-key.md index bf188b901d..d4e20423af 100644 --- a/.agents/skills/hooks-auth/references/create-api-key.md +++ b/.agents/skills/hooks-auth/references/create-api-key.md @@ -7,7 +7,7 @@ React Query mutation hook for createApiKey ## Usage ```typescript -const { mutate } = useCreateApiKeyMutation(); mutate({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '' } }); +const { mutate } = useCreateApiKeyMutation(); mutate({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '', principalId: '' } }); ``` ## Examples @@ -16,5 +16,5 @@ const { mutate } = useCreateApiKeyMutation(); mutate({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '' } }); +mutate({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '', principalId: '' } }); ``` diff --git a/.agents/skills/hooks-auth/references/create-org-api-key.md b/.agents/skills/hooks-auth/references/create-org-api-key.md new file mode 100644 index 0000000000..d110328621 --- /dev/null +++ b/.agents/skills/hooks-auth/references/create-org-api-key.md @@ -0,0 +1,20 @@ +# createOrgApiKey + + + +React Query mutation hook for createOrgApiKey + +## Usage + +```typescript +const { mutate } = useCreateOrgApiKeyMutation(); mutate({ input: '' }); +``` + +## Examples + +### Use useCreateOrgApiKeyMutation + +```typescript +const { mutate, isLoading } = useCreateOrgApiKeyMutation(); +mutate({ input: '' }); +``` diff --git a/.agents/skills/hooks-auth/references/create-org-principal.md b/.agents/skills/hooks-auth/references/create-org-principal.md new file mode 100644 index 0000000000..b8ab8fa0d2 --- /dev/null +++ b/.agents/skills/hooks-auth/references/create-org-principal.md @@ -0,0 +1,20 @@ +# createOrgPrincipal + + + +React Query mutation hook for createOrgPrincipal + +## Usage + +```typescript +const { mutate } = useCreateOrgPrincipalMutation(); mutate({ input: { name: '', orgId: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' } }); +``` + +## Examples + +### Use useCreateOrgPrincipalMutation + +```typescript +const { mutate, isLoading } = useCreateOrgPrincipalMutation(); +mutate({ input: { name: '', orgId: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' } }); +``` diff --git a/.agents/skills/hooks-auth/references/delete-org-principal.md b/.agents/skills/hooks-auth/references/delete-org-principal.md new file mode 100644 index 0000000000..8a91a2e023 --- /dev/null +++ b/.agents/skills/hooks-auth/references/delete-org-principal.md @@ -0,0 +1,20 @@ +# deleteOrgPrincipal + + + +React Query mutation hook for deleteOrgPrincipal + +## Usage + +```typescript +const { mutate } = useDeleteOrgPrincipalMutation(); mutate({ input: { principalId: '' } }); +``` + +## Examples + +### Use useDeleteOrgPrincipalMutation + +```typescript +const { mutate, isLoading } = useDeleteOrgPrincipalMutation(); +mutate({ input: { principalId: '' } }); +``` diff --git a/.agents/skills/hooks-auth/references/org-api-key-list.md b/.agents/skills/hooks-auth/references/org-api-key-list.md new file mode 100644 index 0000000000..b67f71261a --- /dev/null +++ b/.agents/skills/hooks-auth/references/org-api-key-list.md @@ -0,0 +1,34 @@ +# orgApiKeyList + + + +React Query hooks for OrgApiKeyList data operations + +## Usage + +```typescript +useOrgApiKeyListsQuery({ selection: { fields: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } } }) +useOrgApiKeyListQuery({ id: '', selection: { fields: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } } }) +useCreateOrgApiKeyListMutation({ selection: { fields: { id: true } } }) +useUpdateOrgApiKeyListMutation({ selection: { fields: { id: true } } }) +useDeleteOrgApiKeyListMutation({}) +``` + +## Examples + +### List all orgApiKeyLists + +```typescript +const { data, isLoading } = useOrgApiKeyListsQuery({ + selection: { fields: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }, +}); +``` + +### Create a orgApiKeyList + +```typescript +const { mutate } = useCreateOrgApiKeyListMutation({ + selection: { fields: { id: true } }, +}); +mutate({ keyId: '', name: '', principalId: '', orgId: '', expiresAt: '', revokedAt: '', lastUsedAt: '', mfaLevel: '', accessLevel: '' }); +``` diff --git a/.agents/skills/hooks-auth/references/principal-entity.md b/.agents/skills/hooks-auth/references/principal-entity.md new file mode 100644 index 0000000000..afe6d3ef25 --- /dev/null +++ b/.agents/skills/hooks-auth/references/principal-entity.md @@ -0,0 +1,34 @@ +# principalEntity + + + +Association table scoping principals to specific organizations + +## Usage + +```typescript +usePrincipalEntitiesQuery({ selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } } }) +usePrincipalEntityQuery({ id: '', selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } } }) +useCreatePrincipalEntityMutation({ selection: { fields: { id: true } } }) +useUpdatePrincipalEntityMutation({ selection: { fields: { id: true } } }) +useDeletePrincipalEntityMutation({}) +``` + +## Examples + +### List all principalEntities + +```typescript +const { data, isLoading } = usePrincipalEntitiesQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }, +}); +``` + +### Create a principalEntity + +```typescript +const { mutate } = useCreatePrincipalEntityMutation({ + selection: { fields: { id: true } }, +}); +mutate({ principalId: '', entityId: '', ownerId: '' }); +``` diff --git a/.agents/skills/hooks-auth/references/principal-scope-override.md b/.agents/skills/hooks-auth/references/principal-scope-override.md new file mode 100644 index 0000000000..72a7cb9e67 --- /dev/null +++ b/.agents/skills/hooks-auth/references/principal-scope-override.md @@ -0,0 +1,34 @@ +# principalScopeOverride + + + +Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + +## Usage + +```typescript +usePrincipalScopeOverridesQuery({ selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } } }) +usePrincipalScopeOverrideQuery({ id: '', selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } } }) +useCreatePrincipalScopeOverrideMutation({ selection: { fields: { id: true } } }) +useUpdatePrincipalScopeOverrideMutation({ selection: { fields: { id: true } } }) +useDeletePrincipalScopeOverrideMutation({}) +``` + +## Examples + +### List all principalScopeOverrides + +```typescript +const { data, isLoading } = usePrincipalScopeOverridesQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }, +}); +``` + +### Create a principalScopeOverride + +```typescript +const { mutate } = useCreatePrincipalScopeOverrideMutation({ + selection: { fields: { id: true } }, +}); +mutate({ principalId: '', membershipType: '', allowedMask: '', isAdmin: '', isReadOnly: '' }); +``` diff --git a/.agents/skills/hooks-auth/references/principal.md b/.agents/skills/hooks-auth/references/principal.md new file mode 100644 index 0000000000..e6ed3be9f5 --- /dev/null +++ b/.agents/skills/hooks-auth/references/principal.md @@ -0,0 +1,34 @@ +# principal + + + +Scoped sub-identities (API keys and agents) with precomputed SPRT + +## Usage + +```typescript +usePrincipalsQuery({ selection: { fields: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } } }) +usePrincipalQuery({ principalId: '', selection: { fields: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } } }) +useCreatePrincipalMutation({ selection: { fields: { principalId: true } } }) +useUpdatePrincipalMutation({ selection: { fields: { principalId: true } } }) +useDeletePrincipalMutation({}) +``` + +## Examples + +### List all principals + +```typescript +const { data, isLoading } = usePrincipalsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }, +}); +``` + +### Create a principal + +```typescript +const { mutate } = useCreatePrincipalMutation({ + selection: { fields: { principalId: true } }, +}); +mutate({ id: '', ownerId: '', userId: '', name: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' }); +``` diff --git a/.agents/skills/hooks-auth/references/revoke-org-api-key.md b/.agents/skills/hooks-auth/references/revoke-org-api-key.md new file mode 100644 index 0000000000..92d84c526b --- /dev/null +++ b/.agents/skills/hooks-auth/references/revoke-org-api-key.md @@ -0,0 +1,20 @@ +# revokeOrgApiKey + + + +React Query mutation hook for revokeOrgApiKey + +## Usage + +```typescript +const { mutate } = useRevokeOrgApiKeyMutation(); mutate({ input: { keyId: '', orgId: '' } }); +``` + +## Examples + +### Use useRevokeOrgApiKeyMutation + +```typescript +const { mutate, isLoading } = useRevokeOrgApiKeyMutation(); +mutate({ input: { keyId: '', orgId: '' } }); +``` diff --git a/.agents/skills/hooks-compute/SKILL.md b/.agents/skills/hooks-compute/SKILL.md index fc29567e16..a5e4c0e892 100644 --- a/.agents/skills/hooks-compute/SKILL.md +++ b/.agents/skills/hooks-compute/SKILL.md @@ -50,8 +50,8 @@ See the `references/` directory for detailed per-entity API documentation: - [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) +- [function-graph-execution-node-state](references/function-graph-execution-node-state.md) - [org-function-invocation](references/org-function-invocation.md) - [function-invocation](references/function-invocation.md) - [function-graph-execution](references/function-graph-execution.md) @@ -65,9 +65,9 @@ See the `references/` directory for detailed per-entity API documentation: - [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) +- [import-graph-json](references/import-graph-json.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/function-graph-execution.md b/.agents/skills/hooks-compute/references/function-graph-execution.md index 6faa582082..88b1492294 100644 --- a/.agents/skills/hooks-compute/references/function-graph-execution.md +++ b/.agents/skills/hooks-compute/references/function-graph-execution.md @@ -7,8 +7,8 @@ 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 } } }) +useFunctionGraphExecutionsQuery({ selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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, 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({}) @@ -20,7 +20,7 @@ useDeleteFunctionGraphExecutionMutation({}) ```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 } }, + selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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 } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useFunctionGraphExecutionsQuery({ 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: '' }); +mutate({ startedAt: '', graphId: '', invocationId: '', databaseId: '', 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.md b/.agents/skills/hooks-compute/references/function-graph.md index 07bdcc5d38..e29fab1d4e 100644 --- a/.agents/skills/hooks-compute/references/function-graph.md +++ b/.agents/skills/hooks-compute/references/function-graph.md @@ -7,8 +7,8 @@ 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 } } }) +useFunctionGraphsQuery({ selection: { fields: { id: true, databaseId: true, storeId: 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, 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({}) @@ -20,7 +20,7 @@ useDeleteFunctionGraphMutation({}) ```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 } }, + selection: { fields: { id: true, databaseId: true, storeId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useFunctionGraphsQuery({ const { mutate } = useCreateFunctionGraphMutation({ selection: { fields: { id: true } }, }); -mutate({ databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }); +mutate({ databaseId: '', storeId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }); ``` diff --git a/.agents/skills/hooks-modules/SKILL.md b/.agents/skills/hooks-modules/SKILL.md index 43b3762cab..d5061f8349 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 59 tables and 12 custom operations +description: React Query hooks for the modules API — provides typed query and mutation hooks for 60 tables and 12 custom operations --- # hooks-modules -React Query hooks for the modules API — provides typed query and mutation hooks for 59 tables and 12 custom operations +React Query hooks for the modules API — provides typed query and mutation hooks for 60 tables and 12 custom operations ## Usage @@ -64,16 +64,17 @@ See the `references/` directory for detailed per-entity API documentation: - [crypto-auth-module](references/crypto-auth-module.md) - [sessions-module](references/sessions-module.md) - [secure-table-provision](references/secure-table-provision.md) -- [merkle-store-module](references/merkle-store-module.md) -- [graph-module](references/graph-module.md) - [database-provision-module](references/database-provision-module.md) - [config-secrets-module](references/config-secrets-module.md) +- [graph-module](references/graph-module.md) +- [merkle-store-module](references/merkle-store-module.md) - [rate-limit-meters-module](references/rate-limit-meters-module.md) - [realtime-module](references/realtime-module.md) - [webauthn-auth-module](references/webauthn-auth-module.md) - [function-invocation-module](references/function-invocation-module.md) - [function-module](references/function-module.md) - [invites-module](references/invites-module.md) +- [principal-auth-module](references/principal-auth-module.md) - [compute-log-module](references/compute-log-module.md) - [inference-log-module](references/inference-log-module.md) - [namespace-module](references/namespace-module.md) diff --git a/.agents/skills/hooks-modules/references/merkle-store-module.md b/.agents/skills/hooks-modules/references/merkle-store-module.md index 407d61ef3e..2124c1753a 100644 --- a/.agents/skills/hooks-modules/references/merkle-store-module.md +++ b/.agents/skills/hooks-modules/references/merkle-store-module.md @@ -7,8 +7,8 @@ React Query hooks for MerkleStoreModule data operations ## Usage ```typescript -useMerkleStoreModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } } }) -useMerkleStoreModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } } }) +useMerkleStoreModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } } }) +useMerkleStoreModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } } }) useCreateMerkleStoreModuleMutation({ selection: { fields: { id: true } } }) useUpdateMerkleStoreModuleMutation({ selection: { fields: { id: true } } }) useDeleteMerkleStoreModuleMutation({}) @@ -20,7 +20,7 @@ useDeleteMerkleStoreModuleMutation({}) ```typescript const { data, isLoading } = useMerkleStoreModulesQuery({ - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }, + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }, }); ``` @@ -30,5 +30,5 @@ const { data, isLoading } = useMerkleStoreModulesQuery({ const { mutate } = useCreateMerkleStoreModuleMutation({ selection: { fields: { id: true } }, }); -mutate({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '' }); +mutate({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '', permissionKey: '' }); ``` diff --git a/.agents/skills/hooks-modules/references/principal-auth-module.md b/.agents/skills/hooks-modules/references/principal-auth-module.md new file mode 100644 index 0000000000..01374dc265 --- /dev/null +++ b/.agents/skills/hooks-modules/references/principal-auth-module.md @@ -0,0 +1,34 @@ +# principalAuthModule + + + +Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + +## Usage + +```typescript +usePrincipalAuthModulesQuery({ selection: { fields: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } } }) +usePrincipalAuthModuleQuery({ id: '', selection: { fields: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } } }) +useCreatePrincipalAuthModuleMutation({ selection: { fields: { id: true } } }) +useUpdatePrincipalAuthModuleMutation({ selection: { fields: { id: true } } }) +useDeletePrincipalAuthModuleMutation({}) +``` + +## Examples + +### List all principalAuthModules + +```typescript +const { data, isLoading } = usePrincipalAuthModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }, +}); +``` + +### Create a principalAuthModule + +```typescript +const { mutate } = useCreatePrincipalAuthModuleMutation({ + selection: { fields: { id: true } }, +}); +mutate({ databaseId: '', schemaId: '', principalsTableId: '', principalEntitiesTableId: '', principalScopeOverridesTableId: '', usersTableId: '', sessionsTableId: '', sessionCredentialsTableId: '', auditsTableId: '', principalsTableName: '', createPrincipalFunction: '', deletePrincipalFunction: '', createOrgPrincipalFunction: '', deleteOrgPrincipalFunction: '', createOrgApiKeyFunction: '', revokeOrgApiKeyFunction: '', apiName: '' }); +``` diff --git a/.agents/skills/orm-auth/SKILL.md b/.agents/skills/orm-auth/SKILL.md index 846cc82899..e41f89370a 100644 --- a/.agents/skills/orm-auth/SKILL.md +++ b/.agents/skills/orm-auth/SKILL.md @@ -1,13 +1,13 @@ --- name: orm-auth -description: ORM client for the auth API — provides typed CRUD operations for 9 tables and 30 custom operations +description: ORM client for the auth API — provides typed CRUD operations for 13 tables and 34 custom operations --- # orm-auth -ORM client for the auth API — provides typed CRUD operations for 9 tables and 30 custom operations +ORM client for the auth API — provides typed CRUD operations for 13 tables and 34 custom operations ## Usage @@ -15,7 +15,7 @@ ORM client for the auth API — provides typed CRUD operations for 9 tables and // Import the ORM client import { db } from './orm'; -// Available models: email, phoneNumber, cryptoAddress, webauthnCredential, auditLogAuth, identityProvider, roleType, userConnectedAccount, ... +// Available models: principal, principalEntity, principalScopeOverride, email, phoneNumber, cryptoAddress, webauthnCredential, auditLogAuth, ... db..findMany({ select: { id: true } }).execute() db..findOne({ id: '', select: { id: true } }).execute() db..create({ data: { ... }, select: { id: true } }).execute() @@ -28,7 +28,7 @@ db..delete({ where: { id: '' } }).execute() ### Query records ```typescript -const items = await db.email.findMany({ +const items = await db.principal.findMany({ select: { id: true } }).execute(); ``` @@ -37,6 +37,9 @@ const items = await db.email.findMany({ See the `references/` directory for detailed per-entity API documentation: +- [principal](references/principal.md) +- [principal-entity](references/principal-entity.md) +- [principal-scope-override](references/principal-scope-override.md) - [email](references/email.md) - [phone-number](references/phone-number.md) - [crypto-address](references/crypto-address.md) @@ -45,21 +48,24 @@ See the `references/` directory for detailed per-entity API documentation: - [identity-provider](references/identity-provider.md) - [role-type](references/role-type.md) - [user-connected-account](references/user-connected-account.md) +- [org-api-key-list](references/org-api-key-list.md) - [user](references/user.md) - [current-user-agent](references/current-user-agent.md) -- [current-ip-address](references/current-ip-address.md) - [current-user-id](references/current-user-id.md) +- [current-ip-address](references/current-ip-address.md) - [require-step-up](references/require-step-up.md) - [current-user](references/current-user.md) - [sign-out](references/sign-out.md) - [send-account-deletion-email](references/send-account-deletion-email.md) - [check-password](references/check-password.md) +- [delete-org-principal](references/delete-org-principal.md) - [disconnect-account](references/disconnect-account.md) - [revoke-api-key](references/revoke-api-key.md) - [revoke-session](references/revoke-session.md) - [verify-password](references/verify-password.md) - [verify-totp](references/verify-totp.md) - [confirm-delete-account](references/confirm-delete-account.md) +- [revoke-org-api-key](references/revoke-org-api-key.md) - [set-password](references/set-password.md) - [verify-email](references/verify-email.md) - [provision-new-user](references/provision-new-user.md) @@ -70,7 +76,9 @@ See the `references/` directory for detailed per-entity API documentation: - [sign-up](references/sign-up.md) - [sign-in](references/sign-in.md) - [link-identity](references/link-identity.md) +- [create-org-principal](references/create-org-principal.md) - [extend-token-expires](references/extend-token-expires.md) +- [create-org-api-key](references/create-org-api-key.md) - [create-api-key](references/create-api-key.md) - [request-cross-origin-token](references/request-cross-origin-token.md) - [forgot-password](references/forgot-password.md) diff --git a/.agents/skills/orm-auth/references/create-api-key.md b/.agents/skills/orm-auth/references/create-api-key.md index 504504e1a9..5e1294ee85 100644 --- a/.agents/skills/orm-auth/references/create-api-key.md +++ b/.agents/skills/orm-auth/references/create-api-key.md @@ -7,7 +7,7 @@ Execute the createApiKey mutation ## Usage ```typescript -db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '' } }).execute() +db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '', principalId: '' } }).execute() ``` ## Examples @@ -15,5 +15,5 @@ db.mutation.createApiKey({ input: { keyName: '', accessLevel: '' ### Run createApiKey ```typescript -const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '' } }).execute(); +const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '', principalId: '' } }).execute(); ``` diff --git a/.agents/skills/orm-auth/references/create-org-api-key.md b/.agents/skills/orm-auth/references/create-org-api-key.md new file mode 100644 index 0000000000..5bfed11e58 --- /dev/null +++ b/.agents/skills/orm-auth/references/create-org-api-key.md @@ -0,0 +1,19 @@ +# createOrgApiKey + + + +Execute the createOrgApiKey mutation + +## Usage + +```typescript +db.mutation.createOrgApiKey({ input: '' }).execute() +``` + +## Examples + +### Run createOrgApiKey + +```typescript +const result = await db.mutation.createOrgApiKey({ input: '' }).execute(); +``` diff --git a/.agents/skills/orm-auth/references/create-org-principal.md b/.agents/skills/orm-auth/references/create-org-principal.md new file mode 100644 index 0000000000..c9c09855a1 --- /dev/null +++ b/.agents/skills/orm-auth/references/create-org-principal.md @@ -0,0 +1,19 @@ +# createOrgPrincipal + + + +Execute the createOrgPrincipal mutation + +## Usage + +```typescript +db.mutation.createOrgPrincipal({ input: { name: '', orgId: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' } }).execute() +``` + +## Examples + +### Run createOrgPrincipal + +```typescript +const result = await db.mutation.createOrgPrincipal({ input: { name: '', orgId: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' } }).execute(); +``` diff --git a/.agents/skills/orm-auth/references/delete-org-principal.md b/.agents/skills/orm-auth/references/delete-org-principal.md new file mode 100644 index 0000000000..e554c6b3fd --- /dev/null +++ b/.agents/skills/orm-auth/references/delete-org-principal.md @@ -0,0 +1,19 @@ +# deleteOrgPrincipal + + + +Execute the deleteOrgPrincipal mutation + +## Usage + +```typescript +db.mutation.deleteOrgPrincipal({ input: { principalId: '' } }).execute() +``` + +## Examples + +### Run deleteOrgPrincipal + +```typescript +const result = await db.mutation.deleteOrgPrincipal({ input: { principalId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-auth/references/org-api-key-list.md b/.agents/skills/orm-auth/references/org-api-key-list.md new file mode 100644 index 0000000000..87745fda18 --- /dev/null +++ b/.agents/skills/orm-auth/references/org-api-key-list.md @@ -0,0 +1,34 @@ +# orgApiKeyList + + + +ORM operations for OrgApiKeyList records + +## Usage + +```typescript +db.orgApiKeyList.findMany({ select: { id: true } }).execute() +db.orgApiKeyList.findOne({ id: '', select: { id: true } }).execute() +db.orgApiKeyList.create({ data: { keyId: '', name: '', principalId: '', orgId: '', expiresAt: '', revokedAt: '', lastUsedAt: '', mfaLevel: '', accessLevel: '' }, select: { id: true } }).execute() +db.orgApiKeyList.update({ where: { id: '' }, data: { keyId: '' }, select: { id: true } }).execute() +db.orgApiKeyList.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all orgApiKeyList records + +```typescript +const items = await db.orgApiKeyList.findMany({ + select: { id: true, keyId: true } +}).execute(); +``` + +### Create a orgApiKeyList + +```typescript +const item = await db.orgApiKeyList.create({ + data: { keyId: '', name: '', principalId: '', orgId: '', expiresAt: '', revokedAt: '', lastUsedAt: '', mfaLevel: '', accessLevel: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-auth/references/principal-entity.md b/.agents/skills/orm-auth/references/principal-entity.md new file mode 100644 index 0000000000..51701ed335 --- /dev/null +++ b/.agents/skills/orm-auth/references/principal-entity.md @@ -0,0 +1,34 @@ +# principalEntity + + + +Association table scoping principals to specific organizations + +## Usage + +```typescript +db.principalEntity.findMany({ select: { id: true } }).execute() +db.principalEntity.findOne({ id: '', select: { id: true } }).execute() +db.principalEntity.create({ data: { principalId: '', entityId: '', ownerId: '' }, select: { id: true } }).execute() +db.principalEntity.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute() +db.principalEntity.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all principalEntity records + +```typescript +const items = await db.principalEntity.findMany({ + select: { id: true, principalId: true } +}).execute(); +``` + +### Create a principalEntity + +```typescript +const item = await db.principalEntity.create({ + data: { principalId: '', entityId: '', ownerId: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-auth/references/principal-scope-override.md b/.agents/skills/orm-auth/references/principal-scope-override.md new file mode 100644 index 0000000000..c8060f199a --- /dev/null +++ b/.agents/skills/orm-auth/references/principal-scope-override.md @@ -0,0 +1,34 @@ +# principalScopeOverride + + + +Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + +## Usage + +```typescript +db.principalScopeOverride.findMany({ select: { id: true } }).execute() +db.principalScopeOverride.findOne({ id: '', select: { id: true } }).execute() +db.principalScopeOverride.create({ data: { principalId: '', membershipType: '', allowedMask: '', isAdmin: '', isReadOnly: '' }, select: { id: true } }).execute() +db.principalScopeOverride.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute() +db.principalScopeOverride.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all principalScopeOverride records + +```typescript +const items = await db.principalScopeOverride.findMany({ + select: { id: true, principalId: true } +}).execute(); +``` + +### Create a principalScopeOverride + +```typescript +const item = await db.principalScopeOverride.create({ + data: { principalId: '', membershipType: '', allowedMask: '', isAdmin: '', isReadOnly: '' }, + select: { id: true } +}).execute(); +``` diff --git a/.agents/skills/orm-auth/references/principal.md b/.agents/skills/orm-auth/references/principal.md new file mode 100644 index 0000000000..8aeef93618 --- /dev/null +++ b/.agents/skills/orm-auth/references/principal.md @@ -0,0 +1,34 @@ +# principal + + + +Scoped sub-identities (API keys and agents) with precomputed SPRT + +## Usage + +```typescript +db.principal.findMany({ select: { id: true } }).execute() +db.principal.findOne({ principalId: '', select: { id: true } }).execute() +db.principal.create({ data: { id: '', ownerId: '', userId: '', name: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' }, select: { id: true } }).execute() +db.principal.update({ where: { principalId: '' }, data: { id: '' }, select: { id: true } }).execute() +db.principal.delete({ where: { principalId: '' } }).execute() +``` + +## Examples + +### List all principal records + +```typescript +const items = await db.principal.findMany({ + select: { principalId: true, id: true } +}).execute(); +``` + +### Create a principal + +```typescript +const item = await db.principal.create({ + data: { id: '', ownerId: '', userId: '', name: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' }, + select: { principalId: true } +}).execute(); +``` diff --git a/.agents/skills/orm-auth/references/revoke-org-api-key.md b/.agents/skills/orm-auth/references/revoke-org-api-key.md new file mode 100644 index 0000000000..884fd53534 --- /dev/null +++ b/.agents/skills/orm-auth/references/revoke-org-api-key.md @@ -0,0 +1,19 @@ +# revokeOrgApiKey + + + +Execute the revokeOrgApiKey mutation + +## Usage + +```typescript +db.mutation.revokeOrgApiKey({ input: { keyId: '', orgId: '' } }).execute() +``` + +## Examples + +### Run revokeOrgApiKey + +```typescript +const result = await db.mutation.revokeOrgApiKey({ input: { keyId: '', orgId: '' } }).execute(); +``` diff --git a/.agents/skills/orm-compute/SKILL.md b/.agents/skills/orm-compute/SKILL.md index 63b1261cba..f7f7d1c1fb 100644 --- a/.agents/skills/orm-compute/SKILL.md +++ b/.agents/skills/orm-compute/SKILL.md @@ -49,8 +49,8 @@ See the `references/` directory for detailed per-entity API documentation: - [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) +- [function-graph-execution-node-state](references/function-graph-execution-node-state.md) - [org-function-invocation](references/org-function-invocation.md) - [function-invocation](references/function-invocation.md) - [function-graph-execution](references/function-graph-execution.md) @@ -64,9 +64,9 @@ See the `references/` directory for detailed per-entity API documentation: - [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) +- [import-graph-json](references/import-graph-json.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/function-graph-execution.md b/.agents/skills/orm-compute/references/function-graph-execution.md index 3f2c0cb6b1..f0953a862d 100644 --- a/.agents/skills/orm-compute/references/function-graph-execution.md +++ b/.agents/skills/orm-compute/references/function-graph-execution.md @@ -9,7 +9,7 @@ Ephemeral execution state for flow graph evaluation ```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.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', 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() ``` @@ -28,7 +28,7 @@ const items = await db.functionGraphExecution.findMany({ ```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: '' }, + data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', 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.md b/.agents/skills/orm-compute/references/function-graph.md index 4254d30d9c..71c530fb04 100644 --- a/.agents/skills/orm-compute/references/function-graph.md +++ b/.agents/skills/orm-compute/references/function-graph.md @@ -9,7 +9,7 @@ Flow graph definitions — FBP graphs stored in the dedicated graph Merkle store ```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.create({ data: { databaseId: '', storeId: '', 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() ``` @@ -28,7 +28,7 @@ const items = await db.functionGraph.findMany({ ```typescript const item = await db.functionGraph.create({ - data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, + data: { databaseId: '', storeId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); ``` diff --git a/.agents/skills/orm-modules/SKILL.md b/.agents/skills/orm-modules/SKILL.md index 690f541308..63fec58623 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 59 tables and 12 custom operations +description: ORM client for the modules API — provides typed CRUD operations for 60 tables and 12 custom operations --- # orm-modules -ORM client for the modules API — provides typed CRUD operations for 59 tables and 12 custom operations +ORM client for the modules API — provides typed CRUD operations for 60 tables and 12 custom operations ## Usage @@ -63,16 +63,17 @@ See the `references/` directory for detailed per-entity API documentation: - [crypto-auth-module](references/crypto-auth-module.md) - [sessions-module](references/sessions-module.md) - [secure-table-provision](references/secure-table-provision.md) -- [merkle-store-module](references/merkle-store-module.md) -- [graph-module](references/graph-module.md) - [database-provision-module](references/database-provision-module.md) - [config-secrets-module](references/config-secrets-module.md) +- [graph-module](references/graph-module.md) +- [merkle-store-module](references/merkle-store-module.md) - [rate-limit-meters-module](references/rate-limit-meters-module.md) - [realtime-module](references/realtime-module.md) - [webauthn-auth-module](references/webauthn-auth-module.md) - [function-invocation-module](references/function-invocation-module.md) - [function-module](references/function-module.md) - [invites-module](references/invites-module.md) +- [principal-auth-module](references/principal-auth-module.md) - [compute-log-module](references/compute-log-module.md) - [inference-log-module](references/inference-log-module.md) - [namespace-module](references/namespace-module.md) diff --git a/.agents/skills/orm-modules/references/merkle-store-module.md b/.agents/skills/orm-modules/references/merkle-store-module.md index 12d4c3baa8..969e72eaa1 100644 --- a/.agents/skills/orm-modules/references/merkle-store-module.md +++ b/.agents/skills/orm-modules/references/merkle-store-module.md @@ -9,7 +9,7 @@ ORM operations for MerkleStoreModule records ```typescript db.merkleStoreModule.findMany({ select: { id: true } }).execute() db.merkleStoreModule.findOne({ id: '', select: { id: true } }).execute() -db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '' }, select: { id: true } }).execute() +db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '', permissionKey: '' }, select: { id: true } }).execute() db.merkleStoreModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() db.merkleStoreModule.delete({ where: { id: '' } }).execute() ``` @@ -28,7 +28,7 @@ const items = await db.merkleStoreModule.findMany({ ```typescript const item = await db.merkleStoreModule.create({ - data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '' }, + data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '', permissionKey: '' }, select: { id: true } }).execute(); ``` diff --git a/.agents/skills/orm-modules/references/principal-auth-module.md b/.agents/skills/orm-modules/references/principal-auth-module.md new file mode 100644 index 0000000000..df71d8625a --- /dev/null +++ b/.agents/skills/orm-modules/references/principal-auth-module.md @@ -0,0 +1,34 @@ +# principalAuthModule + + + +Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + +## Usage + +```typescript +db.principalAuthModule.findMany({ select: { id: true } }).execute() +db.principalAuthModule.findOne({ id: '', select: { id: true } }).execute() +db.principalAuthModule.create({ data: { databaseId: '', schemaId: '', principalsTableId: '', principalEntitiesTableId: '', principalScopeOverridesTableId: '', usersTableId: '', sessionsTableId: '', sessionCredentialsTableId: '', auditsTableId: '', principalsTableName: '', createPrincipalFunction: '', deletePrincipalFunction: '', createOrgPrincipalFunction: '', deleteOrgPrincipalFunction: '', createOrgApiKeyFunction: '', revokeOrgApiKeyFunction: '', apiName: '' }, select: { id: true } }).execute() +db.principalAuthModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute() +db.principalAuthModule.delete({ where: { id: '' } }).execute() +``` + +## Examples + +### List all principalAuthModule records + +```typescript +const items = await db.principalAuthModule.findMany({ + select: { id: true, databaseId: true } +}).execute(); +``` + +### Create a principalAuthModule + +```typescript +const item = await db.principalAuthModule.create({ + data: { databaseId: '', schemaId: '', principalsTableId: '', principalEntitiesTableId: '', principalScopeOverridesTableId: '', usersTableId: '', sessionsTableId: '', sessionCredentialsTableId: '', auditsTableId: '', principalsTableName: '', createPrincipalFunction: '', deletePrincipalFunction: '', createOrgPrincipalFunction: '', deleteOrgPrincipalFunction: '', createOrgApiKeyFunction: '', revokeOrgApiKeyFunction: '', apiName: '' }, + select: { id: true } +}).execute(); +``` diff --git a/sdk/constructive-cli/src/auth/README.md b/sdk/constructive-cli/src/auth/README.md index 5cc6a423b0..1dae886a2c 100644 --- a/sdk/constructive-cli/src/auth/README.md +++ b/sdk/constructive-cli/src/auth/README.md @@ -8,9 +8,9 @@ ## Overview -- **Tables:** 9 +- **Tables:** 13 - **Custom queries:** 5 -- **Custom mutations:** 25 +- **Custom mutations:** 29 **Generators:** ORM, CLI diff --git a/sdk/constructive-cli/src/auth/cli/README.md b/sdk/constructive-cli/src/auth/cli/README.md index b14c5ba242..255ee197d5 100644 --- a/sdk/constructive-cli/src/auth/cli/README.md +++ b/sdk/constructive-cli/src/auth/cli/README.md @@ -26,6 +26,9 @@ csdk auth set-token | `context` | Manage API contexts (endpoints) | | `auth` | Manage authentication tokens | | `config` | Manage config key-value store (per-context) | +| `principal` | principal CRUD operations | +| `principal-entity` | principalEntity CRUD operations | +| `principal-scope-override` | principalScopeOverride CRUD operations | | `email` | email CRUD operations | | `phone-number` | phoneNumber CRUD operations | | `crypto-address` | cryptoAddress CRUD operations | @@ -34,21 +37,24 @@ csdk auth set-token | `identity-provider` | identityProvider CRUD operations | | `role-type` | roleType CRUD operations | | `user-connected-account` | userConnectedAccount CRUD operations | +| `org-api-key-list` | orgApiKeyList CRUD operations | | `user` | user CRUD operations | | `current-user-agent` | currentUserAgent | -| `current-ip-address` | currentIpAddress | | `current-user-id` | currentUserId | +| `current-ip-address` | currentIpAddress | | `require-step-up` | requireStepUp | | `current-user` | currentUser | | `sign-out` | signOut | | `send-account-deletion-email` | sendAccountDeletionEmail | | `check-password` | checkPassword | +| `delete-org-principal` | deleteOrgPrincipal | | `disconnect-account` | disconnectAccount | | `revoke-api-key` | revokeApiKey | | `revoke-session` | revokeSession | | `verify-password` | verifyPassword | | `verify-totp` | verifyTotp | | `confirm-delete-account` | confirmDeleteAccount | +| `revoke-org-api-key` | revokeOrgApiKey | | `set-password` | setPassword | | `verify-email` | verifyEmail | | `provision-new-user` | provisionNewUser | @@ -59,7 +65,9 @@ csdk auth set-token | `sign-up` | signUp | | `sign-in` | signIn | | `link-identity` | linkIdentity | +| `create-org-principal` | createOrgPrincipal | | `extend-token-expires` | extendTokenExpires | +| `create-org-api-key` | createOrgApiKey | | `create-api-key` | createApiKey | | `request-cross-origin-token` | requestCrossOriginToken | | `forgot-password` | forgotPassword | @@ -110,6 +118,89 @@ Variables are scoped to the active context and stored at `~/.csdk/config/`. ## Table Commands +### `principal` + +CRUD operations for Principal records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all principal records | +| `find-first` | Find first matching principal record | +| `get` | Get a principal by principalId | +| `create` | Create a new principal | +| `update` | Update an existing principal | +| `delete` | Delete a principal | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `ownerId` | UUID | +| `userId` | UUID | +| `name` | String | +| `allowedMask` | BitString | +| `isReadOnly` | Boolean | +| `bypassStepUp` | Boolean | + +**Required create fields:** `id`, `ownerId`, `userId`, `name`, `allowedMask`, `isReadOnly`, `bypassStepUp` + +### `principal-entity` + +CRUD operations for PrincipalEntity records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all principalEntity records | +| `find-first` | Find first matching principalEntity record | +| `get` | Get a principalEntity by id | +| `create` | Create a new principalEntity | +| `update` | Update an existing principalEntity | +| `delete` | Delete a principalEntity | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `principalId` | UUID | +| `entityId` | UUID | +| `ownerId` | UUID | + +**Required create fields:** `principalId`, `entityId`, `ownerId` + +### `principal-scope-override` + +CRUD operations for PrincipalScopeOverride records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all principalScopeOverride records | +| `find-first` | Find first matching principalScopeOverride record | +| `get` | Get a principalScopeOverride by id | +| `create` | Create a new principalScopeOverride | +| `update` | Update an existing principalScopeOverride | +| `delete` | Delete a principalScopeOverride | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `principalId` | UUID | +| `membershipType` | Int | +| `allowedMask` | BitString | +| `isAdmin` | Boolean | +| `isReadOnly` | Boolean | + +**Required create fields:** `principalId`, `membershipType`, `allowedMask`, `isAdmin`, `isReadOnly` + ### `email` CRUD operations for Email records. @@ -337,6 +428,38 @@ CRUD operations for UserConnectedAccount records. **Optional create fields (backend defaults):** `ownerId`, `service`, `identifier`, `details`, `isVerified` +### `org-api-key-list` + +CRUD operations for OrgApiKeyList records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all orgApiKeyList records | +| `find-first` | Find first matching orgApiKeyList record | +| `get` | Get a orgApiKeyList by id | +| `create` | Create a new orgApiKeyList | +| `update` | Update an existing orgApiKeyList | +| `delete` | Delete a orgApiKeyList | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `keyId` | String | +| `name` | String | +| `principalId` | UUID | +| `orgId` | UUID | +| `expiresAt` | Datetime | +| `revokedAt` | Datetime | +| `lastUsedAt` | Datetime | +| `mfaLevel` | String | +| `accessLevel` | String | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | + +**Optional create fields (backend defaults):** `keyId`, `name`, `principalId`, `orgId`, `expiresAt`, `revokedAt`, `lastUsedAt`, `mfaLevel`, `accessLevel` + ### `user` CRUD operations for User records. @@ -404,16 +527,16 @@ currentUserAgent - **Type:** query - **Arguments:** none -### `current-ip-address` +### `current-user-id` -currentIpAddress +currentUserId - **Type:** query - **Arguments:** none -### `current-user-id` +### `current-ip-address` -currentUserId +currentIpAddress - **Type:** query - **Arguments:** none @@ -470,6 +593,18 @@ checkPassword | `--input.clientMutationId` | String | | `--input.password` | String | +### `delete-org-principal` + +deleteOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.principalId` | UUID | + ### `disconnect-account` disconnectAccount @@ -543,6 +678,19 @@ confirmDeleteAccount | `--input.userId` | UUID | | `--input.token` | String | +### `revoke-org-api-key` + +revokeOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.keyId` | UUID (required) | + | `--input.orgId` | UUID (required) | + ### `set-password` setPassword @@ -689,6 +837,22 @@ linkIdentity | `--input.identifier` | String (required) | | `--input.details` | JSON | +### `create-org-principal` + +createOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.name` | String | + | `--input.orgId` | UUID | + | `--input.allowedMask` | BitString | + | `--input.isReadOnly` | Boolean | + | `--input.bypassStepUp` | Boolean | + ### `extend-token-expires` extendTokenExpires @@ -701,6 +865,23 @@ extendTokenExpires | `--input.clientMutationId` | String | | `--input.amount` | IntervalInput | +### `create-org-api-key` + +createOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `--input.clientMutationId` | String | + | `--input.orgId` | UUID | + | `--input.principalId` | UUID | + | `--input.keyName` | String | + | `--input.accessLevel` | String | + | `--input.mfaLevel` | String | + | `--input.expiresIn` | IntervalInput | + ### `create-api-key` createApiKey @@ -715,6 +896,7 @@ createApiKey | `--input.accessLevel` | String | | `--input.mfaLevel` | String | | `--input.expiresIn` | IntervalInput | + | `--input.principalId` | UUID | ### `request-cross-origin-token` diff --git a/sdk/constructive-cli/src/auth/cli/commands.ts b/sdk/constructive-cli/src/auth/cli/commands.ts index 9c156a2a84..508fa2de57 100644 --- a/sdk/constructive-cli/src/auth/cli/commands.ts +++ b/sdk/constructive-cli/src/auth/cli/commands.ts @@ -6,6 +6,9 @@ import { CLIOptions, Inquirerer, extractFirst } from 'inquirerer'; import contextCmd from './commands/context'; import authCmd from './commands/auth'; +import principalCmd from './commands/principal'; +import principalEntityCmd from './commands/principal-entity'; +import principalScopeOverrideCmd from './commands/principal-scope-override'; import emailCmd from './commands/email'; import phoneNumberCmd from './commands/phone-number'; import cryptoAddressCmd from './commands/crypto-address'; @@ -14,21 +17,24 @@ import auditLogAuthCmd from './commands/audit-log-auth'; import identityProviderCmd from './commands/identity-provider'; import roleTypeCmd from './commands/role-type'; import userConnectedAccountCmd from './commands/user-connected-account'; +import orgApiKeyListCmd from './commands/org-api-key-list'; import userCmd from './commands/user'; import currentUserAgentCmd from './commands/current-user-agent'; -import currentIpAddressCmd from './commands/current-ip-address'; import currentUserIdCmd from './commands/current-user-id'; +import currentIpAddressCmd from './commands/current-ip-address'; import requireStepUpCmd from './commands/require-step-up'; import currentUserCmd from './commands/current-user'; import signOutCmd from './commands/sign-out'; import sendAccountDeletionEmailCmd from './commands/send-account-deletion-email'; import checkPasswordCmd from './commands/check-password'; +import deleteOrgPrincipalCmd from './commands/delete-org-principal'; import disconnectAccountCmd from './commands/disconnect-account'; import revokeApiKeyCmd from './commands/revoke-api-key'; import revokeSessionCmd from './commands/revoke-session'; import verifyPasswordCmd from './commands/verify-password'; import verifyTotpCmd from './commands/verify-totp'; import confirmDeleteAccountCmd from './commands/confirm-delete-account'; +import revokeOrgApiKeyCmd from './commands/revoke-org-api-key'; import setPasswordCmd from './commands/set-password'; import verifyEmailCmd from './commands/verify-email'; import provisionNewUserCmd from './commands/provision-new-user'; @@ -39,7 +45,9 @@ import signUpSmsCmd from './commands/sign-up-sms'; import signUpCmd from './commands/sign-up'; import signInCmd from './commands/sign-in'; import linkIdentityCmd from './commands/link-identity'; +import createOrgPrincipalCmd from './commands/create-org-principal'; import extendTokenExpiresCmd from './commands/extend-token-expires'; +import createOrgApiKeyCmd from './commands/create-org-api-key'; import createApiKeyCmd from './commands/create-api-key'; import requestCrossOriginTokenCmd from './commands/request-cross-origin-token'; import forgotPasswordCmd from './commands/forgot-password'; @@ -55,6 +63,9 @@ const createCommandMap: () => Record< > = () => ({ context: contextCmd, auth: authCmd, + principal: principalCmd, + 'principal-entity': principalEntityCmd, + 'principal-scope-override': principalScopeOverrideCmd, email: emailCmd, 'phone-number': phoneNumberCmd, 'crypto-address': cryptoAddressCmd, @@ -63,21 +74,24 @@ const createCommandMap: () => Record< 'identity-provider': identityProviderCmd, 'role-type': roleTypeCmd, 'user-connected-account': userConnectedAccountCmd, + 'org-api-key-list': orgApiKeyListCmd, user: userCmd, 'current-user-agent': currentUserAgentCmd, - 'current-ip-address': currentIpAddressCmd, 'current-user-id': currentUserIdCmd, + 'current-ip-address': currentIpAddressCmd, 'require-step-up': requireStepUpCmd, 'current-user': currentUserCmd, 'sign-out': signOutCmd, 'send-account-deletion-email': sendAccountDeletionEmailCmd, 'check-password': checkPasswordCmd, + 'delete-org-principal': deleteOrgPrincipalCmd, 'disconnect-account': disconnectAccountCmd, 'revoke-api-key': revokeApiKeyCmd, 'revoke-session': revokeSessionCmd, 'verify-password': verifyPasswordCmd, 'verify-totp': verifyTotpCmd, 'confirm-delete-account': confirmDeleteAccountCmd, + 'revoke-org-api-key': revokeOrgApiKeyCmd, 'set-password': setPasswordCmd, 'verify-email': verifyEmailCmd, 'provision-new-user': provisionNewUserCmd, @@ -88,7 +102,9 @@ const createCommandMap: () => Record< 'sign-up': signUpCmd, 'sign-in': signInCmd, 'link-identity': linkIdentityCmd, + 'create-org-principal': createOrgPrincipalCmd, 'extend-token-expires': extendTokenExpiresCmd, + 'create-org-api-key': createOrgApiKeyCmd, 'create-api-key': createApiKeyCmd, 'request-cross-origin-token': requestCrossOriginTokenCmd, 'forgot-password': forgotPasswordCmd, @@ -96,7 +112,7 @@ const createCommandMap: () => Record< 'provision-bucket': provisionBucketCmd, }); const usage = - '\ncsdk \n\nCommands:\n context Manage API contexts\n auth Manage authentication\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n audit-log-auth auditLogAuth CRUD operations\n identity-provider identityProvider CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n user user CRUD operations\n current-user-agent currentUserAgent\n current-ip-address currentIpAddress\n current-user-id currentUserId\n require-step-up requireStepUp\n current-user currentUser\n sign-out signOut\n send-account-deletion-email sendAccountDeletionEmail\n check-password checkPassword\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n confirm-delete-account confirmDeleteAccount\n set-password setPassword\n verify-email verifyEmail\n provision-new-user provisionNewUser\n reset-password resetPassword\n sign-in-cross-origin signInCrossOrigin\n sign-in-sms-otp signInSmsOtp\n sign-up-sms signUpSms\n sign-up signUp\n sign-in signIn\n link-identity linkIdentity\n extend-token-expires extendTokenExpires\n create-api-key createApiKey\n request-cross-origin-token requestCrossOriginToken\n forgot-password forgotPassword\n send-verification-email sendVerificationEmail\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 principal principal CRUD operations\n principal-entity principalEntity CRUD operations\n principal-scope-override principalScopeOverride CRUD operations\n email email CRUD operations\n phone-number phoneNumber CRUD operations\n crypto-address cryptoAddress CRUD operations\n webauthn-credential webauthnCredential CRUD operations\n audit-log-auth auditLogAuth CRUD operations\n identity-provider identityProvider CRUD operations\n role-type roleType CRUD operations\n user-connected-account userConnectedAccount CRUD operations\n org-api-key-list orgApiKeyList CRUD operations\n user user CRUD operations\n current-user-agent currentUserAgent\n current-user-id currentUserId\n current-ip-address currentIpAddress\n require-step-up requireStepUp\n current-user currentUser\n sign-out signOut\n send-account-deletion-email sendAccountDeletionEmail\n check-password checkPassword\n delete-org-principal deleteOrgPrincipal\n disconnect-account disconnectAccount\n revoke-api-key revokeApiKey\n revoke-session revokeSession\n verify-password verifyPassword\n verify-totp verifyTotp\n confirm-delete-account confirmDeleteAccount\n revoke-org-api-key revokeOrgApiKey\n set-password setPassword\n verify-email verifyEmail\n provision-new-user provisionNewUser\n reset-password resetPassword\n sign-in-cross-origin signInCrossOrigin\n sign-in-sms-otp signInSmsOtp\n sign-up-sms signUpSms\n sign-up signUp\n sign-in signIn\n link-identity linkIdentity\n create-org-principal createOrgPrincipal\n extend-token-expires extendTokenExpires\n create-org-api-key createOrgApiKey\n create-api-key createApiKey\n request-cross-origin-token requestCrossOriginToken\n forgot-password forgotPassword\n send-verification-email sendVerificationEmail\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/auth/cli/commands/create-org-api-key.ts b/sdk/constructive-cli/src/auth/cli/commands/create-org-api-key.ts new file mode 100644 index 0000000000..ff4135e4d9 --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/create-org-api-key.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation createOrgApiKey + * @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 { CreateOrgApiKeyVariables } from '../../orm/mutation'; +import type { CreateOrgApiKeyPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('create-org-api-key - createOrgApiKey\n\nUsage: create-org-api-key [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 + .createOrgApiKey( + parsedAnswers as unknown as CreateOrgApiKeyVariables, + { + select: selectFields, + } as unknown as { + select: CreateOrgApiKeyPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: createOrgApiKey'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/create-org-principal.ts b/sdk/constructive-cli/src/auth/cli/commands/create-org-principal.ts new file mode 100644 index 0000000000..2c4547f1d6 --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/create-org-principal.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation createOrgPrincipal + * @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 { CreateOrgPrincipalVariables } from '../../orm/mutation'; +import type { CreateOrgPrincipalPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'create-org-principal - createOrgPrincipal\n\nUsage: create-org-principal [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 + .createOrgPrincipal( + parsedAnswers as unknown as CreateOrgPrincipalVariables, + { + select: selectFields, + } as unknown as { + select: CreateOrgPrincipalPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: createOrgPrincipal'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/delete-org-principal.ts b/sdk/constructive-cli/src/auth/cli/commands/delete-org-principal.ts new file mode 100644 index 0000000000..a3b2dd94ef --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/delete-org-principal.ts @@ -0,0 +1,53 @@ +/** + * CLI command for mutation deleteOrgPrincipal + * @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 { DeleteOrgPrincipalVariables } from '../../orm/mutation'; +import type { DeleteOrgPrincipalPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log( + 'delete-org-principal - deleteOrgPrincipal\n\nUsage: delete-org-principal [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 + .deleteOrgPrincipal( + parsedAnswers as unknown as DeleteOrgPrincipalVariables, + { + select: selectFields, + } as unknown as { + select: DeleteOrgPrincipalPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: deleteOrgPrincipal'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/auth/cli/commands/org-api-key-list.ts b/sdk/constructive-cli/src/auth/cli/commands/org-api-key-list.ts new file mode 100644 index 0000000000..a64679ed1d --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/org-api-key-list.ts @@ -0,0 +1,248 @@ +/** + * CLI commands for OrgApiKeyList + * @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 { + CreateOrgApiKeyListInput, + OrgApiKeyListPatch, + OrgApiKeyListSelect, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + keyId: 'string', + name: 'string', + principalId: 'uuid', + orgId: 'uuid', + expiresAt: 'string', + revokedAt: 'string', + lastUsedAt: 'string', + mfaLevel: 'string', + accessLevel: 'string', + createdAt: 'string', + updatedAt: 'string', +}; +const usage = + '\norg-api-key-list \n\nCommands:\n list List orgApiKeyList records\n find-first Find first matching orgApiKeyList record\n create Create a new orgApiKeyList\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 = { + id: true, + keyId: true, + name: true, + principalId: true, + orgId: true, + expiresAt: true, + revokedAt: true, + lastUsedAt: true, + mfaLevel: true, + accessLevel: true, + createdAt: true, + updatedAt: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: OrgApiKeyListSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.orgApiKeyList.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, + keyId: true, + name: true, + principalId: true, + orgId: true, + expiresAt: true, + revokedAt: true, + lastUsedAt: true, + mfaLevel: true, + accessLevel: true, + createdAt: true, + updatedAt: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: OrgApiKeyListSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.orgApiKeyList.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: 'keyId', + message: 'keyId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalId', + message: 'principalId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'orgId', + message: 'orgId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'expiresAt', + message: 'expiresAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revokedAt', + message: 'revokedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'lastUsedAt', + message: 'lastUsedAt', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'mfaLevel', + message: 'mfaLevel', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'accessLevel', + message: 'accessLevel', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreateOrgApiKeyListInput['orgApiKeyList']; + const client = getClient(); + const result = await client.orgApiKeyList + .create({ + data: { + keyId: cleanedData.keyId, + name: cleanedData.name, + principalId: cleanedData.principalId, + orgId: cleanedData.orgId, + expiresAt: cleanedData.expiresAt, + revokedAt: cleanedData.revokedAt, + lastUsedAt: cleanedData.lastUsedAt, + mfaLevel: cleanedData.mfaLevel, + accessLevel: cleanedData.accessLevel, + }, + select: { + id: true, + keyId: true, + name: true, + principalId: true, + orgId: true, + expiresAt: true, + revokedAt: true, + lastUsedAt: true, + mfaLevel: true, + accessLevel: 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); + } +} diff --git a/sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts b/sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts new file mode 100644 index 0000000000..449a295940 --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/principal-entity.ts @@ -0,0 +1,303 @@ +/** + * CLI commands for PrincipalEntity + * @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 { + CreatePrincipalEntityInput, + PrincipalEntityPatch, + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + createdAt: 'string', + updatedAt: 'string', + principalId: 'uuid', + entityId: 'uuid', + ownerId: 'uuid', +}; +const usage = + '\nprincipal-entity \n\nCommands:\n list List principalEntity records\n find-first Find first matching principalEntity record\n get Get a principalEntity by ID\n create Create a new principalEntity\n update Update an existing principalEntity\n delete Delete a principalEntity\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, + principalId: true, + entityId: true, + ownerId: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PrincipalEntitySelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principalEntity.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, + principalId: true, + entityId: true, + ownerId: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PrincipalEntitySelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principalEntity.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.principalEntity + .findOne({ + id: answers.id as string, + select: { + id: true, + createdAt: true, + updatedAt: true, + principalId: true, + entityId: true, + ownerId: 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: 'principalId', + message: 'principalId', + required: true, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: true, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePrincipalEntityInput['principalEntity']; + const client = getClient(); + const result = await client.principalEntity + .create({ + data: { + principalId: cleanedData.principalId, + entityId: cleanedData.entityId, + ownerId: cleanedData.ownerId, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + principalId: true, + entityId: true, + ownerId: 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: 'principalId', + message: 'principalId', + required: false, + }, + { + type: 'text', + name: 'entityId', + message: 'entityId', + required: false, + }, + { + type: 'text', + name: 'ownerId', + message: 'ownerId', + required: false, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as PrincipalEntityPatch; + const client = getClient(); + const result = await client.principalEntity + .update({ + where: { + id: answers.id as string, + }, + data: { + principalId: cleanedData.principalId, + entityId: cleanedData.entityId, + ownerId: cleanedData.ownerId, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + principalId: true, + entityId: true, + ownerId: 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.principalEntity + .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/auth/cli/commands/principal-scope-override.ts b/sdk/constructive-cli/src/auth/cli/commands/principal-scope-override.ts new file mode 100644 index 0000000000..a23cc5a4ef --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/principal-scope-override.ts @@ -0,0 +1,203 @@ +/** + * CLI commands for PrincipalScopeOverride + * @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 { + CreatePrincipalScopeOverrideInput, + PrincipalScopeOverridePatch, + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + createdAt: 'string', + updatedAt: 'string', + principalId: 'uuid', + membershipType: 'int', + allowedMask: 'string', + isAdmin: 'boolean', + isReadOnly: 'boolean', +}; +const usage = + '\nprincipal-scope-override \n\nCommands:\n list List principalScopeOverride records\n find-first Find first matching principalScopeOverride record\n create Create a new principalScopeOverride\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 = { + id: true, + createdAt: true, + updatedAt: true, + principalId: true, + membershipType: true, + allowedMask: true, + isAdmin: true, + isReadOnly: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + > & { + select: PrincipalScopeOverrideSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principalScopeOverride.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, + principalId: true, + membershipType: true, + allowedMask: true, + isAdmin: true, + isReadOnly: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + > & { + select: PrincipalScopeOverrideSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principalScopeOverride.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: 'principalId', + message: 'principalId', + required: true, + }, + { + type: 'text', + name: 'membershipType', + message: 'membershipType', + required: true, + }, + { + type: 'text', + name: 'allowedMask', + message: 'allowedMask', + required: true, + }, + { + type: 'boolean', + name: 'isAdmin', + message: 'isAdmin', + required: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePrincipalScopeOverrideInput['principalScopeOverride']; + const client = getClient(); + const result = await client.principalScopeOverride + .create({ + data: { + principalId: cleanedData.principalId, + membershipType: cleanedData.membershipType, + allowedMask: cleanedData.allowedMask, + isAdmin: cleanedData.isAdmin, + isReadOnly: cleanedData.isReadOnly, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + principalId: true, + membershipType: true, + allowedMask: true, + isAdmin: true, + isReadOnly: 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/auth/cli/commands/principal.ts b/sdk/constructive-cli/src/auth/cli/commands/principal.ts new file mode 100644 index 0000000000..b3b742cc78 --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/principal.ts @@ -0,0 +1,274 @@ +/** + * CLI commands for Principal + * @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 { + CreatePrincipalInput, + PrincipalPatch, + PrincipalSelect, + PrincipalFilter, + PrincipalOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + createdAt: 'string', + updatedAt: 'string', + ownerId: 'uuid', + userId: 'uuid', + name: 'string', + allowedMask: 'string', + isReadOnly: 'boolean', + bypassStepUp: 'boolean', +}; +const usage = + '\nprincipal \n\nCommands:\n list List principal records\n find-first Find first matching principal record\n get Get a principal by ID\n create Create a new principal\n delete Delete a principal\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', '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 '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, + ownerId: true, + userId: true, + name: true, + allowedMask: true, + isReadOnly: true, + bypassStepUp: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs & { + select: PrincipalSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principal.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, + ownerId: true, + userId: true, + name: true, + allowedMask: true, + isReadOnly: true, + bypassStepUp: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs & { + select: PrincipalSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principal.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: 'principalId', + message: 'principalId', + required: true, + }, + ]); + const client = getClient(); + const result = await client.principal + .findOne({ + principalId: answers.principalId as string, + select: { + id: true, + createdAt: true, + updatedAt: true, + ownerId: true, + userId: true, + name: true, + allowedMask: true, + isReadOnly: true, + bypassStepUp: 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: 'ownerId', + message: 'ownerId', + required: true, + }, + { + type: 'text', + name: 'userId', + message: 'userId', + required: true, + }, + { + type: 'text', + name: 'name', + message: 'name', + required: true, + }, + { + type: 'text', + name: 'allowedMask', + message: 'allowedMask', + required: true, + }, + { + type: 'boolean', + name: 'isReadOnly', + message: 'isReadOnly', + required: true, + }, + { + type: 'boolean', + name: 'bypassStepUp', + message: 'bypassStepUp', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as CreatePrincipalInput['principal']; + const client = getClient(); + const result = await client.principal + .create({ + data: { + ownerId: cleanedData.ownerId, + userId: cleanedData.userId, + name: cleanedData.name, + allowedMask: cleanedData.allowedMask, + isReadOnly: cleanedData.isReadOnly, + bypassStepUp: cleanedData.bypassStepUp, + }, + select: { + id: true, + createdAt: true, + updatedAt: true, + ownerId: true, + userId: true, + name: true, + allowedMask: true, + isReadOnly: true, + bypassStepUp: 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 handleDelete(argv: Partial>, prompter: Inquirerer) { + try { + const rawAnswers = await prompter.prompt(argv, [ + { + type: 'text', + name: 'principalId', + message: 'principalId', + required: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const client = getClient(); + const result = await client.principal + .delete({ + where: { + principalId: answers.principalId as string, + }, + select: { + principalId: 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/auth/cli/commands/revoke-org-api-key.ts b/sdk/constructive-cli/src/auth/cli/commands/revoke-org-api-key.ts new file mode 100644 index 0000000000..f7db2a1a7a --- /dev/null +++ b/sdk/constructive-cli/src/auth/cli/commands/revoke-org-api-key.ts @@ -0,0 +1,51 @@ +/** + * CLI command for mutation revokeOrgApiKey + * @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 { RevokeOrgApiKeyVariables } from '../../orm/mutation'; +import type { RevokeOrgApiKeyPayloadSelect } from '../../orm/input-types'; +export default async ( + argv: Partial>, + prompter: Inquirerer, + _options: CLIOptions +) => { + try { + if (argv.help || argv.h) { + console.log('revoke-org-api-key - revokeOrgApiKey\n\nUsage: revoke-org-api-key [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 + .revokeOrgApiKey( + parsedAnswers as unknown as RevokeOrgApiKeyVariables, + { + select: selectFields, + } as unknown as { + select: RevokeOrgApiKeyPayloadSelect; + } + ) + .execute(); + console.log(JSON.stringify(result, null, 2)); + } catch (error) { + console.error('Failed: revokeOrgApiKey'); + if (error instanceof Error) { + console.error(error.message); + } + process.exit(1); + } +}; diff --git a/sdk/constructive-cli/src/auth/orm/README.md b/sdk/constructive-cli/src/auth/orm/README.md index 68bf0ce72d..343ccbb2bd 100644 --- a/sdk/constructive-cli/src/auth/orm/README.md +++ b/sdk/constructive-cli/src/auth/orm/README.md @@ -21,6 +21,9 @@ const db = createClient({ | Model | Operations | |-------|------------| +| `principal` | findMany, findOne, create, update, delete | +| `principalEntity` | findMany, findOne, create, update, delete | +| `principalScopeOverride` | findMany, findOne, create, update, delete | | `email` | findMany, findOne, create, update, delete | | `phoneNumber` | findMany, findOne, create, update, delete | | `cryptoAddress` | findMany, findOne, create, update, delete | @@ -29,10 +32,118 @@ const db = createClient({ | `identityProvider` | findMany, findOne, create, update, delete | | `roleType` | findMany, findOne, create, update, delete | | `userConnectedAccount` | findMany, findOne, create, update, delete | +| `orgApiKeyList` | findMany, findOne, create, update, delete | | `user` | findMany, findOne, create, update, delete | ## Table Operations +### `db.principal` + +CRUD operations for Principal records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `ownerId` | UUID | Yes | +| `userId` | UUID | Yes | +| `name` | String | Yes | +| `allowedMask` | BitString | Yes | +| `isReadOnly` | Boolean | Yes | +| `bypassStepUp` | Boolean | Yes | + +**Operations:** + +```typescript +// List all principal records +const items = await db.principal.findMany({ select: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }).execute(); + +// Get one by principalId +const item = await db.principal.findOne({ principalId: '', select: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }).execute(); + +// Create +const created = await db.principal.create({ data: { id: '', ownerId: '', userId: '', name: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' }, select: { principalId: true } }).execute(); + +// Update +const updated = await db.principal.update({ where: { principalId: '' }, data: { id: '' }, select: { principalId: true } }).execute(); + +// Delete +const deleted = await db.principal.delete({ where: { principalId: '' } }).execute(); +``` + +### `db.principalEntity` + +CRUD operations for PrincipalEntity records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `principalId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `ownerId` | UUID | Yes | + +**Operations:** + +```typescript +// List all principalEntity records +const items = await db.principalEntity.findMany({ select: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }).execute(); + +// Get one by id +const item = await db.principalEntity.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }).execute(); + +// Create +const created = await db.principalEntity.create({ data: { principalId: '', entityId: '', ownerId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalEntity.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalEntity.delete({ where: { id: '' } }).execute(); +``` + +### `db.principalScopeOverride` + +CRUD operations for PrincipalScopeOverride records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `principalId` | UUID | Yes | +| `membershipType` | Int | Yes | +| `allowedMask` | BitString | Yes | +| `isAdmin` | Boolean | Yes | +| `isReadOnly` | Boolean | Yes | + +**Operations:** + +```typescript +// List all principalScopeOverride records +const items = await db.principalScopeOverride.findMany({ select: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }).execute(); + +// Get one by id +const item = await db.principalScopeOverride.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }).execute(); + +// Create +const created = await db.principalScopeOverride.create({ data: { principalId: '', membershipType: '', allowedMask: '', isAdmin: '', isReadOnly: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalScopeOverride.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalScopeOverride.delete({ where: { id: '' } }).execute(); +``` + ### `db.email` CRUD operations for Email records. @@ -319,6 +430,46 @@ const updated = await db.userConnectedAccount.update({ where: { id: '' }, const deleted = await db.userConnectedAccount.delete({ where: { id: '' } }).execute(); ``` +### `db.orgApiKeyList` + +CRUD operations for OrgApiKeyList records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `keyId` | String | Yes | +| `name` | String | Yes | +| `principalId` | UUID | Yes | +| `orgId` | UUID | Yes | +| `expiresAt` | Datetime | Yes | +| `revokedAt` | Datetime | Yes | +| `lastUsedAt` | Datetime | Yes | +| `mfaLevel` | String | Yes | +| `accessLevel` | String | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | + +**Operations:** + +```typescript +// List all orgApiKeyList records +const items = await db.orgApiKeyList.findMany({ select: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }).execute(); + +// Get one by id +const item = await db.orgApiKeyList.findOne({ id: '', select: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }).execute(); + +// Create +const created = await db.orgApiKeyList.create({ data: { keyId: '', name: '', principalId: '', orgId: '', expiresAt: '', revokedAt: '', lastUsedAt: '', mfaLevel: '', accessLevel: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgApiKeyList.update({ where: { id: '' }, data: { keyId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgApiKeyList.delete({ where: { id: '' } }).execute(); +``` + ### `db.user` CRUD operations for User records. @@ -374,26 +525,26 @@ currentUserAgent const result = await db.query.currentUserAgent().execute(); ``` -### `db.query.currentIpAddress` +### `db.query.currentUserId` -currentIpAddress +currentUserId - **Type:** query - **Arguments:** none ```typescript -const result = await db.query.currentIpAddress().execute(); +const result = await db.query.currentUserId().execute(); ``` -### `db.query.currentUserId` +### `db.query.currentIpAddress` -currentUserId +currentIpAddress - **Type:** query - **Arguments:** none ```typescript -const result = await db.query.currentUserId().execute(); +const result = await db.query.currentIpAddress().execute(); ``` ### `db.query.requireStepUp` @@ -467,6 +618,21 @@ checkPassword const result = await db.mutation.checkPassword({ input: { password: '' } }).execute(); ``` +### `db.mutation.deleteOrgPrincipal` + +deleteOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | DeleteOrgPrincipalInput (required) | + +```typescript +const result = await db.mutation.deleteOrgPrincipal({ input: { principalId: '' } }).execute(); +``` + ### `db.mutation.disconnectAccount` disconnectAccount @@ -557,6 +723,21 @@ confirmDeleteAccount const result = await db.mutation.confirmDeleteAccount({ input: { userId: '', token: '' } }).execute(); ``` +### `db.mutation.revokeOrgApiKey` + +revokeOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | RevokeOrgApiKeyInput (required) | + +```typescript +const result = await db.mutation.revokeOrgApiKey({ input: { keyId: '', orgId: '' } }).execute(); +``` + ### `db.mutation.setPassword` setPassword @@ -707,6 +888,21 @@ linkIdentity const result = await db.mutation.linkIdentity({ input: { service: '', identifier: '', details: '' } }).execute(); ``` +### `db.mutation.createOrgPrincipal` + +createOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgPrincipalInput (required) | + +```typescript +const result = await db.mutation.createOrgPrincipal({ input: { name: '', orgId: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' } }).execute(); +``` + ### `db.mutation.extendTokenExpires` extendTokenExpires @@ -722,6 +918,21 @@ extendTokenExpires const result = await db.mutation.extendTokenExpires({ input: { amount: '' } }).execute(); ``` +### `db.mutation.createOrgApiKey` + +createOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgApiKeyInput (required) | + +```typescript +const result = await db.mutation.createOrgApiKey({ input: '' }).execute(); +``` + ### `db.mutation.createApiKey` createApiKey @@ -734,7 +945,7 @@ createApiKey | `input` | CreateApiKeyInput (required) | ```typescript -const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '' } }).execute(); +const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '', principalId: '' } }).execute(); ``` ### `db.mutation.requestCrossOriginToken` diff --git a/sdk/constructive-cli/src/auth/orm/index.ts b/sdk/constructive-cli/src/auth/orm/index.ts index 35448d7362..f3ecc5703a 100644 --- a/sdk/constructive-cli/src/auth/orm/index.ts +++ b/sdk/constructive-cli/src/auth/orm/index.ts @@ -5,6 +5,9 @@ */ import { OrmClient } from './client'; import type { OrmClientConfig } from './client'; +import { PrincipalModel } from './models/principal'; +import { PrincipalEntityModel } from './models/principalEntity'; +import { PrincipalScopeOverrideModel } from './models/principalScopeOverride'; import { EmailModel } from './models/email'; import { PhoneNumberModel } from './models/phoneNumber'; import { CryptoAddressModel } from './models/cryptoAddress'; @@ -13,6 +16,7 @@ import { AuditLogAuthModel } from './models/auditLogAuth'; import { IdentityProviderModel } from './models/identityProvider'; import { RoleTypeModel } from './models/roleType'; import { UserConnectedAccountModel } from './models/userConnectedAccount'; +import { OrgApiKeyListModel } from './models/orgApiKeyList'; import { UserModel } from './models/user'; import { createQueryOperations } from './query'; import { createMutationOperations } from './mutation'; @@ -49,6 +53,9 @@ export { createMutationOperations } from './mutation'; export function createClient(config: OrmClientConfig) { const client = new OrmClient(config); return { + principal: new PrincipalModel(client), + principalEntity: new PrincipalEntityModel(client), + principalScopeOverride: new PrincipalScopeOverrideModel(client), email: new EmailModel(client), phoneNumber: new PhoneNumberModel(client), cryptoAddress: new CryptoAddressModel(client), @@ -57,6 +64,7 @@ export function createClient(config: OrmClientConfig) { identityProvider: new IdentityProviderModel(client), roleType: new RoleTypeModel(client), userConnectedAccount: new UserConnectedAccountModel(client), + orgApiKeyList: new OrgApiKeyListModel(client), user: new UserModel(client), query: createQueryOperations(client), mutation: createMutationOperations(client), diff --git a/sdk/constructive-cli/src/auth/orm/input-types.ts b/sdk/constructive-cli/src/auth/orm/input-types.ts index 734fe10c3a..f47ec67005 100644 --- a/sdk/constructive-cli/src/auth/orm/input-types.ts +++ b/sdk/constructive-cli/src/auth/orm/input-types.ts @@ -235,8 +235,54 @@ export type Base64EncodedBinary = unknown; export type ConstructiveInternalTypeEmail = unknown; export type ConstructiveInternalTypeImage = unknown; export type ConstructiveInternalTypeOrigin = unknown; -/** User email addresses with verification and primary-email management */ +/** Scoped sub-identities (API keys and agents) with precomputed SPRT */ // ============ Entity Types ============ +export interface Principal { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The human user who owns and manages this principal */ + ownerId?: string | null; + /** The user row (type=3 Principal) that represents this principal identity */ + userId?: string | null; + /** Human-readable label for this principal (e.g., billing-bot, ci-deploy-key) */ + name?: string | null; + /** Permission bitmask subset; all-1s means inherit all parent permissions */ + allowedMask?: string | null; + /** Whether this principal is restricted to read-only operations */ + isReadOnly?: boolean | null; + /** Whether this principal bypasses MFA step-up requirements */ + bypassStepUp?: boolean | null; +} +/** Association table scoping principals to specific organizations */ +export interface PrincipalEntity { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The principal this scoping row belongs to */ + principalId?: string | null; + /** The organization this principal is scoped to */ + entityId?: string | null; + /** Denormalized owner_id from principals table for RLS */ + ownerId?: string | null; +} +/** Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. */ +export interface PrincipalScopeOverride { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The principal this override applies to */ + principalId?: string | null; + /** The scope level (membership_type) this override restricts */ + membershipType?: number | null; + /** Permission bitmask for this scope; AND-masked with parent permissions during cascade */ + allowedMask?: string | null; + /** Whether this principal has admin access at this scope (default true = inherit from parent) */ + isAdmin?: boolean | null; + /** Whether this principal is restricted to read-only at this scope */ + isReadOnly?: boolean | null; +} +/** User email addresses with verification and primary-email management */ export interface Email { id: string; ownerId?: string | null; @@ -349,6 +395,20 @@ export interface UserConnectedAccount { createdAt?: string | null; updatedAt?: string | null; } +export interface OrgApiKeyList { + id: string; + keyId?: string | null; + name?: string | null; + principalId?: string | null; + orgId?: string | null; + expiresAt?: string | null; + revokedAt?: string | null; + lastUsedAt?: string | null; + mfaLevel?: string | null; + accessLevel?: string | null; + createdAt?: string | null; + updatedAt?: string | null; +} export interface User { id: string; username?: string | null; @@ -378,6 +438,20 @@ export interface PageInfo { endCursor?: string | null; } // ============ Entity Relation Types ============ +export interface PrincipalRelations { + owner?: User | null; + user?: User | null; + principalEntities?: ConnectionResult; + principalScopeOverrides?: ConnectionResult; +} +export interface PrincipalEntityRelations { + entity?: User | null; + owner?: User | null; + principal?: Principal | null; +} +export interface PrincipalScopeOverrideRelations { + principal?: Principal | null; +} export interface EmailRelations { owner?: User | null; } @@ -396,8 +470,12 @@ export interface AuditLogAuthRelations { export interface IdentityProviderRelations {} export interface RoleTypeRelations {} export interface UserConnectedAccountRelations {} +export interface OrgApiKeyListRelations {} export interface UserRelations { roleType?: RoleType | null; + ownedPrincipals?: ConnectionResult; + principals?: ConnectionResult; + principalEntitiesByEntityId?: ConnectionResult; ownedEmails?: ConnectionResult; ownedPhoneNumbers?: ConnectionResult; ownedCryptoAddresses?: ConnectionResult; @@ -405,6 +483,10 @@ export interface UserRelations { auditLogAuthsByActorId?: ConnectionResult; } // ============ Entity Types With Relations ============ +export type PrincipalWithRelations = Principal & PrincipalRelations; +export type PrincipalEntityWithRelations = PrincipalEntity & PrincipalEntityRelations; +export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & + PrincipalScopeOverrideRelations; export type EmailWithRelations = Email & EmailRelations; export type PhoneNumberWithRelations = PhoneNumber & PhoneNumberRelations; export type CryptoAddressWithRelations = CryptoAddress & CryptoAddressRelations; @@ -414,8 +496,68 @@ export type IdentityProviderWithRelations = IdentityProvider & IdentityProviderR export type RoleTypeWithRelations = RoleType & RoleTypeRelations; export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConnectedAccountRelations; +export type OrgApiKeyListWithRelations = OrgApiKeyList & OrgApiKeyListRelations; export type UserWithRelations = User & UserRelations; // ============ Entity Select Types ============ +export type PrincipalSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + ownerId?: boolean; + userId?: boolean; + name?: boolean; + allowedMask?: boolean; + isReadOnly?: boolean; + bypassStepUp?: boolean; + owner?: { + select: UserSelect; + }; + user?: { + select: UserSelect; + }; + principalEntities?: { + select: PrincipalEntitySelect; + first?: number; + filter?: PrincipalEntityFilter; + orderBy?: PrincipalEntityOrderBy[]; + }; + principalScopeOverrides?: { + select: PrincipalScopeOverrideSelect; + first?: number; + filter?: PrincipalScopeOverrideFilter; + orderBy?: PrincipalScopeOverrideOrderBy[]; + }; +}; +export type PrincipalEntitySelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + principalId?: boolean; + entityId?: boolean; + ownerId?: boolean; + entity?: { + select: UserSelect; + }; + owner?: { + select: UserSelect; + }; + principal?: { + select: PrincipalSelect; + }; +}; +export type PrincipalScopeOverrideSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + principalId?: boolean; + membershipType?: boolean; + allowedMask?: boolean; + isAdmin?: boolean; + isReadOnly?: boolean; + principal?: { + select: PrincipalSelect; + }; +}; export type EmailSelect = { id?: boolean; ownerId?: boolean; @@ -509,6 +651,20 @@ export type UserConnectedAccountSelect = { createdAt?: boolean; updatedAt?: boolean; }; +export type OrgApiKeyListSelect = { + id?: boolean; + keyId?: boolean; + name?: boolean; + principalId?: boolean; + orgId?: boolean; + expiresAt?: boolean; + revokedAt?: boolean; + lastUsedAt?: boolean; + mfaLevel?: boolean; + accessLevel?: boolean; + createdAt?: boolean; + updatedAt?: boolean; +}; export type UserSelect = { id?: boolean; username?: boolean; @@ -524,6 +680,24 @@ export type UserSelect = { roleType?: { select: RoleTypeSelect; }; + ownedPrincipals?: { + select: PrincipalSelect; + first?: number; + filter?: PrincipalFilter; + orderBy?: PrincipalOrderBy[]; + }; + principals?: { + select: PrincipalSelect; + first?: number; + filter?: PrincipalFilter; + orderBy?: PrincipalOrderBy[]; + }; + principalEntitiesByEntityId?: { + select: PrincipalEntitySelect; + first?: number; + filter?: PrincipalEntityFilter; + orderBy?: PrincipalEntityOrderBy[]; + }; ownedEmails?: { select: EmailSelect; first?: number; @@ -556,6 +730,96 @@ export type UserSelect = { }; }; // ============ Table Filter Types ============ +export interface PrincipalFilter { + /** 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 `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `userId` field. */ + userId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Filter by the object’s `bypassStepUp` field. */ + bypassStepUp?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalFilter[]; + /** Negates the expression. */ + not?: PrincipalFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `user` relation. */ + user?: UserFilter; + /** Filter by the object’s `principalEntities` relation. */ + principalEntities?: PrincipalToManyPrincipalEntityFilter; + /** `principalEntities` exist. */ + principalEntitiesExist?: boolean; + /** Filter by the object’s `principalScopeOverrides` relation. */ + principalScopeOverrides?: PrincipalToManyPrincipalScopeOverrideFilter; + /** `principalScopeOverrides` exist. */ + principalScopeOverridesExist?: boolean; +} +export interface PrincipalEntityFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalEntityFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalEntityFilter[]; + /** Negates the expression. */ + not?: PrincipalEntityFilter; + /** Filter by the object’s `entity` relation. */ + entity?: UserFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +export interface PrincipalScopeOverrideFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `membershipType` field. */ + membershipType?: IntFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isAdmin` field. */ + isAdmin?: BooleanFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalScopeOverrideFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalScopeOverrideFilter[]; + /** Negates the expression. */ + not?: PrincipalScopeOverrideFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} export interface EmailFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -756,6 +1020,38 @@ export interface UserConnectedAccountFilter { /** Negates the expression. */ not?: UserConnectedAccountFilter; } +export interface OrgApiKeyListFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `keyId` field. */ + keyId?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `orgId` field. */ + orgId?: UUIDFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Filter by the object’s `revokedAt` field. */ + revokedAt?: DatetimeFilter; + /** Filter by the object’s `lastUsedAt` field. */ + lastUsedAt?: DatetimeFilter; + /** Filter by the object’s `mfaLevel` field. */ + mfaLevel?: StringFilter; + /** Filter by the object’s `accessLevel` field. */ + accessLevel?: StringFilter; + /** 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?: OrgApiKeyListFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgApiKeyListFilter[]; + /** Negates the expression. */ + not?: OrgApiKeyListFilter; +} export interface UserFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -781,6 +1077,18 @@ export interface UserFilter { not?: UserFilter; /** Filter by the object’s `roleType` relation. */ roleType?: RoleTypeFilter; + /** Filter by the object’s `ownedPrincipals` relation. */ + ownedPrincipals?: UserToManyPrincipalFilter; + /** `ownedPrincipals` exist. */ + ownedPrincipalsExist?: boolean; + /** Filter by the object’s `principals` relation. */ + principals?: UserToManyPrincipalFilter; + /** `principals` exist. */ + principalsExist?: boolean; + /** Filter by the object’s `principalEntitiesByEntityId` relation. */ + principalEntitiesByEntityId?: UserToManyPrincipalEntityFilter; + /** `principalEntitiesByEntityId` exist. */ + principalEntitiesByEntityIdExist?: boolean; /** Filter by the object’s `ownedEmails` relation. */ ownedEmails?: UserToManyEmailFilter; /** `ownedEmails` exist. */ @@ -815,6 +1123,64 @@ export interface UserFilter { unifiedSearch?: string; } // ============ OrderBy Types ============ +export type PrincipalOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC'; +export type PrincipalEntityOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC'; +export type PrincipalScopeOverrideOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC'; export type EmailOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -967,6 +1333,32 @@ export type UserConnectedAccountOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; +export type OrgApiKeyListOrderBy = + | 'NATURAL' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; export type UserOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -994,6 +1386,82 @@ export type UserOrderBy = | 'SEARCH_SCORE_ASC' | 'SEARCH_SCORE_DESC'; // ============ CRUD Input Types ============ +export interface CreatePrincipalInput { + clientMutationId?: string; + principal: { + ownerId: string; + userId: string; + name?: string; + allowedMask?: string; + isReadOnly?: boolean; + bypassStepUp?: boolean; + }; +} +export interface PrincipalPatch { + ownerId?: string | null; + userId?: string | null; + name?: string | null; + allowedMask?: string | null; + isReadOnly?: boolean | null; + bypassStepUp?: boolean | null; +} +export interface UpdatePrincipalInput { + clientMutationId?: string; + principalId: string; + principalPatch: PrincipalPatch; +} +export interface DeletePrincipalInput { + clientMutationId?: string; + principalId: string; +} +export interface CreatePrincipalEntityInput { + clientMutationId?: string; + principalEntity: { + principalId: string; + entityId: string; + ownerId: string; + }; +} +export interface PrincipalEntityPatch { + principalId?: string | null; + entityId?: string | null; + ownerId?: string | null; +} +export interface UpdatePrincipalEntityInput { + clientMutationId?: string; + id: string; + principalEntityPatch: PrincipalEntityPatch; +} +export interface DeletePrincipalEntityInput { + clientMutationId?: string; + id: string; +} +export interface CreatePrincipalScopeOverrideInput { + clientMutationId?: string; + principalScopeOverride: { + principalId: string; + membershipType?: number; + allowedMask?: string; + isAdmin?: boolean; + isReadOnly?: boolean; + }; +} +export interface PrincipalScopeOverridePatch { + principalId?: string | null; + membershipType?: number | null; + allowedMask?: string | null; + isAdmin?: boolean | null; + isReadOnly?: boolean | null; +} +export interface UpdatePrincipalScopeOverrideInput { + clientMutationId?: string; + id: string; + principalScopeOverridePatch: PrincipalScopeOverridePatch; +} +export interface DeletePrincipalScopeOverrideInput { + clientMutationId?: string; + id: string; +} export interface CreateEmailInput { clientMutationId?: string; email: { @@ -1210,6 +1678,40 @@ export interface DeleteUserConnectedAccountInput { clientMutationId?: string; id: string; } +export interface CreateOrgApiKeyListInput { + clientMutationId?: string; + orgApiKeyList: { + keyId?: string; + name?: string; + principalId?: string; + orgId?: string; + expiresAt?: string; + revokedAt?: string; + lastUsedAt?: string; + mfaLevel?: string; + accessLevel?: string; + }; +} +export interface OrgApiKeyListPatch { + keyId?: string | null; + name?: string | null; + principalId?: string | null; + orgId?: string | null; + expiresAt?: string | null; + revokedAt?: string | null; + lastUsedAt?: string | null; + mfaLevel?: string | null; + accessLevel?: string | null; +} +export interface UpdateOrgApiKeyListInput { + clientMutationId?: string; + id: string; + orgApiKeyListPatch: OrgApiKeyListPatch; +} +export interface DeleteOrgApiKeyListInput { + clientMutationId?: string; + id: string; +} export interface CreateUserInput { clientMutationId?: string; user: { @@ -1237,7 +1739,14 @@ export interface DeleteUserInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { + Principal: { + principalEntities: 'PrincipalEntity', + principalScopeOverrides: 'PrincipalScopeOverride', + }, User: { + ownedPrincipals: 'Principal', + principals: 'Principal', + principalEntitiesByEntityId: 'PrincipalEntity', ownedEmails: 'Email', ownedPhoneNumbers: 'PhoneNumber', ownedCryptoAddresses: 'CryptoAddress', @@ -1256,6 +1765,10 @@ export interface CheckPasswordInput { clientMutationId?: string; password?: string; } +export interface DeleteOrgPrincipalInput { + clientMutationId?: string; + principalId?: string; +} export interface DisconnectAccountInput { clientMutationId?: string; accountId: string; @@ -1281,6 +1794,11 @@ export interface ConfirmDeleteAccountInput { userId?: string; token?: string; } +export interface RevokeOrgApiKeyInput { + clientMutationId?: string; + keyId: string; + orgId: string; +} export interface SetPasswordInput { clientMutationId?: string; currentPassword?: string; @@ -1347,16 +1865,34 @@ export interface LinkIdentityInput { identifier: string; details?: Record; } +export interface CreateOrgPrincipalInput { + clientMutationId?: string; + name?: string; + orgId?: string; + allowedMask?: string; + isReadOnly?: boolean; + bypassStepUp?: boolean; +} export interface ExtendTokenExpiresInput { clientMutationId?: string; amount?: IntervalInput; } +export interface CreateOrgApiKeyInput { + clientMutationId?: string; + orgId?: string; + principalId?: string; + keyName?: string; + accessLevel?: string; + mfaLevel?: string; + expiresIn?: IntervalInput; +} export interface CreateApiKeyInput { clientMutationId?: string; keyName?: string; accessLevel?: string; mfaLevel?: string; expiresIn?: IntervalInput; + principalId?: string; } export interface RequestCrossOriginTokenInput { clientMutationId?: string; @@ -1382,6 +1918,24 @@ export interface ProvisionBucketInput { */ ownerId?: string; } +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} +/** A filter to be used against many `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalScopeOverrideFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalScopeOverrideFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalScopeOverrideFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalScopeOverrideFilter; +} /** A filter to be used against ConstructiveInternalTypeEmail fields. All fields are combined with a logical ‘and.’ */ export interface ConstructiveInternalTypeEmailFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -1669,6 +2223,24 @@ export interface ConstructiveInternalTypeImageFilter { /** Contained by the specified JSON. */ containedBy?: ConstructiveInternalTypeImage; } +/** A filter to be used against many `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalFilter; +} +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} /** A filter to be used against many `Email` object types. All fields are combined with a logical ‘and.’ */ export interface UserToManyEmailFilter { /** Filters to entities where at least one related entity matches. */ @@ -1721,6 +2293,18 @@ export interface TrgmSearchInput { /** Minimum similarity threshold (0.0 to 1.0). Higher = stricter matching. Default is 0.3. */ threshold?: number; } +/** An input for mutations affecting `PrincipalEntity` */ +export interface PrincipalEntityInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** The principal this scoping row belongs to */ + principalId: string; + /** The organization this principal is scoped to */ + entityId: string; + /** Denormalized owner_id from principals table for RLS */ + ownerId: string; +} /** An input for mutations affecting `Email` */ export interface EmailInput { id?: string; @@ -1837,7 +2421,22 @@ export interface UserConnectedAccountInput { createdAt?: string; updatedAt?: string; } -/** An input for mutations affecting `User` */ +/** An input for mutations affecting `OrgApiKeyList` */ +export interface OrgApiKeyListInput { + id?: string; + keyId?: string; + name?: string; + principalId?: string; + orgId?: string; + expiresAt?: string; + revokedAt?: string; + lastUsedAt?: string; + mfaLevel?: string; + accessLevel?: string; + createdAt?: string; + updatedAt?: string; +} +/** An input for mutations affecting `User` */ export interface UserInput { id?: string; username?: string; @@ -1866,6 +2465,99 @@ export interface IntervalInput { /** A quantity of years. */ years?: number; } +/** A filter to be used against `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalEntityFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalEntityFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalEntityFilter[]; + /** Negates the expression. */ + not?: PrincipalEntityFilter; + /** Filter by the object’s `entity` relation. */ + entity?: UserFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +/** A filter to be used against `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalScopeOverrideFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `membershipType` field. */ + membershipType?: IntFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isAdmin` field. */ + isAdmin?: BooleanFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalScopeOverrideFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalScopeOverrideFilter[]; + /** Negates the expression. */ + not?: PrincipalScopeOverrideFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +/** A filter to be used against `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalFilter { + /** 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 `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `userId` field. */ + userId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Filter by the object’s `bypassStepUp` field. */ + bypassStepUp?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalFilter[]; + /** Negates the expression. */ + not?: PrincipalFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `user` relation. */ + user?: UserFilter; + /** Filter by the object’s `principalEntities` relation. */ + principalEntities?: PrincipalToManyPrincipalEntityFilter; + /** `principalEntities` exist. */ + principalEntitiesExist?: boolean; + /** Filter by the object’s `principalScopeOverrides` relation. */ + principalScopeOverrides?: PrincipalToManyPrincipalScopeOverrideFilter; + /** `principalScopeOverrides` exist. */ + principalScopeOverridesExist?: boolean; +} /** A filter to be used against `Email` object types. All fields are combined with a logical ‘and.’ */ export interface EmailFilter { /** Filter by the object’s `id` field. */ @@ -2042,6 +2734,152 @@ export interface UUIDFilter { /** Greater than or equal to the specified value. */ greaterThanOrEqualTo?: string; } +/** 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 `User` object types. All fields are combined with a logical ‘and.’ */ +export interface UserFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `username` field. */ + username?: StringTrgmFilter; + /** Filter by the object’s `displayName` field. */ + displayName?: StringTrgmFilter; + /** Filter by the object’s `profilePicture` field. */ + profilePicture?: ConstructiveInternalTypeImageFilter; + /** Filter by the object’s `searchTsv` field. */ + searchTsv?: FullTextFilter; + /** Filter by the object’s `type` field. */ + type?: IntFilter; + /** 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?: UserFilter[]; + /** Checks for any expressions in this list. */ + or?: UserFilter[]; + /** Negates the expression. */ + not?: UserFilter; + /** Filter by the object’s `roleType` relation. */ + roleType?: RoleTypeFilter; + /** Filter by the object’s `ownedPrincipals` relation. */ + ownedPrincipals?: UserToManyPrincipalFilter; + /** `ownedPrincipals` exist. */ + ownedPrincipalsExist?: boolean; + /** Filter by the object’s `principals` relation. */ + principals?: UserToManyPrincipalFilter; + /** `principals` exist. */ + principalsExist?: boolean; + /** Filter by the object’s `principalEntitiesByEntityId` relation. */ + principalEntitiesByEntityId?: UserToManyPrincipalEntityFilter; + /** `principalEntitiesByEntityId` exist. */ + principalEntitiesByEntityIdExist?: boolean; + /** Filter by the object’s `ownedEmails` relation. */ + ownedEmails?: UserToManyEmailFilter; + /** `ownedEmails` exist. */ + ownedEmailsExist?: boolean; + /** Filter by the object’s `ownedPhoneNumbers` relation. */ + ownedPhoneNumbers?: UserToManyPhoneNumberFilter; + /** `ownedPhoneNumbers` exist. */ + ownedPhoneNumbersExist?: boolean; + /** Filter by the object’s `ownedCryptoAddresses` relation. */ + ownedCryptoAddresses?: UserToManyCryptoAddressFilter; + /** `ownedCryptoAddresses` exist. */ + ownedCryptoAddressesExist?: boolean; + /** Filter by the object’s `ownedWebauthnCredentials` relation. */ + ownedWebauthnCredentials?: UserToManyWebauthnCredentialFilter; + /** `ownedWebauthnCredentials` exist. */ + ownedWebauthnCredentialsExist?: boolean; + /** Filter by the object’s `auditLogAuthsByActorId` relation. */ + auditLogAuthsByActorId?: UserToManyAuditLogAuthFilter; + /** `auditLogAuthsByActorId` exist. */ + auditLogAuthsByActorIdExist?: boolean; + /** TSV search on the `search_tsv` column. */ + tsvSearchTsv?: string; + /** TRGM search on the `display_name` column. */ + trgmDisplayName?: TrgmSearchInput; + /** + * Composite unified search. Provide a search string and it will be dispatched to + * all text-compatible search algorithms (tsvector, BM25, pg_trgm) + * 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; +} +/** 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 BitString fields. All fields are combined with a logical ‘and.’ */ +export interface BitStringFilter { + /** 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 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). */ @@ -2144,90 +2982,6 @@ export interface StringFilter { /** Greater than or equal to the specified value (case-insensitive). */ greaterThanOrEqualToInsensitive?: string; } -/** 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 `User` object types. All fields are combined with a logical ‘and.’ */ -export interface UserFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `username` field. */ - username?: StringTrgmFilter; - /** Filter by the object’s `displayName` field. */ - displayName?: StringTrgmFilter; - /** Filter by the object’s `profilePicture` field. */ - profilePicture?: ConstructiveInternalTypeImageFilter; - /** Filter by the object’s `searchTsv` field. */ - searchTsv?: FullTextFilter; - /** Filter by the object’s `type` field. */ - type?: IntFilter; - /** 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?: UserFilter[]; - /** Checks for any expressions in this list. */ - or?: UserFilter[]; - /** Negates the expression. */ - not?: UserFilter; - /** Filter by the object’s `roleType` relation. */ - roleType?: RoleTypeFilter; - /** Filter by the object’s `ownedEmails` relation. */ - ownedEmails?: UserToManyEmailFilter; - /** `ownedEmails` exist. */ - ownedEmailsExist?: boolean; - /** Filter by the object’s `ownedPhoneNumbers` relation. */ - ownedPhoneNumbers?: UserToManyPhoneNumberFilter; - /** `ownedPhoneNumbers` exist. */ - ownedPhoneNumbersExist?: boolean; - /** Filter by the object’s `ownedCryptoAddresses` relation. */ - ownedCryptoAddresses?: UserToManyCryptoAddressFilter; - /** `ownedCryptoAddresses` exist. */ - ownedCryptoAddressesExist?: boolean; - /** Filter by the object’s `ownedWebauthnCredentials` relation. */ - ownedWebauthnCredentials?: UserToManyWebauthnCredentialFilter; - /** `ownedWebauthnCredentials` exist. */ - ownedWebauthnCredentialsExist?: boolean; - /** Filter by the object’s `auditLogAuthsByActorId` relation. */ - auditLogAuthsByActorId?: UserToManyAuditLogAuthFilter; - /** `auditLogAuthsByActorId` exist. */ - auditLogAuthsByActorIdExist?: boolean; - /** TSV search on the `search_tsv` column. */ - tsvSearchTsv?: string; - /** TRGM search on the `display_name` column. */ - trgmDisplayName?: TrgmSearchInput; - /** - * Composite unified search. Provide a search string and it will be dispatched to - * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * 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; -} /** A filter to be used against BigInt fields. All fields are combined with a logical ‘and.’ */ export interface BigIntFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -2346,31 +3100,6 @@ export interface FullTextFilter { /** Performs a full text search on the field. */ matches?: 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 `RoleType` object types. All fields are combined with a logical ‘and.’ */ export interface RoleTypeFilter { /** Filter by the object’s `id` field. */ @@ -2405,6 +3134,14 @@ export interface CheckPasswordPayload { export type CheckPasswordPayloadSelect = { clientMutationId?: boolean; }; +export interface DeleteOrgPrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type DeleteOrgPrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface DisconnectAccountPayload { clientMutationId?: string | null; result?: boolean | null; @@ -2453,6 +3190,14 @@ export type ConfirmDeleteAccountPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; +export interface RevokeOrgApiKeyPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type RevokeOrgApiKeyPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface SetPasswordPayload { clientMutationId?: string | null; result?: boolean | null; @@ -2543,6 +3288,14 @@ export type LinkIdentityPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; +export interface CreateOrgPrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreateOrgPrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface ExtendTokenExpiresPayload { clientMutationId?: string | null; result?: ExtendTokenExpiresRecord[] | null; @@ -2553,6 +3306,16 @@ export type ExtendTokenExpiresPayloadSelect = { select: ExtendTokenExpiresRecordSelect; }; }; +export interface CreateOrgApiKeyPayload { + clientMutationId?: string | null; + result?: CreateOrgApiKeyRecord | null; +} +export type CreateOrgApiKeyPayloadSelect = { + clientMutationId?: boolean; + result?: { + select: CreateOrgApiKeyRecordSelect; + }; +}; export interface CreateApiKeyPayload { clientMutationId?: string | null; result?: CreateApiKeyRecord | null; @@ -2607,6 +3370,67 @@ export type ProvisionBucketPayloadSelect = { endpoint?: boolean; error?: boolean; }; +export interface CreatePrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreatePrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface DeletePrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type DeletePrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface CreatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was created by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type CreatePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; +export interface UpdatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was updated by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type UpdatePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; +export interface DeletePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was deleted by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type DeletePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; export interface CreateEmailPayload { clientMutationId?: string | null; /** The `Email` that was created by this mutation. */ @@ -2899,6 +3723,17 @@ export type CreateUserConnectedAccountPayloadSelect = { select: UserConnectedAccountSelect; }; }; +export interface CreateOrgApiKeyListPayload { + clientMutationId?: string | null; + /** The `OrgApiKeyList` that was created by this mutation. */ + orgApiKeyList?: OrgApiKeyList | null; +} +export type CreateOrgApiKeyListPayloadSelect = { + clientMutationId?: boolean; + orgApiKeyList?: { + select: OrgApiKeyListSelect; + }; +}; export interface CreateUserPayload { clientMutationId?: string | null; /** The `User` that was created by this mutation. */ @@ -3026,6 +3861,16 @@ export type ExtendTokenExpiresRecordSelect = { sessionId?: boolean; expiresAt?: boolean; }; +export interface CreateOrgApiKeyRecord { + apiKey?: string | null; + keyId?: string | null; + expiresAt?: string | null; +} +export type CreateOrgApiKeyRecordSelect = { + apiKey?: boolean; + keyId?: boolean; + expiresAt?: boolean; +}; export interface CreateApiKeyRecord { apiKey?: string | null; keyId?: string | null; @@ -3036,6 +3881,18 @@ export type CreateApiKeyRecordSelect = { keyId?: boolean; expiresAt?: boolean; }; +/** A `PrincipalEntity` edge in the connection. */ +export interface PrincipalEntityEdge { + cursor?: string | null; + /** The `PrincipalEntity` at the end of the edge. */ + node?: PrincipalEntity | null; +} +export type PrincipalEntityEdgeSelect = { + cursor?: boolean; + node?: { + select: PrincipalEntitySelect; + }; +}; /** A `Email` edge in the connection. */ export interface EmailEdge { cursor?: string | null; diff --git a/sdk/constructive-cli/src/auth/orm/models/index.ts b/sdk/constructive-cli/src/auth/orm/models/index.ts index f0ecad3b71..d041785e90 100644 --- a/sdk/constructive-cli/src/auth/orm/models/index.ts +++ b/sdk/constructive-cli/src/auth/orm/models/index.ts @@ -3,6 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ +export { PrincipalModel } from './principal'; +export { PrincipalEntityModel } from './principalEntity'; +export { PrincipalScopeOverrideModel } from './principalScopeOverride'; export { EmailModel } from './email'; export { PhoneNumberModel } from './phoneNumber'; export { CryptoAddressModel } from './cryptoAddress'; @@ -11,4 +14,5 @@ export { AuditLogAuthModel } from './auditLogAuth'; export { IdentityProviderModel } from './identityProvider'; export { RoleTypeModel } from './roleType'; export { UserConnectedAccountModel } from './userConnectedAccount'; +export { OrgApiKeyListModel } from './orgApiKeyList'; export { UserModel } from './user'; diff --git a/sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts b/sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts new file mode 100644 index 0000000000..fe7120ee8a --- /dev/null +++ b/sdk/constructive-cli/src/auth/orm/models/orgApiKeyList.ts @@ -0,0 +1,174 @@ +/** + * OrgApiKeyList 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 { + OrgApiKeyList, + OrgApiKeyListWithRelations, + OrgApiKeyListSelect, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy, + CreateOrgApiKeyListInput, + UpdateOrgApiKeyListInput, + OrgApiKeyListPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgApiKeyListModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyLists: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + 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, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyLists', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyList: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', + document, + variables, + transform: (data: { + orgApiKeyLists?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyList: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', + document, + variables, + transform: (data: { + orgApiKeyLists?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgApiKeyList: { + orgApiKeyList: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgApiKeyList', + 'createOrgApiKeyList', + 'orgApiKeyList', + args.select, + args.data, + 'CreateOrgApiKeyListInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgApiKeyList', + fieldName: 'createOrgApiKeyList', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/auth/orm/models/principal.ts b/sdk/constructive-cli/src/auth/orm/models/principal.ts new file mode 100644 index 0000000000..66c9d2ff40 --- /dev/null +++ b/sdk/constructive-cli/src/auth/orm/models/principal.ts @@ -0,0 +1,208 @@ +/** + * Principal 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 { + Principal, + PrincipalWithRelations, + PrincipalSelect, + PrincipalFilter, + PrincipalOrderBy, + CreatePrincipalInput, + UpdatePrincipalInput, + PrincipalPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principals: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + 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, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principals', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principal: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'Principal', + 'principals', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', + document, + variables, + transform: (data: { + principals?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principal: data.principals?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + principalId: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principal: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + args.select, + { + where: { + principalId: { + equalTo: args.principalId, + }, + }, + first: 1, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', + document, + variables, + transform: (data: { + principals?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principal: data.principals?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipal: { + principal: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'Principal', + 'createPrincipal', + 'principal', + args.select, + args.data, + 'CreatePrincipalInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'Principal', + fieldName: 'createPrincipal', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + principalId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipal: { + principal: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'Principal', + 'deletePrincipal', + 'principal', + { + principalId: args.where.principalId, + }, + 'DeletePrincipalInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'Principal', + fieldName: 'deletePrincipal', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/auth/orm/models/principalEntity.ts b/sdk/constructive-cli/src/auth/orm/models/principalEntity.ts new file mode 100644 index 0000000000..0c265501f5 --- /dev/null +++ b/sdk/constructive-cli/src/auth/orm/models/principalEntity.ts @@ -0,0 +1,245 @@ +/** + * PrincipalEntity 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 { + PrincipalEntity, + PrincipalEntityWithRelations, + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy, + CreatePrincipalEntityInput, + UpdatePrincipalEntityInput, + PrincipalEntityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalEntityModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntities: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + 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, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntities', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntity: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', + document, + variables, + transform: (data: { + principalEntities?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntity: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', + document, + variables, + transform: (data: { + principalEntities?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalEntity', + 'createPrincipalEntity', + 'principalEntity', + args.select, + args.data, + 'CreatePrincipalEntityInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'createPrincipalEntity', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrincipalEntityPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PrincipalEntity', + 'updatePrincipalEntity', + 'principalEntity', + args.select, + args.where.id, + args.data, + 'UpdatePrincipalEntityInput', + 'id', + 'principalEntityPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'updatePrincipalEntity', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PrincipalEntity', + 'deletePrincipalEntity', + 'principalEntity', + { + id: args.where.id, + }, + 'DeletePrincipalEntityInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'deletePrincipalEntity', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts b/sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts new file mode 100644 index 0000000000..3d3e7bedd3 --- /dev/null +++ b/sdk/constructive-cli/src/auth/orm/models/principalScopeOverride.ts @@ -0,0 +1,176 @@ +/** + * PrincipalScopeOverride 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 { + PrincipalScopeOverride, + PrincipalScopeOverrideWithRelations, + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy, + CreatePrincipalScopeOverrideInput, + UpdatePrincipalScopeOverrideInput, + PrincipalScopeOverridePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalScopeOverrideModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverrides: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + 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, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverrides', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverride: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', + document, + variables, + transform: (data: { + principalScopeOverrides?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverride: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', + document, + variables, + transform: (data: { + principalScopeOverrides?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalScopeOverride: { + principalScopeOverride: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalScopeOverride', + 'createPrincipalScopeOverride', + 'principalScopeOverride', + args.select, + args.data, + 'CreatePrincipalScopeOverrideInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalScopeOverride', + fieldName: 'createPrincipalScopeOverride', + document, + variables, + }); + } +} diff --git a/sdk/constructive-cli/src/auth/orm/mutation/index.ts b/sdk/constructive-cli/src/auth/orm/mutation/index.ts index d8864374dd..de98ebe402 100644 --- a/sdk/constructive-cli/src/auth/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/auth/orm/mutation/index.ts @@ -10,12 +10,14 @@ import type { SignOutInput, SendAccountDeletionEmailInput, CheckPasswordInput, + DeleteOrgPrincipalInput, DisconnectAccountInput, RevokeApiKeyInput, RevokeSessionInput, VerifyPasswordInput, VerifyTotpInput, ConfirmDeleteAccountInput, + RevokeOrgApiKeyInput, SetPasswordInput, VerifyEmailInput, ProvisionNewUserInput, @@ -26,7 +28,9 @@ import type { SignUpInput, SignInInput, LinkIdentityInput, + CreateOrgPrincipalInput, ExtendTokenExpiresInput, + CreateOrgApiKeyInput, CreateApiKeyInput, RequestCrossOriginTokenInput, ForgotPasswordInput, @@ -35,12 +39,14 @@ import type { SignOutPayload, SendAccountDeletionEmailPayload, CheckPasswordPayload, + DeleteOrgPrincipalPayload, DisconnectAccountPayload, RevokeApiKeyPayload, RevokeSessionPayload, VerifyPasswordPayload, VerifyTotpPayload, ConfirmDeleteAccountPayload, + RevokeOrgApiKeyPayload, SetPasswordPayload, VerifyEmailPayload, ProvisionNewUserPayload, @@ -51,7 +57,9 @@ import type { SignUpPayload, SignInPayload, LinkIdentityPayload, + CreateOrgPrincipalPayload, ExtendTokenExpiresPayload, + CreateOrgApiKeyPayload, CreateApiKeyPayload, RequestCrossOriginTokenPayload, ForgotPasswordPayload, @@ -60,12 +68,14 @@ import type { SignOutPayloadSelect, SendAccountDeletionEmailPayloadSelect, CheckPasswordPayloadSelect, + DeleteOrgPrincipalPayloadSelect, DisconnectAccountPayloadSelect, RevokeApiKeyPayloadSelect, RevokeSessionPayloadSelect, VerifyPasswordPayloadSelect, VerifyTotpPayloadSelect, ConfirmDeleteAccountPayloadSelect, + RevokeOrgApiKeyPayloadSelect, SetPasswordPayloadSelect, VerifyEmailPayloadSelect, ProvisionNewUserPayloadSelect, @@ -76,7 +86,9 @@ import type { SignUpPayloadSelect, SignInPayloadSelect, LinkIdentityPayloadSelect, + CreateOrgPrincipalPayloadSelect, ExtendTokenExpiresPayloadSelect, + CreateOrgApiKeyPayloadSelect, CreateApiKeyPayloadSelect, RequestCrossOriginTokenPayloadSelect, ForgotPasswordPayloadSelect, @@ -93,6 +105,9 @@ export interface SendAccountDeletionEmailVariables { export interface CheckPasswordVariables { input: CheckPasswordInput; } +export interface DeleteOrgPrincipalVariables { + input: DeleteOrgPrincipalInput; +} export interface DisconnectAccountVariables { input: DisconnectAccountInput; } @@ -111,6 +126,9 @@ export interface VerifyTotpVariables { export interface ConfirmDeleteAccountVariables { input: ConfirmDeleteAccountInput; } +export interface RevokeOrgApiKeyVariables { + input: RevokeOrgApiKeyInput; +} export interface SetPasswordVariables { input: SetPasswordInput; } @@ -141,9 +159,15 @@ export interface SignInVariables { export interface LinkIdentityVariables { input: LinkIdentityInput; } +export interface CreateOrgPrincipalVariables { + input: CreateOrgPrincipalInput; +} export interface ExtendTokenExpiresVariables { input: ExtendTokenExpiresInput; } +export interface CreateOrgApiKeyVariables { + input: CreateOrgApiKeyInput; +} export interface CreateApiKeyVariables { input: CreateApiKeyInput; } @@ -255,6 +279,35 @@ export function createMutationOperations(client: OrmClient) { 'CheckPasswordPayload' ), }), + deleteOrgPrincipal: ( + args: DeleteOrgPrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + deleteOrgPrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DeleteOrgPrincipal', + fieldName: 'deleteOrgPrincipal', + ...buildCustomDocument( + 'mutation', + 'DeleteOrgPrincipal', + 'deleteOrgPrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'DeleteOrgPrincipalInput!', + }, + ], + connectionFieldsMap, + 'DeleteOrgPrincipalPayload' + ), + }), disconnectAccount: ( args: DisconnectAccountVariables, options: { @@ -429,6 +482,35 @@ export function createMutationOperations(client: OrmClient) { 'ConfirmDeleteAccountPayload' ), }), + revokeOrgApiKey: ( + args: RevokeOrgApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeOrgApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeOrgApiKey', + fieldName: 'revokeOrgApiKey', + ...buildCustomDocument( + 'mutation', + 'RevokeOrgApiKey', + 'revokeOrgApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeOrgApiKeyInput!', + }, + ], + connectionFieldsMap, + 'RevokeOrgApiKeyPayload' + ), + }), setPassword: ( args: SetPasswordVariables, options: { @@ -719,6 +801,35 @@ export function createMutationOperations(client: OrmClient) { 'LinkIdentityPayload' ), }), + createOrgPrincipal: ( + args: CreateOrgPrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createOrgPrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateOrgPrincipal', + fieldName: 'createOrgPrincipal', + ...buildCustomDocument( + 'mutation', + 'CreateOrgPrincipal', + 'createOrgPrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'CreateOrgPrincipalInput!', + }, + ], + connectionFieldsMap, + 'CreateOrgPrincipalPayload' + ), + }), extendTokenExpires: ( args: ExtendTokenExpiresVariables, options: { @@ -748,6 +859,35 @@ export function createMutationOperations(client: OrmClient) { 'ExtendTokenExpiresPayload' ), }), + createOrgApiKey: ( + args: CreateOrgApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createOrgApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateOrgApiKey', + fieldName: 'createOrgApiKey', + ...buildCustomDocument( + 'mutation', + 'CreateOrgApiKey', + 'createOrgApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'CreateOrgApiKeyInput!', + }, + ], + connectionFieldsMap, + 'CreateOrgApiKeyPayload' + ), + }), createApiKey: ( args: CreateApiKeyVariables, options: { diff --git a/sdk/constructive-cli/src/auth/orm/query/index.ts b/sdk/constructive-cli/src/auth/orm/query/index.ts index 408632294d..c91b14032e 100644 --- a/sdk/constructive-cli/src/auth/orm/query/index.ts +++ b/sdk/constructive-cli/src/auth/orm/query/index.ts @@ -32,18 +32,18 @@ export function createQueryOperations(client: OrmClient) { undefined ), }), - currentIpAddress: (options?: { select?: Record }) => + currentUserId: (options?: { select?: Record }) => new QueryBuilder<{ - currentIpAddress: string | null; + currentUserId: string | null; }>({ client, operation: 'query', - operationName: 'CurrentIpAddress', - fieldName: 'currentIpAddress', + operationName: 'CurrentUserId', + fieldName: 'currentUserId', ...buildCustomDocument( 'query', - 'CurrentIpAddress', - 'currentIpAddress', + 'CurrentUserId', + 'currentUserId', options?.select, undefined, [], @@ -51,18 +51,18 @@ export function createQueryOperations(client: OrmClient) { undefined ), }), - currentUserId: (options?: { select?: Record }) => + currentIpAddress: (options?: { select?: Record }) => new QueryBuilder<{ - currentUserId: string | null; + currentIpAddress: string | null; }>({ client, operation: 'query', - operationName: 'CurrentUserId', - fieldName: 'currentUserId', + operationName: 'CurrentIpAddress', + fieldName: 'currentIpAddress', ...buildCustomDocument( 'query', - 'CurrentUserId', - 'currentUserId', + 'CurrentIpAddress', + 'currentIpAddress', options?.select, undefined, [], diff --git a/sdk/constructive-cli/src/compute/cli/README.md b/sdk/constructive-cli/src/compute/cli/README.md index a9e5c5300f..226a4a871c 100644 --- a/sdk/constructive-cli/src/compute/cli/README.md +++ b/sdk/constructive-cli/src/compute/cli/README.md @@ -38,8 +38,8 @@ csdk auth set-token | `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 | +| `function-graph-execution-node-state` | functionGraphExecutionNodeState CRUD operations | | `org-function-invocation` | orgFunctionInvocation CRUD operations | | `function-invocation` | functionInvocation CRUD operations | | `function-graph-execution` | functionGraphExecution CRUD operations | @@ -53,9 +53,9 @@ csdk auth set-token | `save-graph` | saveGraph | | `add-edge-and-save` | addEdgeAndSave | | `add-node-and-save` | addNodeAndSave | +| `import-graph-json` | importGraphJson | | `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. @@ -446,6 +446,38 @@ CRUD operations for FunctionExecutionLog records. **Required create fields:** `message`, `databaseId` **Optional create fields (backend defaults):** `invocationId`, `taskIdentifier`, `logLevel`, `metadata`, `actorId` +### `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 | +| `context` | String | +| `name` | String | +| `description` | String | +| `definitionsCommitId` | UUID | +| `isValid` | Boolean | +| `validationErrors` | JSON | +| `createdBy` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | + +**Required create fields:** `databaseId`, `storeId`, `context`, `name`, `description`, `definitionsCommitId`, `isValid`, `validationErrors`, `createdBy` + ### `function-graph-execution-node-state` CRUD operations for FunctionGraphExecutionNodeState records. @@ -479,39 +511,6 @@ CRUD operations for FunctionGraphExecutionNodeState records. **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. @@ -605,7 +604,6 @@ CRUD operations for FunctionGraphExecution records. | `graphId` | UUID | | `invocationId` | UUID | | `databaseId` | UUID | -| `entityId` | UUID | | `outputNode` | String | | `outputPort` | String | | `status` | String | @@ -626,7 +624,7 @@ CRUD operations for FunctionGraphExecution records. | `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` +**Optional create fields (backend defaults):** `startedAt`, `invocationId`, `outputPort`, `status`, `inputPayload`, `outputPayload`, `nodeOutputs`, `executionPlan`, `currentWave`, `parentExecutionId`, `parentNodeName`, `definitionsCommitId`, `tickCount`, `completedAt`, `maxTicks`, `maxPendingJobs`, `timeoutAt`, `errorCode`, `errorMessage` ### `function-definition` @@ -808,6 +806,24 @@ addNodeAndSave | `--input.meta` | JSON | | `--input.message` | String | +### `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.createdBy` | UUID | + | `--input.definitionsCommitId` | UUID | + ### `add-edge` addEdge @@ -846,25 +862,6 @@ addNode | `--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 diff --git a/sdk/constructive-cli/src/compute/cli/commands.ts b/sdk/constructive-cli/src/compute/cli/commands.ts index 437ce960ed..d347f50dd8 100644 --- a/sdk/constructive-cli/src/compute/cli/commands.ts +++ b/sdk/constructive-cli/src/compute/cli/commands.ts @@ -18,8 +18,8 @@ import functionGraphExecutionOutputCmd from './commands/function-graph-execution 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 functionGraphExecutionNodeStateCmd from './commands/function-graph-execution-node-state'; import orgFunctionInvocationCmd from './commands/org-function-invocation'; import functionInvocationCmd from './commands/function-invocation'; import functionGraphExecutionCmd from './commands/function-graph-execution'; @@ -33,9 +33,9 @@ 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 importGraphJsonCmd from './commands/import-graph-json'; 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'; @@ -61,8 +61,8 @@ const createCommandMap: () => Record< 'function-graph-commit': functionGraphCommitCmd, 'secret-definition': secretDefinitionCmd, 'function-execution-log': functionExecutionLogCmd, - 'function-graph-execution-node-state': functionGraphExecutionNodeStateCmd, 'function-graph': functionGraphCmd, + 'function-graph-execution-node-state': functionGraphExecutionNodeStateCmd, 'org-function-invocation': orgFunctionInvocationCmd, 'function-invocation': functionInvocationCmd, 'function-graph-execution': functionGraphExecutionCmd, @@ -76,15 +76,15 @@ const createCommandMap: () => Record< 'save-graph': saveGraphCmd, 'add-edge-and-save': addEdgeAndSaveCmd, 'add-node-and-save': addNodeAndSaveCmd, + 'import-graph-json': importGraphJsonCmd, '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'; + '\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 functionGraph CRUD operations\n function-graph-execution-node-state functionGraphExecutionNodeState 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 import-graph-json importGraphJson\n add-edge addEdge\n add-node addNode\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, 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 index a49aeaed79..059abe7b20 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph-execution.ts @@ -21,7 +21,6 @@ const fieldSchema: FieldSchema = { graphId: 'uuid', invocationId: 'uuid', databaseId: 'uuid', - entityId: 'uuid', outputNode: 'string', outputPort: 'string', status: 'string', @@ -97,7 +96,6 @@ async function handleList(argv: Partial>, _prompter: Inq graphId: true, invocationId: true, databaseId: true, - entityId: true, outputNode: true, outputPort: true, status: true, @@ -145,7 +143,6 @@ async function handleFindFirst(argv: Partial>, _prompter graphId: true, invocationId: true, databaseId: true, - entityId: true, outputNode: true, outputPort: true, status: true, @@ -205,7 +202,6 @@ async function handleGet(argv: Partial>, prompter: Inqui graphId: true, invocationId: true, databaseId: true, - entityId: true, outputNode: true, outputPort: true, status: true, @@ -265,13 +261,6 @@ async function handleCreate(argv: Partial>, prompter: In message: 'databaseId', required: true, }, - { - type: 'text', - name: 'entityId', - message: 'entityId', - required: false, - skipPrompt: true, - }, { type: 'text', name: 'outputNode', @@ -411,7 +400,6 @@ async function handleCreate(argv: Partial>, prompter: In graphId: cleanedData.graphId, invocationId: cleanedData.invocationId, databaseId: cleanedData.databaseId, - entityId: cleanedData.entityId, outputNode: cleanedData.outputNode, outputPort: cleanedData.outputPort, status: cleanedData.status, @@ -437,7 +425,6 @@ async function handleCreate(argv: Partial>, prompter: In graphId: true, invocationId: true, databaseId: true, - entityId: true, outputNode: true, outputPort: true, status: true, @@ -502,13 +489,6 @@ async function handleUpdate(argv: Partial>, prompter: In message: 'databaseId', required: false, }, - { - type: 'text', - name: 'entityId', - message: 'entityId', - required: false, - skipPrompt: true, - }, { type: 'text', name: 'outputNode', @@ -648,7 +628,6 @@ async function handleUpdate(argv: Partial>, prompter: In graphId: cleanedData.graphId, invocationId: cleanedData.invocationId, databaseId: cleanedData.databaseId, - entityId: cleanedData.entityId, outputNode: cleanedData.outputNode, outputPort: cleanedData.outputPort, status: cleanedData.status, @@ -674,7 +653,6 @@ async function handleUpdate(argv: Partial>, prompter: In graphId: true, invocationId: true, databaseId: true, - entityId: true, outputNode: true, outputPort: true, status: true, diff --git a/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts b/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts index 0586972990..0a5288cd3f 100644 --- a/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts +++ b/sdk/constructive-cli/src/compute/cli/commands/function-graph.ts @@ -19,7 +19,6 @@ const fieldSchema: FieldSchema = { id: 'uuid', databaseId: 'uuid', storeId: 'uuid', - entityId: 'uuid', context: 'string', name: 'string', description: 'string', @@ -84,7 +83,6 @@ async function handleList(argv: Partial>, _prompter: Inq id: true, databaseId: true, storeId: true, - entityId: true, context: true, name: true, description: true, @@ -117,7 +115,6 @@ async function handleFindFirst(argv: Partial>, _prompter id: true, databaseId: true, storeId: true, - entityId: true, context: true, name: true, description: true, @@ -162,7 +159,6 @@ async function handleGet(argv: Partial>, prompter: Inqui id: true, databaseId: true, storeId: true, - entityId: true, context: true, name: true, description: true, @@ -199,12 +195,6 @@ async function handleCreate(argv: Partial>, prompter: In message: 'storeId', required: true, }, - { - type: 'text', - name: 'entityId', - message: 'entityId', - required: true, - }, { type: 'text', name: 'context', @@ -259,7 +249,6 @@ async function handleCreate(argv: Partial>, prompter: In data: { databaseId: cleanedData.databaseId, storeId: cleanedData.storeId, - entityId: cleanedData.entityId, context: cleanedData.context, name: cleanedData.name, description: cleanedData.description, @@ -272,7 +261,6 @@ async function handleCreate(argv: Partial>, prompter: In id: true, databaseId: true, storeId: true, - entityId: true, context: true, name: true, description: true, @@ -315,12 +303,6 @@ async function handleUpdate(argv: Partial>, prompter: In message: 'storeId', required: false, }, - { - type: 'text', - name: 'entityId', - message: 'entityId', - required: false, - }, { type: 'text', name: 'context', @@ -375,7 +357,6 @@ async function handleUpdate(argv: Partial>, prompter: In data: { databaseId: cleanedData.databaseId, storeId: cleanedData.storeId, - entityId: cleanedData.entityId, context: cleanedData.context, name: cleanedData.name, description: cleanedData.description, @@ -388,7 +369,6 @@ async function handleUpdate(argv: Partial>, prompter: In id: true, databaseId: true, storeId: true, - entityId: true, context: true, name: true, description: true, diff --git a/sdk/constructive-cli/src/compute/orm/README.md b/sdk/constructive-cli/src/compute/orm/README.md index c266bdfcb7..37af8ed014 100644 --- a/sdk/constructive-cli/src/compute/orm/README.md +++ b/sdk/constructive-cli/src/compute/orm/README.md @@ -33,8 +33,8 @@ const db = createClient({ | `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 | +| `functionGraphExecutionNodeState` | findMany, findOne, create, update, delete | | `orgFunctionInvocation` | findMany, findOne, create, update, delete | | `functionInvocation` | findMany, findOne, create, update, delete | | `functionGraphExecution` | findMany, findOne, create, update, delete | @@ -470,85 +470,84 @@ const updated = await db.functionExecutionLog.update({ where: { id: '' }, const deleted = await db.functionExecutionLog.delete({ where: { id: '' } }).execute(); ``` -### `db.functionGraphExecutionNodeState` +### `db.functionGraph` -CRUD operations for FunctionGraphExecutionNodeState records. +CRUD operations for FunctionGraph 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 | +| `storeId` | 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 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(); +// List all functionGraph records +const items = await db.functionGraph.findMany({ select: { id: true, databaseId: true, storeId: 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.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(); +const item = await db.functionGraph.findOne({ id: '', select: { id: true, databaseId: true, storeId: 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.functionGraphExecutionNodeState.create({ data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, select: { id: true } }).execute(); +const created = await db.functionGraph.create({ data: { databaseId: '', storeId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); // Update -const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); +const updated = await db.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); +const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); ``` -### `db.functionGraph` +### `db.functionGraphExecutionNodeState` -CRUD operations for FunctionGraph records. +CRUD operations for FunctionGraphExecutionNodeState records. **Fields:** | Field | Type | Editable | |-------|------|----------| +| `createdAt` | Datetime | No | | `id` | UUID | No | +| `executionId` | UUID | Yes | | `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 | +| `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 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(); +// 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.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(); +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.functionGraph.create({ data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); +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.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); +const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); ``` ### `db.orgFunctionInvocation` @@ -649,7 +648,6 @@ CRUD operations for FunctionGraphExecution records. | `graphId` | UUID | Yes | | `invocationId` | UUID | Yes | | `databaseId` | UUID | Yes | -| `entityId` | UUID | Yes | | `outputNode` | String | Yes | | `outputPort` | String | Yes | | `status` | String | Yes | @@ -673,13 +671,13 @@ CRUD operations for FunctionGraphExecution records. ```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(); +const items = await db.functionGraphExecution.findMany({ select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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(); +const item = await db.functionGraphExecution.findOne({ id: '', select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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(); +const created = await db.functionGraphExecution.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', 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(); @@ -882,49 +880,49 @@ addNodeAndSave const result = await db.mutation.addNodeAndSave({ input: '' }).execute(); ``` -### `db.mutation.addEdge` +### `db.mutation.importGraphJson` -addEdge +importGraphJson - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddEdgeInput (required) | + | `input` | ImportGraphJsonInput (required) | ```typescript -const result = await db.mutation.addEdge({ input: '' }).execute(); +const result = await db.mutation.importGraphJson({ input: '' }).execute(); ``` -### `db.mutation.addNode` +### `db.mutation.addEdge` -addNode +addEdge - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddNodeInput (required) | + | `input` | AddEdgeInput (required) | ```typescript -const result = await db.mutation.addNode({ input: '' }).execute(); +const result = await db.mutation.addEdge({ input: '' }).execute(); ``` -### `db.mutation.importGraphJson` +### `db.mutation.addNode` -importGraphJson +addNode - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | ImportGraphJsonInput (required) | + | `input` | AddNodeInput (required) | ```typescript -const result = await db.mutation.importGraphJson({ input: '' }).execute(); +const result = await db.mutation.addNode({ input: '' }).execute(); ``` ### `db.mutation.insertNodeAtPath` diff --git a/sdk/constructive-cli/src/compute/orm/index.ts b/sdk/constructive-cli/src/compute/orm/index.ts index 99193c1d28..818e6503db 100644 --- a/sdk/constructive-cli/src/compute/orm/index.ts +++ b/sdk/constructive-cli/src/compute/orm/index.ts @@ -17,8 +17,8 @@ import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecuti 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 { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; import { OrgFunctionInvocationModel } from './models/orgFunctionInvocation'; import { FunctionInvocationModel } from './models/functionInvocation'; import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; @@ -70,8 +70,8 @@ export function createClient(config: OrmClientConfig) { functionGraphCommit: new FunctionGraphCommitModel(client), secretDefinition: new SecretDefinitionModel(client), functionExecutionLog: new FunctionExecutionLogModel(client), - functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), functionGraph: new FunctionGraphModel(client), + functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), orgFunctionInvocation: new OrgFunctionInvocationModel(client), functionInvocation: new FunctionInvocationModel(client), functionGraphExecution: new FunctionGraphExecutionModel(client), diff --git a/sdk/constructive-cli/src/compute/orm/input-types.ts b/sdk/constructive-cli/src/compute/orm/input-types.ts index f88c3e77d1..2426122692 100644 --- a/sdk/constructive-cli/src/compute/orm/input-types.ts +++ b/sdk/constructive-cli/src/compute/orm/input-types.ts @@ -444,33 +444,6 @@ export interface FunctionExecutionLog { /** 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 */ @@ -479,8 +452,6 @@ export interface FunctionGraph { 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) */ @@ -500,6 +471,33 @@ export interface FunctionGraph { /** Timestamp of last modification */ updatedAt?: 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; +} /** 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) */ @@ -576,8 +574,6 @@ export interface FunctionGraphExecution { 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) */ @@ -702,8 +698,8 @@ export interface FunctionGraphExecutionOutputRelations {} export interface FunctionGraphCommitRelations {} export interface SecretDefinitionRelations {} export interface FunctionExecutionLogRelations {} -export interface FunctionGraphExecutionNodeStateRelations {} export interface FunctionGraphRelations {} +export interface FunctionGraphExecutionNodeStateRelations {} export interface OrgFunctionInvocationRelations {} export interface FunctionInvocationRelations {} export interface FunctionGraphExecutionRelations { @@ -730,9 +726,9 @@ export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGra export type SecretDefinitionWithRelations = SecretDefinition & SecretDefinitionRelations; export type FunctionExecutionLogWithRelations = FunctionExecutionLog & FunctionExecutionLogRelations; +export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & FunctionGraphExecutionNodeStateRelations; -export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; export type OrgFunctionInvocationWithRelations = OrgFunctionInvocation & OrgFunctionInvocationRelations; export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; @@ -862,25 +858,10 @@ export type FunctionExecutionLogSelect = { 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; @@ -891,6 +872,20 @@ export type FunctionGraphSelect = { createdAt?: boolean; updatedAt?: 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 OrgFunctionInvocationSelect = { createdAt?: boolean; id?: boolean; @@ -930,7 +925,6 @@ export type FunctionGraphExecutionSelect = { graphId?: boolean; invocationId?: boolean; databaseId?: boolean; - entityId?: boolean; outputNode?: boolean; outputPort?: boolean; status?: boolean; @@ -1276,38 +1270,6 @@ export interface 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; @@ -1315,8 +1277,6 @@ export interface FunctionGraphFilter { 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. */ @@ -1342,6 +1302,38 @@ export interface FunctionGraphFilter { /** Negates the expression. */ not?: FunctionGraphFilter; } +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 OrgFunctionInvocationFilter { /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; @@ -1427,8 +1419,6 @@ export interface FunctionGraphExecutionFilter { 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. */ @@ -1777,34 +1767,6 @@ export type FunctionExecutionLogOrderBy = | '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' @@ -1815,8 +1777,6 @@ export type FunctionGraphOrderBy = | 'DATABASE_ID_DESC' | 'STORE_ID_ASC' | 'STORE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'CONTEXT_ASC' | 'CONTEXT_DESC' | 'NAME_ASC' @@ -1835,6 +1795,34 @@ export type FunctionGraphOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_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 OrgFunctionInvocationOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -1915,8 +1903,6 @@ export type FunctionGraphExecutionOrderBy = | 'INVOCATION_ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'OUTPUT_NODE_ASC' | 'OUTPUT_NODE_DESC' | 'OUTPUT_PORT_ASC' @@ -2350,6 +2336,40 @@ export interface DeleteFunctionExecutionLogInput { clientMutationId?: string; id: string; } +export interface CreateFunctionGraphInput { + clientMutationId?: string; + functionGraph: { + databaseId: string; + storeId: string; + context?: string; + name?: string; + description?: string; + definitionsCommitId: string; + isValid?: boolean; + validationErrors?: Record; + createdBy?: string; + }; +} +export interface FunctionGraphPatch { + databaseId?: string | null; + storeId?: 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 CreateFunctionGraphExecutionNodeStateInput { clientMutationId?: string; functionGraphExecutionNodeState: { @@ -2386,42 +2406,6 @@ 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: { @@ -2511,7 +2495,6 @@ export interface CreateFunctionGraphExecutionInput { graphId: string; invocationId?: string; databaseId: string; - entityId?: string; outputNode: string; outputPort?: string; status?: string; @@ -2537,7 +2520,6 @@ export interface FunctionGraphExecutionPatch { graphId?: string | null; invocationId?: string | null; databaseId?: string | null; - entityId?: string | null; outputNode?: string | null; outputPort?: string | null; status?: string | null; @@ -2695,6 +2677,16 @@ export interface AddNodeAndSaveInput { meta?: Record; message?: string; } +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: Record; + context?: string; + description?: string; + createdBy?: string; + definitionsCommitId?: string; +} export interface AddEdgeInput { clientMutationId?: string; databaseId?: string; @@ -2717,17 +2709,6 @@ export interface AddNodeInput { 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; @@ -3102,8 +3083,6 @@ export interface FunctionGraphExecutionInput { 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) */ @@ -3680,27 +3659,27 @@ export type AddNodeAndSavePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface AddEdgePayload { +export interface ImportGraphJsonPayload { clientMutationId?: string | null; result?: string | null; } -export type AddEdgePayloadSelect = { +export type ImportGraphJsonPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface AddNodePayload { +export interface AddEdgePayload { clientMutationId?: string | null; result?: string | null; } -export type AddNodePayloadSelect = { +export type AddEdgePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface ImportGraphJsonPayload { +export interface AddNodePayload { clientMutationId?: string | null; result?: string | null; } -export type ImportGraphJsonPayloadSelect = { +export type AddNodePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; @@ -4237,6 +4216,44 @@ export type DeleteFunctionExecutionLogPayloadSelect = { select: FunctionExecutionLogEdgeSelect; }; }; +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 CreateFunctionGraphExecutionNodeStatePayload { clientMutationId?: string | null; /** The `FunctionGraphExecutionNodeState` that was created by this mutation. */ @@ -4282,44 +4299,6 @@ export type DeleteFunctionGraphExecutionNodeStatePayloadSelect = { 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. */ @@ -4632,18 +4611,6 @@ export type FunctionExecutionLogEdgeSelect = { 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; @@ -4656,6 +4623,18 @@ export type FunctionGraphEdgeSelect = { select: FunctionGraphSelect; }; }; +/** 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 `OrgFunctionInvocation` edge in the connection. */ export interface OrgFunctionInvocationEdge { cursor?: string | null; diff --git a/sdk/constructive-cli/src/compute/orm/models/index.ts b/sdk/constructive-cli/src/compute/orm/models/index.ts index 51e9b9f05d..2d012df7c9 100644 --- a/sdk/constructive-cli/src/compute/orm/models/index.ts +++ b/sdk/constructive-cli/src/compute/orm/models/index.ts @@ -15,8 +15,8 @@ export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutpu export { FunctionGraphCommitModel } from './functionGraphCommit'; export { SecretDefinitionModel } from './secretDefinition'; export { FunctionExecutionLogModel } from './functionExecutionLog'; -export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; export { FunctionGraphModel } from './functionGraph'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; export { OrgFunctionInvocationModel } from './orgFunctionInvocation'; export { FunctionInvocationModel } from './functionInvocation'; export { FunctionGraphExecutionModel } from './functionGraphExecution'; diff --git a/sdk/constructive-cli/src/compute/orm/mutation/index.ts b/sdk/constructive-cli/src/compute/orm/mutation/index.ts index b4abf9132b..932f75c399 100644 --- a/sdk/constructive-cli/src/compute/orm/mutation/index.ts +++ b/sdk/constructive-cli/src/compute/orm/mutation/index.ts @@ -15,9 +15,9 @@ import type { SaveGraphInput, AddEdgeAndSaveInput, AddNodeAndSaveInput, + ImportGraphJsonInput, AddEdgeInput, AddNodeInput, - ImportGraphJsonInput, InsertNodeAtPathInput, StartExecutionInput, ProvisionBucketInput, @@ -29,9 +29,9 @@ import type { SaveGraphPayload, AddEdgeAndSavePayload, AddNodeAndSavePayload, + ImportGraphJsonPayload, AddEdgePayload, AddNodePayload, - ImportGraphJsonPayload, InsertNodeAtPathPayload, StartExecutionPayload, ProvisionBucketPayload, @@ -43,9 +43,9 @@ import type { SaveGraphPayloadSelect, AddEdgeAndSavePayloadSelect, AddNodeAndSavePayloadSelect, + ImportGraphJsonPayloadSelect, AddEdgePayloadSelect, AddNodePayloadSelect, - ImportGraphJsonPayloadSelect, InsertNodeAtPathPayloadSelect, StartExecutionPayloadSelect, ProvisionBucketPayloadSelect, @@ -75,15 +75,15 @@ export interface AddEdgeAndSaveVariables { export interface AddNodeAndSaveVariables { input: AddNodeAndSaveInput; } +export interface ImportGraphJsonVariables { + input: ImportGraphJsonInput; +} export interface AddEdgeVariables { input: AddEdgeInput; } export interface AddNodeVariables { input: AddNodeInput; } -export interface ImportGraphJsonVariables { - input: ImportGraphJsonInput; -} export interface InsertNodeAtPathVariables { input: InsertNodeAtPathInput; } @@ -334,6 +334,35 @@ export function createMutationOperations(client: OrmClient) { 'AddNodeAndSavePayload' ), }), + 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' + ), + }), addEdge: ( args: AddEdgeVariables, options: { @@ -392,35 +421,6 @@ export function createMutationOperations(client: OrmClient) { '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: { diff --git a/sdk/constructive-cli/src/modules/README.md b/sdk/constructive-cli/src/modules/README.md index 872d49ea3b..425d766011 100644 --- a/sdk/constructive-cli/src/modules/README.md +++ b/sdk/constructive-cli/src/modules/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 59 +- **Tables:** 60 - **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 b17d8d3df6..8c9e26981e 100644 --- a/sdk/constructive-cli/src/modules/cli/README.md +++ b/sdk/constructive-cli/src/modules/cli/README.md @@ -52,16 +52,17 @@ csdk auth set-token | `crypto-auth-module` | cryptoAuthModule CRUD operations | | `sessions-module` | sessionsModule CRUD operations | | `secure-table-provision` | secureTableProvision CRUD operations | -| `merkle-store-module` | merkleStoreModule CRUD operations | -| `graph-module` | graphModule CRUD operations | | `database-provision-module` | databaseProvisionModule CRUD operations | | `config-secrets-module` | configSecretsModule CRUD operations | +| `graph-module` | graphModule CRUD operations | +| `merkle-store-module` | merkleStoreModule CRUD operations | | `rate-limit-meters-module` | rateLimitMetersModule CRUD operations | | `realtime-module` | realtimeModule CRUD operations | | `webauthn-auth-module` | webauthnAuthModule CRUD operations | | `function-invocation-module` | functionInvocationModule CRUD operations | | `function-module` | functionModule CRUD operations | | `invites-module` | invitesModule CRUD operations | +| `principal-auth-module` | principalAuthModule CRUD operations | | `compute-log-module` | computeLogModule CRUD operations | | `inference-log-module` | inferenceLogModule CRUD operations | | `namespace-module` | namespaceModule CRUD operations | @@ -929,18 +930,53 @@ CRUD operations for SecureTableProvision records. **Required create fields:** `databaseId` **Optional create fields (backend defaults):** `schemaId`, `tableId`, `tableName`, `nodes`, `useRls`, `fields`, `grants`, `policies`, `outFields` -### `merkle-store-module` +### `database-provision-module` -CRUD operations for MerkleStoreModule records. +CRUD operations for DatabaseProvisionModule records. | Subcommand | Description | |------------|-------------| -| `list` | List all merkleStoreModule records | -| `find-first` | Find first matching merkleStoreModule record | -| `get` | Get a merkleStoreModule by id | -| `create` | Create a new merkleStoreModule | -| `update` | Update an existing merkleStoreModule | -| `delete` | Delete a merkleStoreModule | +| `list` | List all databaseProvisionModule records | +| `find-first` | Find first matching databaseProvisionModule record | +| `get` | Get a databaseProvisionModule by id | +| `create` | Create a new databaseProvisionModule | +| `update` | Update an existing databaseProvisionModule | +| `delete` | Delete a databaseProvisionModule | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseName` | String | +| `ownerId` | UUID | +| `subdomain` | String | +| `domain` | String | +| `modules` | JSON | +| `options` | JSON | +| `bootstrapUser` | Boolean | +| `status` | String | +| `errorMessage` | String | +| `databaseId` | UUID | +| `createdAt` | Datetime | +| `updatedAt` | Datetime | +| `completedAt` | Datetime | + +**Required create fields:** `databaseName`, `ownerId`, `domain` +**Optional create fields (backend defaults):** `subdomain`, `modules`, `options`, `bootstrapUser`, `status`, `errorMessage`, `databaseId`, `completedAt` + +### `config-secrets-module` + +CRUD operations for ConfigSecretsModule records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all configSecretsModule records | +| `find-first` | Find first matching configSecretsModule record | +| `get` | Get a configSecretsModule by id | +| `create` | Create a new configSecretsModule | +| `update` | Update an existing configSecretsModule | +| `delete` | Delete a configSecretsModule | **Fields:** @@ -952,19 +988,20 @@ CRUD operations for MerkleStoreModule records. | `privateSchemaId` | UUID | | `publicSchemaName` | String | | `privateSchemaName` | String | -| `objectTableId` | UUID | -| `storeTableId` | UUID | -| `commitTableId` | UUID | -| `refTableId` | UUID | -| `prefix` | String | +| `tableId` | UUID | +| `configDefinitionsTableId` | UUID | +| `tableName` | String | | `apiName` | String | | `privateApiName` | String | | `scope` | String | -| `functionPrefix` | String | -| `createdAt` | Datetime | +| `prefix` | String | +| `entityTableId` | UUID | +| `policies` | JSON | +| `provisions` | JSON | +| `hasConfig` | Boolean | **Required create fields:** `databaseId` -**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `objectTableId`, `storeTableId`, `commitTableId`, `refTableId`, `prefix`, `apiName`, `privateApiName`, `scope`, `functionPrefix` +**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `tableId`, `configDefinitionsTableId`, `tableName`, `apiName`, `privateApiName`, `scope`, `prefix`, `entityTableId`, `policies`, `provisions`, `hasConfig` ### `graph-module` @@ -1004,53 +1041,18 @@ CRUD operations for GraphModule records. **Required create fields:** `databaseId`, `merkleStoreModuleId` **Optional create fields (backend defaults):** `publicSchemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `scope`, `prefix`, `graphsTableId`, `apiName`, `privateApiName`, `entityTableId`, `policies`, `provisions`, `defaultPermissions` -### `database-provision-module` - -CRUD operations for DatabaseProvisionModule records. - -| Subcommand | Description | -|------------|-------------| -| `list` | List all databaseProvisionModule records | -| `find-first` | Find first matching databaseProvisionModule record | -| `get` | Get a databaseProvisionModule by id | -| `create` | Create a new databaseProvisionModule | -| `update` | Update an existing databaseProvisionModule | -| `delete` | Delete a databaseProvisionModule | - -**Fields:** - -| Field | Type | -|-------|------| -| `id` | UUID | -| `databaseName` | String | -| `ownerId` | UUID | -| `subdomain` | String | -| `domain` | String | -| `modules` | JSON | -| `options` | JSON | -| `bootstrapUser` | Boolean | -| `status` | String | -| `errorMessage` | String | -| `databaseId` | UUID | -| `createdAt` | Datetime | -| `updatedAt` | Datetime | -| `completedAt` | Datetime | - -**Required create fields:** `databaseName`, `ownerId`, `domain` -**Optional create fields (backend defaults):** `subdomain`, `modules`, `options`, `bootstrapUser`, `status`, `errorMessage`, `databaseId`, `completedAt` - -### `config-secrets-module` +### `merkle-store-module` -CRUD operations for ConfigSecretsModule records. +CRUD operations for MerkleStoreModule records. | Subcommand | Description | |------------|-------------| -| `list` | List all configSecretsModule records | -| `find-first` | Find first matching configSecretsModule record | -| `get` | Get a configSecretsModule by id | -| `create` | Create a new configSecretsModule | -| `update` | Update an existing configSecretsModule | -| `delete` | Delete a configSecretsModule | +| `list` | List all merkleStoreModule records | +| `find-first` | Find first matching merkleStoreModule record | +| `get` | Get a merkleStoreModule by id | +| `create` | Create a new merkleStoreModule | +| `update` | Update an existing merkleStoreModule | +| `delete` | Delete a merkleStoreModule | **Fields:** @@ -1062,20 +1064,20 @@ CRUD operations for ConfigSecretsModule records. | `privateSchemaId` | UUID | | `publicSchemaName` | String | | `privateSchemaName` | String | -| `tableId` | UUID | -| `configDefinitionsTableId` | UUID | -| `tableName` | String | +| `objectTableId` | UUID | +| `storeTableId` | UUID | +| `commitTableId` | UUID | +| `refTableId` | UUID | +| `prefix` | String | | `apiName` | String | | `privateApiName` | String | | `scope` | String | -| `prefix` | String | -| `entityTableId` | UUID | -| `policies` | JSON | -| `provisions` | JSON | -| `hasConfig` | Boolean | +| `functionPrefix` | String | +| `permissionKey` | String | +| `createdAt` | Datetime | **Required create fields:** `databaseId` -**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `tableId`, `configDefinitionsTableId`, `tableName`, `apiName`, `privateApiName`, `scope`, `prefix`, `entityTableId`, `policies`, `provisions`, `hasConfig` +**Optional create fields (backend defaults):** `schemaId`, `privateSchemaId`, `publicSchemaName`, `privateSchemaName`, `objectTableId`, `storeTableId`, `commitTableId`, `refTableId`, `prefix`, `apiName`, `privateApiName`, `scope`, `functionPrefix`, `permissionKey` ### `rate-limit-meters-module` @@ -1304,6 +1306,45 @@ 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` +### `principal-auth-module` + +CRUD operations for PrincipalAuthModule records. + +| Subcommand | Description | +|------------|-------------| +| `list` | List all principalAuthModule records | +| `find-first` | Find first matching principalAuthModule record | +| `get` | Get a principalAuthModule by id | +| `create` | Create a new principalAuthModule | +| `update` | Update an existing principalAuthModule | +| `delete` | Delete a principalAuthModule | + +**Fields:** + +| Field | Type | +|-------|------| +| `id` | UUID | +| `databaseId` | UUID | +| `schemaId` | UUID | +| `principalsTableId` | UUID | +| `principalEntitiesTableId` | UUID | +| `principalScopeOverridesTableId` | UUID | +| `usersTableId` | UUID | +| `sessionsTableId` | UUID | +| `sessionCredentialsTableId` | UUID | +| `auditsTableId` | UUID | +| `principalsTableName` | String | +| `createPrincipalFunction` | String | +| `deletePrincipalFunction` | String | +| `createOrgPrincipalFunction` | String | +| `deleteOrgPrincipalFunction` | String | +| `createOrgApiKeyFunction` | String | +| `revokeOrgApiKeyFunction` | String | +| `apiName` | String | + +**Required create fields:** `databaseId` +**Optional create fields (backend defaults):** `schemaId`, `principalsTableId`, `principalEntitiesTableId`, `principalScopeOverridesTableId`, `usersTableId`, `sessionsTableId`, `sessionCredentialsTableId`, `auditsTableId`, `principalsTableName`, `createPrincipalFunction`, `deletePrincipalFunction`, `createOrgPrincipalFunction`, `deleteOrgPrincipalFunction`, `createOrgApiKeyFunction`, `revokeOrgApiKeyFunction`, `apiName` + ### `compute-log-module` CRUD operations for ComputeLogModule records. diff --git a/sdk/constructive-cli/src/modules/cli/commands.ts b/sdk/constructive-cli/src/modules/cli/commands.ts index 944d3a8518..39fccaf3fc 100644 --- a/sdk/constructive-cli/src/modules/cli/commands.ts +++ b/sdk/constructive-cli/src/modules/cli/commands.ts @@ -32,16 +32,17 @@ import blueprintConstructionCmd from './commands/blueprint-construction'; import cryptoAuthModuleCmd from './commands/crypto-auth-module'; import sessionsModuleCmd from './commands/sessions-module'; import secureTableProvisionCmd from './commands/secure-table-provision'; -import merkleStoreModuleCmd from './commands/merkle-store-module'; -import graphModuleCmd from './commands/graph-module'; import databaseProvisionModuleCmd from './commands/database-provision-module'; import configSecretsModuleCmd from './commands/config-secrets-module'; +import graphModuleCmd from './commands/graph-module'; +import merkleStoreModuleCmd from './commands/merkle-store-module'; import rateLimitMetersModuleCmd from './commands/rate-limit-meters-module'; import realtimeModuleCmd from './commands/realtime-module'; 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 principalAuthModuleCmd from './commands/principal-auth-module'; import computeLogModuleCmd from './commands/compute-log-module'; import inferenceLogModuleCmd from './commands/inference-log-module'; import namespaceModuleCmd from './commands/namespace-module'; @@ -113,16 +114,17 @@ const createCommandMap: () => Record< 'crypto-auth-module': cryptoAuthModuleCmd, 'sessions-module': sessionsModuleCmd, 'secure-table-provision': secureTableProvisionCmd, - 'merkle-store-module': merkleStoreModuleCmd, - 'graph-module': graphModuleCmd, 'database-provision-module': databaseProvisionModuleCmd, 'config-secrets-module': configSecretsModuleCmd, + 'graph-module': graphModuleCmd, + 'merkle-store-module': merkleStoreModuleCmd, 'rate-limit-meters-module': rateLimitMetersModuleCmd, 'realtime-module': realtimeModuleCmd, 'webauthn-auth-module': webauthnAuthModuleCmd, 'function-invocation-module': functionInvocationModuleCmd, 'function-module': functionModuleCmd, 'invites-module': invitesModuleCmd, + 'principal-auth-module': principalAuthModuleCmd, 'compute-log-module': computeLogModuleCmd, 'inference-log-module': inferenceLogModuleCmd, 'namespace-module': namespaceModuleCmd, @@ -160,7 +162,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 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"; + "\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 database-provision-module databaseProvisionModule CRUD operations\n config-secrets-module configSecretsModule CRUD operations\n graph-module graphModule CRUD operations\n merkle-store-module merkleStoreModule 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 principal-auth-module principalAuthModule 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/merkle-store-module.ts b/sdk/constructive-cli/src/modules/cli/commands/merkle-store-module.ts index 15c24c09ee..b7ce012a7e 100644 --- a/sdk/constructive-cli/src/modules/cli/commands/merkle-store-module.ts +++ b/sdk/constructive-cli/src/modules/cli/commands/merkle-store-module.ts @@ -31,6 +31,7 @@ const fieldSchema: FieldSchema = { privateApiName: 'string', scope: 'string', functionPrefix: 'string', + permissionKey: 'string', createdAt: 'string', }; const usage = @@ -99,6 +100,7 @@ async function handleList(argv: Partial>, _prompter: Inq privateApiName: true, scope: true, functionPrefix: true, + permissionKey: true, createdAt: true, }; const findManyArgs = parseFindManyArgs< @@ -135,6 +137,7 @@ async function handleFindFirst(argv: Partial>, _prompter privateApiName: true, scope: true, functionPrefix: true, + permissionKey: true, createdAt: true, }; const findFirstArgs = parseFindFirstArgs< @@ -183,6 +186,7 @@ async function handleGet(argv: Partial>, prompter: Inqui privateApiName: true, scope: true, functionPrefix: true, + permissionKey: true, createdAt: true, }, }) @@ -296,6 +300,13 @@ async function handleCreate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, + { + type: 'text', + name: 'permissionKey', + message: 'permissionKey', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined( @@ -320,6 +331,7 @@ async function handleCreate(argv: Partial>, prompter: In privateApiName: cleanedData.privateApiName, scope: cleanedData.scope, functionPrefix: cleanedData.functionPrefix, + permissionKey: cleanedData.permissionKey, }, select: { id: true, @@ -337,6 +349,7 @@ async function handleCreate(argv: Partial>, prompter: In privateApiName: true, scope: true, functionPrefix: true, + permissionKey: true, createdAt: true, }, }) @@ -456,6 +469,13 @@ async function handleUpdate(argv: Partial>, prompter: In required: false, skipPrompt: true, }, + { + type: 'text', + name: 'permissionKey', + message: 'permissionKey', + required: false, + skipPrompt: true, + }, ]); const answers = coerceAnswers(rawAnswers, fieldSchema); const cleanedData = stripUndefined(answers, fieldSchema) as MerkleStoreModulePatch; @@ -480,6 +500,7 @@ async function handleUpdate(argv: Partial>, prompter: In privateApiName: cleanedData.privateApiName, scope: cleanedData.scope, functionPrefix: cleanedData.functionPrefix, + permissionKey: cleanedData.permissionKey, }, select: { id: true, @@ -497,6 +518,7 @@ async function handleUpdate(argv: Partial>, prompter: In privateApiName: true, scope: true, functionPrefix: true, + permissionKey: true, createdAt: true, }, }) diff --git a/sdk/constructive-cli/src/modules/cli/commands/principal-auth-module.ts b/sdk/constructive-cli/src/modules/cli/commands/principal-auth-module.ts new file mode 100644 index 0000000000..df510cdb12 --- /dev/null +++ b/sdk/constructive-cli/src/modules/cli/commands/principal-auth-module.ts @@ -0,0 +1,611 @@ +/** + * CLI commands for PrincipalAuthModule + * @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 { + CreatePrincipalAuthModuleInput, + PrincipalAuthModulePatch, + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { FindManyArgs, FindFirstArgs } from '../../orm/select-types'; +const fieldSchema: FieldSchema = { + id: 'uuid', + databaseId: 'uuid', + schemaId: 'uuid', + principalsTableId: 'uuid', + principalEntitiesTableId: 'uuid', + principalScopeOverridesTableId: 'uuid', + usersTableId: 'uuid', + sessionsTableId: 'uuid', + sessionCredentialsTableId: 'uuid', + auditsTableId: 'uuid', + principalsTableName: 'string', + createPrincipalFunction: 'string', + deletePrincipalFunction: 'string', + createOrgPrincipalFunction: 'string', + deleteOrgPrincipalFunction: 'string', + createOrgApiKeyFunction: 'string', + revokeOrgApiKeyFunction: 'string', + apiName: 'string', +}; +const usage = + '\nprincipal-auth-module \n\nCommands:\n list List principalAuthModule records\n find-first Find first matching principalAuthModule record\n get Get a principalAuthModule by ID\n create Create a new principalAuthModule\n update Update an existing principalAuthModule\n delete Delete a principalAuthModule\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, + principalsTableId: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + usersTableId: true, + sessionsTableId: true, + sessionCredentialsTableId: true, + auditsTableId: true, + principalsTableName: true, + createPrincipalFunction: true, + deletePrincipalFunction: true, + createOrgPrincipalFunction: true, + deleteOrgPrincipalFunction: true, + createOrgApiKeyFunction: true, + revokeOrgApiKeyFunction: true, + apiName: true, + }; + const findManyArgs = parseFindManyArgs< + FindManyArgs< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + > & { + select: PrincipalAuthModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principalAuthModule.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, + principalsTableId: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + usersTableId: true, + sessionsTableId: true, + sessionCredentialsTableId: true, + auditsTableId: true, + principalsTableName: true, + createPrincipalFunction: true, + deletePrincipalFunction: true, + createOrgPrincipalFunction: true, + deleteOrgPrincipalFunction: true, + createOrgApiKeyFunction: true, + revokeOrgApiKeyFunction: true, + apiName: true, + }; + const findFirstArgs = parseFindFirstArgs< + FindFirstArgs< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + > & { + select: PrincipalAuthModuleSelect; + } + >(argv, defaultSelect); + const client = getClient(); + const result = await client.principalAuthModule.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.principalAuthModule + .findOne({ + id: answers.id as string, + select: { + id: true, + databaseId: true, + schemaId: true, + principalsTableId: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + usersTableId: true, + sessionsTableId: true, + sessionCredentialsTableId: true, + auditsTableId: true, + principalsTableName: true, + createPrincipalFunction: true, + deletePrincipalFunction: true, + createOrgPrincipalFunction: true, + deleteOrgPrincipalFunction: true, + createOrgApiKeyFunction: true, + revokeOrgApiKeyFunction: true, + apiName: 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: 'principalsTableId', + message: 'principalsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalEntitiesTableId', + message: 'principalEntitiesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalScopeOverridesTableId', + message: 'principalScopeOverridesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableId', + message: 'auditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalsTableName', + message: 'principalsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createPrincipalFunction', + message: 'createPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deletePrincipalFunction', + message: 'deletePrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgPrincipalFunction', + message: 'createOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deleteOrgPrincipalFunction', + message: 'deleteOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgApiKeyFunction', + message: 'createOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revokeOrgApiKeyFunction', + message: 'revokeOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined( + answers, + fieldSchema + ) as CreatePrincipalAuthModuleInput['principalAuthModule']; + const client = getClient(); + const result = await client.principalAuthModule + .create({ + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + principalsTableId: cleanedData.principalsTableId, + principalEntitiesTableId: cleanedData.principalEntitiesTableId, + principalScopeOverridesTableId: cleanedData.principalScopeOverridesTableId, + usersTableId: cleanedData.usersTableId, + sessionsTableId: cleanedData.sessionsTableId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + auditsTableId: cleanedData.auditsTableId, + principalsTableName: cleanedData.principalsTableName, + createPrincipalFunction: cleanedData.createPrincipalFunction, + deletePrincipalFunction: cleanedData.deletePrincipalFunction, + createOrgPrincipalFunction: cleanedData.createOrgPrincipalFunction, + deleteOrgPrincipalFunction: cleanedData.deleteOrgPrincipalFunction, + createOrgApiKeyFunction: cleanedData.createOrgApiKeyFunction, + revokeOrgApiKeyFunction: cleanedData.revokeOrgApiKeyFunction, + apiName: cleanedData.apiName, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + principalsTableId: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + usersTableId: true, + sessionsTableId: true, + sessionCredentialsTableId: true, + auditsTableId: true, + principalsTableName: true, + createPrincipalFunction: true, + deletePrincipalFunction: true, + createOrgPrincipalFunction: true, + deleteOrgPrincipalFunction: true, + createOrgApiKeyFunction: true, + revokeOrgApiKeyFunction: true, + apiName: 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: 'principalsTableId', + message: 'principalsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalEntitiesTableId', + message: 'principalEntitiesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalScopeOverridesTableId', + message: 'principalScopeOverridesTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'usersTableId', + message: 'usersTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionsTableId', + message: 'sessionsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'sessionCredentialsTableId', + message: 'sessionCredentialsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'auditsTableId', + message: 'auditsTableId', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'principalsTableName', + message: 'principalsTableName', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createPrincipalFunction', + message: 'createPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deletePrincipalFunction', + message: 'deletePrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgPrincipalFunction', + message: 'createOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'deleteOrgPrincipalFunction', + message: 'deleteOrgPrincipalFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'createOrgApiKeyFunction', + message: 'createOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'revokeOrgApiKeyFunction', + message: 'revokeOrgApiKeyFunction', + required: false, + skipPrompt: true, + }, + { + type: 'text', + name: 'apiName', + message: 'apiName', + required: false, + skipPrompt: true, + }, + ]); + const answers = coerceAnswers(rawAnswers, fieldSchema); + const cleanedData = stripUndefined(answers, fieldSchema) as PrincipalAuthModulePatch; + const client = getClient(); + const result = await client.principalAuthModule + .update({ + where: { + id: answers.id as string, + }, + data: { + databaseId: cleanedData.databaseId, + schemaId: cleanedData.schemaId, + principalsTableId: cleanedData.principalsTableId, + principalEntitiesTableId: cleanedData.principalEntitiesTableId, + principalScopeOverridesTableId: cleanedData.principalScopeOverridesTableId, + usersTableId: cleanedData.usersTableId, + sessionsTableId: cleanedData.sessionsTableId, + sessionCredentialsTableId: cleanedData.sessionCredentialsTableId, + auditsTableId: cleanedData.auditsTableId, + principalsTableName: cleanedData.principalsTableName, + createPrincipalFunction: cleanedData.createPrincipalFunction, + deletePrincipalFunction: cleanedData.deletePrincipalFunction, + createOrgPrincipalFunction: cleanedData.createOrgPrincipalFunction, + deleteOrgPrincipalFunction: cleanedData.deleteOrgPrincipalFunction, + createOrgApiKeyFunction: cleanedData.createOrgApiKeyFunction, + revokeOrgApiKeyFunction: cleanedData.revokeOrgApiKeyFunction, + apiName: cleanedData.apiName, + }, + select: { + id: true, + databaseId: true, + schemaId: true, + principalsTableId: true, + principalEntitiesTableId: true, + principalScopeOverridesTableId: true, + usersTableId: true, + sessionsTableId: true, + sessionCredentialsTableId: true, + auditsTableId: true, + principalsTableName: true, + createPrincipalFunction: true, + deletePrincipalFunction: true, + createOrgPrincipalFunction: true, + deleteOrgPrincipalFunction: true, + createOrgApiKeyFunction: true, + revokeOrgApiKeyFunction: true, + apiName: 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.principalAuthModule + .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/orm/README.md b/sdk/constructive-cli/src/modules/orm/README.md index 495d56755f..91f09623c3 100644 --- a/sdk/constructive-cli/src/modules/orm/README.md +++ b/sdk/constructive-cli/src/modules/orm/README.md @@ -47,16 +47,17 @@ const db = createClient({ | `cryptoAuthModule` | findMany, findOne, create, update, delete | | `sessionsModule` | findMany, findOne, create, update, delete | | `secureTableProvision` | findMany, findOne, create, update, delete | -| `merkleStoreModule` | findMany, findOne, create, update, delete | -| `graphModule` | findMany, findOne, create, update, delete | | `databaseProvisionModule` | findMany, findOne, create, update, delete | | `configSecretsModule` | findMany, findOne, create, update, delete | +| `graphModule` | findMany, findOne, create, update, delete | +| `merkleStoreModule` | findMany, findOne, create, update, delete | | `rateLimitMetersModule` | findMany, findOne, create, update, delete | | `realtimeModule` | findMany, findOne, create, update, delete | | `webauthnAuthModule` | findMany, findOne, create, update, delete | | `functionInvocationModule` | findMany, findOne, create, update, delete | | `functionModule` | findMany, findOne, create, update, delete | | `invitesModule` | findMany, findOne, create, update, delete | +| `principalAuthModule` | findMany, findOne, create, update, delete | | `computeLogModule` | findMany, findOne, create, update, delete | | `inferenceLogModule` | findMany, findOne, create, update, delete | | `namespaceModule` | findMany, findOne, create, update, delete | @@ -1053,53 +1054,51 @@ const updated = await db.secureTableProvision.update({ where: { id: '' }, const deleted = await db.secureTableProvision.delete({ where: { id: '' } }).execute(); ``` -### `db.merkleStoreModule` +### `db.databaseProvisionModule` -CRUD operations for MerkleStoreModule records. +CRUD operations for DatabaseProvisionModule records. **Fields:** | Field | Type | Editable | |-------|------|----------| | `id` | UUID | No | +| `databaseName` | String | Yes | +| `ownerId` | UUID | Yes | +| `subdomain` | String | Yes | +| `domain` | String | Yes | +| `modules` | JSON | Yes | +| `options` | JSON | Yes | +| `bootstrapUser` | Boolean | Yes | +| `status` | String | Yes | +| `errorMessage` | String | Yes | | `databaseId` | UUID | Yes | -| `schemaId` | UUID | Yes | -| `privateSchemaId` | UUID | Yes | -| `publicSchemaName` | String | Yes | -| `privateSchemaName` | String | Yes | -| `objectTableId` | UUID | Yes | -| `storeTableId` | UUID | Yes | -| `commitTableId` | UUID | Yes | -| `refTableId` | UUID | Yes | -| `prefix` | String | Yes | -| `apiName` | String | Yes | -| `privateApiName` | String | Yes | -| `scope` | String | Yes | -| `functionPrefix` | String | Yes | | `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `completedAt` | Datetime | Yes | **Operations:** ```typescript -// List all merkleStoreModule records -const items = await db.merkleStoreModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }).execute(); +// List all databaseProvisionModule records +const items = await db.databaseProvisionModule.findMany({ select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); // Get one by id -const item = await db.merkleStoreModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }).execute(); +const item = await db.databaseProvisionModule.findOne({ id: '', select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); // Create -const created = await db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '' }, select: { id: true } }).execute(); +const created = await db.databaseProvisionModule.create({ data: { databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }, select: { id: true } }).execute(); // Update -const updated = await db.merkleStoreModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.databaseProvisionModule.update({ where: { id: '' }, data: { databaseName: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.merkleStoreModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.databaseProvisionModule.delete({ where: { id: '' } }).execute(); ``` -### `db.graphModule` +### `db.configSecretsModule` -CRUD operations for GraphModule records. +CRUD operations for ConfigSecretsModule records. **Fields:** @@ -1107,86 +1106,89 @@ CRUD operations for GraphModule records. |-------|------|----------| | `id` | UUID | No | | `databaseId` | UUID | Yes | -| `publicSchemaId` | UUID | Yes | +| `schemaId` | UUID | Yes | | `privateSchemaId` | UUID | Yes | | `publicSchemaName` | String | Yes | | `privateSchemaName` | String | Yes | -| `scope` | String | Yes | -| `prefix` | String | Yes | -| `merkleStoreModuleId` | UUID | Yes | -| `graphsTableId` | UUID | Yes | +| `tableId` | UUID | Yes | +| `configDefinitionsTableId` | UUID | Yes | +| `tableName` | 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 | -| `createdAt` | Datetime | No | +| `hasConfig` | Boolean | Yes | **Operations:** ```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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +// List all configSecretsModule records +const items = await db.configSecretsModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: 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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const item = await db.configSecretsModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); // Create -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(); +const created = await db.configSecretsModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }, select: { id: true } }).execute(); // Update -const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.configSecretsModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.graphModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.configSecretsModule.delete({ where: { id: '' } }).execute(); ``` -### `db.databaseProvisionModule` +### `db.graphModule` -CRUD operations for DatabaseProvisionModule records. +CRUD operations for GraphModule records. **Fields:** | Field | Type | Editable | |-------|------|----------| | `id` | UUID | No | -| `databaseName` | String | Yes | -| `ownerId` | UUID | Yes | -| `subdomain` | String | Yes | -| `domain` | String | Yes | -| `modules` | JSON | Yes | -| `options` | JSON | Yes | -| `bootstrapUser` | Boolean | Yes | -| `status` | String | Yes | -| `errorMessage` | String | Yes | | `databaseId` | UUID | Yes | +| `publicSchemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `merkleStoreModuleId` | UUID | Yes | +| `graphsTableId` | UUID | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `entityTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | | `createdAt` | Datetime | No | -| `updatedAt` | Datetime | No | -| `completedAt` | Datetime | Yes | **Operations:** ```typescript -// List all databaseProvisionModule records -const items = await db.databaseProvisionModule.findMany({ select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); +// 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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Get one by id -const item = await db.databaseProvisionModule.findOne({ id: '', select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: 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.databaseProvisionModule.create({ data: { databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }, 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.databaseProvisionModule.update({ where: { id: '' }, data: { databaseName: '' }, select: { id: true } }).execute(); +const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.databaseProvisionModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.graphModule.delete({ where: { id: '' } }).execute(); ``` -### `db.configSecretsModule` +### `db.merkleStoreModule` -CRUD operations for ConfigSecretsModule records. +CRUD operations for MerkleStoreModule records. **Fields:** @@ -1198,35 +1200,35 @@ CRUD operations for ConfigSecretsModule records. | `privateSchemaId` | UUID | Yes | | `publicSchemaName` | String | Yes | | `privateSchemaName` | String | Yes | -| `tableId` | UUID | Yes | -| `configDefinitionsTableId` | UUID | Yes | -| `tableName` | String | Yes | +| `objectTableId` | UUID | Yes | +| `storeTableId` | UUID | Yes | +| `commitTableId` | UUID | Yes | +| `refTableId` | UUID | Yes | +| `prefix` | String | Yes | | `apiName` | String | Yes | | `privateApiName` | String | Yes | | `scope` | String | Yes | -| `prefix` | String | Yes | -| `entityTableId` | UUID | Yes | -| `policies` | JSON | Yes | -| `provisions` | JSON | Yes | -| `hasConfig` | Boolean | Yes | +| `functionPrefix` | String | Yes | +| `permissionKey` | String | Yes | +| `createdAt` | Datetime | No | **Operations:** ```typescript -// List all configSecretsModule records -const items = await db.configSecretsModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); +// List all merkleStoreModule records +const items = await db.merkleStoreModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }).execute(); // Get one by id -const item = await db.configSecretsModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); +const item = await db.merkleStoreModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }).execute(); // Create -const created = await db.configSecretsModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }, select: { id: true } }).execute(); +const created = await db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '', permissionKey: '' }, select: { id: true } }).execute(); // Update -const updated = await db.configSecretsModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.merkleStoreModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.configSecretsModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.merkleStoreModule.delete({ where: { id: '' } }).execute(); ``` ### `db.rateLimitMetersModule` @@ -1498,6 +1500,52 @@ const updated = await db.invitesModule.update({ where: { id: '' }, data: { const deleted = await db.invitesModule.delete({ where: { id: '' } }).execute(); ``` +### `db.principalAuthModule` + +CRUD operations for PrincipalAuthModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `principalsTableId` | UUID | Yes | +| `principalEntitiesTableId` | UUID | Yes | +| `principalScopeOverridesTableId` | UUID | Yes | +| `usersTableId` | UUID | Yes | +| `sessionsTableId` | UUID | Yes | +| `sessionCredentialsTableId` | UUID | Yes | +| `auditsTableId` | UUID | Yes | +| `principalsTableName` | String | Yes | +| `createPrincipalFunction` | String | Yes | +| `deletePrincipalFunction` | String | Yes | +| `createOrgPrincipalFunction` | String | Yes | +| `deleteOrgPrincipalFunction` | String | Yes | +| `createOrgApiKeyFunction` | String | Yes | +| `revokeOrgApiKeyFunction` | String | Yes | +| `apiName` | String | Yes | + +**Operations:** + +```typescript +// List all principalAuthModule records +const items = await db.principalAuthModule.findMany({ select: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }).execute(); + +// Get one by id +const item = await db.principalAuthModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }).execute(); + +// Create +const created = await db.principalAuthModule.create({ data: { databaseId: '', schemaId: '', principalsTableId: '', principalEntitiesTableId: '', principalScopeOverridesTableId: '', usersTableId: '', sessionsTableId: '', sessionCredentialsTableId: '', auditsTableId: '', principalsTableName: '', createPrincipalFunction: '', deletePrincipalFunction: '', createOrgPrincipalFunction: '', deleteOrgPrincipalFunction: '', createOrgApiKeyFunction: '', revokeOrgApiKeyFunction: '', apiName: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalAuthModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalAuthModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.computeLogModule` CRUD operations for ComputeLogModule records. diff --git a/sdk/constructive-cli/src/modules/orm/index.ts b/sdk/constructive-cli/src/modules/orm/index.ts index 7c5a882c52..592de14627 100644 --- a/sdk/constructive-cli/src/modules/orm/index.ts +++ b/sdk/constructive-cli/src/modules/orm/index.ts @@ -31,16 +31,17 @@ import { BlueprintConstructionModel } from './models/blueprintConstruction'; import { CryptoAuthModuleModel } from './models/cryptoAuthModule'; import { SessionsModuleModel } from './models/sessionsModule'; import { SecureTableProvisionModel } from './models/secureTableProvision'; -import { MerkleStoreModuleModel } from './models/merkleStoreModule'; -import { GraphModuleModel } from './models/graphModule'; import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule'; import { ConfigSecretsModuleModel } from './models/configSecretsModule'; +import { GraphModuleModel } from './models/graphModule'; +import { MerkleStoreModuleModel } from './models/merkleStoreModule'; import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule'; import { RealtimeModuleModel } from './models/realtimeModule'; import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; import { FunctionModuleModel } from './models/functionModule'; import { InvitesModuleModel } from './models/invitesModule'; +import { PrincipalAuthModuleModel } from './models/principalAuthModule'; import { ComputeLogModuleModel } from './models/computeLogModule'; import { InferenceLogModuleModel } from './models/inferenceLogModule'; import { NamespaceModuleModel } from './models/namespaceModule'; @@ -125,16 +126,17 @@ export function createClient(config: OrmClientConfig) { cryptoAuthModule: new CryptoAuthModuleModel(client), sessionsModule: new SessionsModuleModel(client), secureTableProvision: new SecureTableProvisionModel(client), - merkleStoreModule: new MerkleStoreModuleModel(client), - graphModule: new GraphModuleModel(client), databaseProvisionModule: new DatabaseProvisionModuleModel(client), configSecretsModule: new ConfigSecretsModuleModel(client), + graphModule: new GraphModuleModel(client), + merkleStoreModule: new MerkleStoreModuleModel(client), rateLimitMetersModule: new RateLimitMetersModuleModel(client), realtimeModule: new RealtimeModuleModel(client), webauthnAuthModule: new WebauthnAuthModuleModel(client), functionInvocationModule: new FunctionInvocationModuleModel(client), functionModule: new FunctionModuleModel(client), invitesModule: new InvitesModuleModel(client), + principalAuthModule: new PrincipalAuthModuleModel(client), computeLogModule: new ComputeLogModuleModel(client), inferenceLogModule: new InferenceLogModuleModel(client), namespaceModule: new NamespaceModuleModel(client), diff --git a/sdk/constructive-cli/src/modules/orm/input-types.ts b/sdk/constructive-cli/src/modules/orm/input-types.ts index ddd8bf6a34..4d52180d99 100644 --- a/sdk/constructive-cli/src/modules/orm/input-types.ts +++ b/sdk/constructive-cli/src/modules/orm/input-types.ts @@ -606,43 +606,6 @@ export interface SecureTableProvision { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[] | null; } -export interface MerkleStoreModule { - id: string; - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - objectTableId?: string | null; - storeTableId?: string | null; - commitTableId?: string | null; - refTableId?: string | null; - prefix?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - functionPrefix?: string | null; - createdAt?: string | null; -} -export interface GraphModule { - id: string; - databaseId?: string | null; - publicSchemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - scope?: string | null; - prefix?: string | null; - merkleStoreModuleId?: string | null; - graphsTableId?: string | null; - apiName?: string | null; - privateApiName?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; - createdAt?: string | null; -} /** Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. */ export interface DatabaseProvisionModule { id: string; @@ -693,6 +656,44 @@ export interface ConfigSecretsModule { provisions?: Record | null; hasConfig?: boolean | null; } +export interface GraphModule { + id: string; + databaseId?: string | null; + publicSchemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + scope?: string | null; + prefix?: string | null; + merkleStoreModuleId?: string | null; + graphsTableId?: 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 MerkleStoreModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + objectTableId?: string | null; + storeTableId?: string | null; + commitTableId?: string | null; + refTableId?: string | null; + prefix?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + functionPrefix?: string | null; + permissionKey?: string | null; + createdAt?: string | null; +} export interface RateLimitMetersModule { id: string; databaseId?: string | null; @@ -806,6 +807,27 @@ export interface InvitesModule { apiName?: string | null; privateApiName?: string | null; } +/** Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. */ +export interface PrincipalAuthModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + principalsTableId?: string | null; + principalEntitiesTableId?: string | null; + principalScopeOverridesTableId?: string | null; + usersTableId?: string | null; + sessionsTableId?: string | null; + sessionCredentialsTableId?: string | null; + auditsTableId?: string | null; + principalsTableName?: string | null; + createPrincipalFunction?: string | null; + deletePrincipalFunction?: string | null; + createOrgPrincipalFunction?: string | null; + deleteOrgPrincipalFunction?: string | null; + createOrgApiKeyFunction?: string | null; + revokeOrgApiKeyFunction?: string | null; + apiName?: string | null; +} export interface ComputeLogModule { id: string; databaseId?: string | null; @@ -1831,20 +1853,21 @@ export interface BlueprintConstructionRelations { export interface CryptoAuthModuleRelations {} export interface SessionsModuleRelations {} export interface SecureTableProvisionRelations {} -export interface MerkleStoreModuleRelations { - graphModules?: ConnectionResult; -} +export interface DatabaseProvisionModuleRelations {} +export interface ConfigSecretsModuleRelations {} export interface GraphModuleRelations { merkleStoreModule?: MerkleStoreModule | null; } -export interface DatabaseProvisionModuleRelations {} -export interface ConfigSecretsModuleRelations {} +export interface MerkleStoreModuleRelations { + graphModules?: ConnectionResult; +} export interface RateLimitMetersModuleRelations {} export interface RealtimeModuleRelations {} export interface WebauthnAuthModuleRelations {} export interface FunctionInvocationModuleRelations {} export interface FunctionModuleRelations {} export interface InvitesModuleRelations {} +export interface PrincipalAuthModuleRelations {} export interface ComputeLogModuleRelations {} export interface InferenceLogModuleRelations {} export interface NamespaceModuleRelations {} @@ -1912,11 +1935,11 @@ export type CryptoAuthModuleWithRelations = CryptoAuthModule & CryptoAuthModuleR export type SessionsModuleWithRelations = SessionsModule & SessionsModuleRelations; export type SecureTableProvisionWithRelations = SecureTableProvision & SecureTableProvisionRelations; -export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; -export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & DatabaseProvisionModuleRelations; export type ConfigSecretsModuleWithRelations = ConfigSecretsModule & ConfigSecretsModuleRelations; +export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; +export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & RateLimitMetersModuleRelations; export type RealtimeModuleWithRelations = RealtimeModule & RealtimeModuleRelations; @@ -1925,6 +1948,7 @@ export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; +export type PrincipalAuthModuleWithRelations = PrincipalAuthModule & PrincipalAuthModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; @@ -2273,29 +2297,40 @@ export type SecureTableProvisionSelect = { policies?: boolean; outFields?: boolean; }; -export type MerkleStoreModuleSelect = { +export type DatabaseProvisionModuleSelect = { + id?: boolean; + databaseName?: boolean; + ownerId?: boolean; + subdomain?: boolean; + domain?: boolean; + modules?: boolean; + options?: boolean; + bootstrapUser?: boolean; + status?: boolean; + errorMessage?: boolean; + databaseId?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + completedAt?: boolean; +}; +export type ConfigSecretsModuleSelect = { id?: boolean; databaseId?: boolean; schemaId?: boolean; privateSchemaId?: boolean; publicSchemaName?: boolean; privateSchemaName?: boolean; - objectTableId?: boolean; - storeTableId?: boolean; - commitTableId?: boolean; - refTableId?: boolean; - prefix?: boolean; + tableId?: boolean; + configDefinitionsTableId?: boolean; + tableName?: boolean; apiName?: boolean; privateApiName?: boolean; scope?: boolean; - functionPrefix?: boolean; - createdAt?: boolean; - graphModules?: { - select: GraphModuleSelect; - first?: number; - filter?: GraphModuleFilter; - orderBy?: GraphModuleOrderBy[]; - }; + prefix?: boolean; + entityTableId?: boolean; + policies?: boolean; + provisions?: boolean; + hasConfig?: boolean; }; export type GraphModuleSelect = { id?: boolean; @@ -2319,40 +2354,30 @@ export type GraphModuleSelect = { select: MerkleStoreModuleSelect; }; }; -export type DatabaseProvisionModuleSelect = { - id?: boolean; - databaseName?: boolean; - ownerId?: boolean; - subdomain?: boolean; - domain?: boolean; - modules?: boolean; - options?: boolean; - bootstrapUser?: boolean; - status?: boolean; - errorMessage?: boolean; - databaseId?: boolean; - createdAt?: boolean; - updatedAt?: boolean; - completedAt?: boolean; -}; -export type ConfigSecretsModuleSelect = { +export type MerkleStoreModuleSelect = { id?: boolean; databaseId?: boolean; schemaId?: boolean; privateSchemaId?: boolean; publicSchemaName?: boolean; privateSchemaName?: boolean; - tableId?: boolean; - configDefinitionsTableId?: boolean; - tableName?: boolean; + objectTableId?: boolean; + storeTableId?: boolean; + commitTableId?: boolean; + refTableId?: boolean; + prefix?: boolean; apiName?: boolean; privateApiName?: boolean; scope?: boolean; - prefix?: boolean; - entityTableId?: boolean; - policies?: boolean; - provisions?: boolean; - hasConfig?: boolean; + functionPrefix?: boolean; + permissionKey?: boolean; + createdAt?: boolean; + graphModules?: { + select: GraphModuleSelect; + first?: number; + filter?: GraphModuleFilter; + orderBy?: GraphModuleOrderBy[]; + }; }; export type RateLimitMetersModuleSelect = { id?: boolean; @@ -2467,6 +2492,26 @@ export type InvitesModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type PrincipalAuthModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + principalsTableId?: boolean; + principalEntitiesTableId?: boolean; + principalScopeOverridesTableId?: boolean; + usersTableId?: boolean; + sessionsTableId?: boolean; + sessionCredentialsTableId?: boolean; + auditsTableId?: boolean; + principalsTableName?: boolean; + createPrincipalFunction?: boolean; + deletePrincipalFunction?: boolean; + createOrgPrincipalFunction?: boolean; + deleteOrgPrincipalFunction?: boolean; + createOrgApiKeyFunction?: boolean; + revokeOrgApiKeyFunction?: boolean; + apiName?: boolean; +}; export type ComputeLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -3841,7 +3886,43 @@ export interface SecureTableProvisionFilter { /** Negates the expression. */ not?: SecureTableProvisionFilter; } -export interface MerkleStoreModuleFilter { +export interface DatabaseProvisionModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseName` field. */ + databaseName?: StringFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `subdomain` field. */ + subdomain?: StringFilter; + /** Filter by the object’s `domain` field. */ + domain?: StringFilter; + /** Filter by the object’s `modules` field. */ + modules?: JSONFilter; + /** Filter by the object’s `options` field. */ + options?: JSONFilter; + /** Filter by the object’s `bootstrapUser` field. */ + bootstrapUser?: BooleanFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: DatabaseProvisionModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DatabaseProvisionModuleFilter[]; + /** Negates the expression. */ + not?: DatabaseProvisionModuleFilter; +} +export interface ConfigSecretsModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -3854,36 +3935,34 @@ export interface MerkleStoreModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `objectTableId` field. */ - objectTableId?: UUIDFilter; - /** Filter by the object’s `storeTableId` field. */ - storeTableId?: UUIDFilter; - /** Filter by the object’s `commitTableId` field. */ - commitTableId?: UUIDFilter; - /** Filter by the object’s `refTableId` field. */ - refTableId?: UUIDFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; + /** Filter by the object’s `tableId` field. */ + tableId?: UUIDFilter; + /** Filter by the object’s `configDefinitionsTableId` field. */ + configDefinitionsTableId?: UUIDFilter; + /** Filter by the object’s `tableName` field. */ + tableName?: 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 `functionPrefix` field. */ - functionPrefix?: StringFilter; - /** Filter by the object’s `createdAt` field. */ - createdAt?: DatetimeFilter; + /** 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 `hasConfig` field. */ + hasConfig?: BooleanFilter; /** Checks for all expressions in this list. */ - and?: MerkleStoreModuleFilter[]; + and?: ConfigSecretsModuleFilter[]; /** Checks for any expressions in this list. */ - or?: MerkleStoreModuleFilter[]; + or?: ConfigSecretsModuleFilter[]; /** Negates the expression. */ - not?: MerkleStoreModuleFilter; - /** Filter by the object’s `graphModules` relation. */ - graphModules?: MerkleStoreModuleToManyGraphModuleFilter; - /** `graphModules` exist. */ - graphModulesExist?: boolean; + not?: ConfigSecretsModuleFilter; } export interface GraphModuleFilter { /** Filter by the object’s `id` field. */ @@ -3929,43 +4008,7 @@ export interface GraphModuleFilter { /** Filter by the object’s `merkleStoreModule` relation. */ merkleStoreModule?: MerkleStoreModuleFilter; } -export interface DatabaseProvisionModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseName` field. */ - databaseName?: StringFilter; - /** Filter by the object’s `ownerId` field. */ - ownerId?: UUIDFilter; - /** Filter by the object’s `subdomain` field. */ - subdomain?: StringFilter; - /** Filter by the object’s `domain` field. */ - domain?: StringFilter; - /** Filter by the object’s `modules` field. */ - modules?: JSONFilter; - /** Filter by the object’s `options` field. */ - options?: JSONFilter; - /** Filter by the object’s `bootstrapUser` field. */ - bootstrapUser?: BooleanFilter; - /** Filter by the object’s `status` field. */ - status?: StringFilter; - /** Filter by the object’s `errorMessage` field. */ - errorMessage?: StringFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `createdAt` field. */ - createdAt?: DatetimeFilter; - /** Filter by the object’s `updatedAt` field. */ - updatedAt?: DatetimeFilter; - /** Filter by the object’s `completedAt` field. */ - completedAt?: DatetimeFilter; - /** Checks for all expressions in this list. */ - and?: DatabaseProvisionModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: DatabaseProvisionModuleFilter[]; - /** Negates the expression. */ - not?: DatabaseProvisionModuleFilter; -} -export interface ConfigSecretsModuleFilter { +export interface MerkleStoreModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -3978,34 +4021,38 @@ export interface ConfigSecretsModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `tableId` field. */ - tableId?: UUIDFilter; - /** Filter by the object’s `configDefinitionsTableId` field. */ - configDefinitionsTableId?: UUIDFilter; - /** Filter by the object’s `tableName` field. */ - tableName?: StringFilter; + /** Filter by the object’s `objectTableId` field. */ + objectTableId?: UUIDFilter; + /** Filter by the object’s `storeTableId` field. */ + storeTableId?: UUIDFilter; + /** Filter by the object’s `commitTableId` field. */ + commitTableId?: UUIDFilter; + /** Filter by the object’s `refTableId` field. */ + refTableId?: 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; /** 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 `hasConfig` field. */ - hasConfig?: BooleanFilter; + /** Filter by the object’s `functionPrefix` field. */ + functionPrefix?: StringFilter; + /** Filter by the object’s `permissionKey` field. */ + permissionKey?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; /** Checks for all expressions in this list. */ - and?: ConfigSecretsModuleFilter[]; + and?: MerkleStoreModuleFilter[]; /** Checks for any expressions in this list. */ - or?: ConfigSecretsModuleFilter[]; + or?: MerkleStoreModuleFilter[]; /** Negates the expression. */ - not?: ConfigSecretsModuleFilter; + not?: MerkleStoreModuleFilter; + /** Filter by the object’s `graphModules` relation. */ + graphModules?: MerkleStoreModuleToManyGraphModuleFilter; + /** `graphModules` exist. */ + graphModulesExist?: boolean; } export interface RateLimitMetersModuleFilter { /** Filter by the object’s `id` field. */ @@ -4257,6 +4304,50 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } +export interface PrincipalAuthModuleFilter { + /** 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 `principalsTableId` field. */ + principalsTableId?: UUIDFilter; + /** Filter by the object’s `principalEntitiesTableId` field. */ + principalEntitiesTableId?: UUIDFilter; + /** Filter by the object’s `principalScopeOverridesTableId` field. */ + principalScopeOverridesTableId?: UUIDFilter; + /** Filter by the object’s `usersTableId` field. */ + usersTableId?: UUIDFilter; + /** Filter by the object’s `sessionsTableId` field. */ + sessionsTableId?: UUIDFilter; + /** Filter by the object’s `sessionCredentialsTableId` field. */ + sessionCredentialsTableId?: UUIDFilter; + /** Filter by the object’s `auditsTableId` field. */ + auditsTableId?: UUIDFilter; + /** Filter by the object’s `principalsTableName` field. */ + principalsTableName?: StringFilter; + /** Filter by the object’s `createPrincipalFunction` field. */ + createPrincipalFunction?: StringFilter; + /** Filter by the object’s `deletePrincipalFunction` field. */ + deletePrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgPrincipalFunction` field. */ + createOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `deleteOrgPrincipalFunction` field. */ + deleteOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgApiKeyFunction` field. */ + createOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `revokeOrgApiKeyFunction` field. */ + revokeOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalAuthModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalAuthModuleFilter[]; + /** Negates the expression. */ + not?: PrincipalAuthModuleFilter; +} export interface ComputeLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -6248,7 +6339,39 @@ export type SecureTableProvisionOrderBy = | 'POLICIES_DESC' | 'OUT_FIELDS_ASC' | 'OUT_FIELDS_DESC'; -export type MerkleStoreModuleOrderBy = +export type DatabaseProvisionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC'; +export type ConfigSecretsModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' @@ -6264,26 +6387,28 @@ export type MerkleStoreModuleOrderBy = | 'PUBLIC_SCHEMA_NAME_DESC' | 'PRIVATE_SCHEMA_NAME_ASC' | 'PRIVATE_SCHEMA_NAME_DESC' - | 'OBJECT_TABLE_ID_ASC' - | 'OBJECT_TABLE_ID_DESC' - | 'STORE_TABLE_ID_ASC' - | 'STORE_TABLE_ID_DESC' - | 'COMMIT_TABLE_ID_ASC' - | 'COMMIT_TABLE_ID_DESC' - | 'REF_TABLE_ID_ASC' - | 'REF_TABLE_ID_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' + | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' | 'API_NAME_ASC' | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC' | 'SCOPE_ASC' | 'SCOPE_DESC' - | 'FUNCTION_PREFIX_ASC' - | 'FUNCTION_PREFIX_DESC' - | 'CREATED_AT_ASC' - | 'CREATED_AT_DESC'; + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'HAS_CONFIG_ASC' + | 'HAS_CONFIG_DESC'; export type GraphModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6322,39 +6447,7 @@ export type GraphModuleOrderBy = | 'DEFAULT_PERMISSIONS_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC'; -export type DatabaseProvisionModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_NAME_ASC' - | 'DATABASE_NAME_DESC' - | 'OWNER_ID_ASC' - | 'OWNER_ID_DESC' - | 'SUBDOMAIN_ASC' - | 'SUBDOMAIN_DESC' - | 'DOMAIN_ASC' - | 'DOMAIN_DESC' - | 'MODULES_ASC' - | 'MODULES_DESC' - | 'OPTIONS_ASC' - | 'OPTIONS_DESC' - | 'BOOTSTRAP_USER_ASC' - | 'BOOTSTRAP_USER_DESC' - | 'STATUS_ASC' - | 'STATUS_DESC' - | 'ERROR_MESSAGE_ASC' - | 'ERROR_MESSAGE_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'CREATED_AT_ASC' - | 'CREATED_AT_DESC' - | 'UPDATED_AT_ASC' - | 'UPDATED_AT_DESC' - | 'COMPLETED_AT_ASC' - | 'COMPLETED_AT_DESC'; -export type ConfigSecretsModuleOrderBy = +export type MerkleStoreModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' @@ -6370,28 +6463,28 @@ export type ConfigSecretsModuleOrderBy = | 'PUBLIC_SCHEMA_NAME_DESC' | 'PRIVATE_SCHEMA_NAME_ASC' | 'PRIVATE_SCHEMA_NAME_DESC' - | 'TABLE_ID_ASC' - | 'TABLE_ID_DESC' - | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' - | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' - | 'TABLE_NAME_ASC' - | 'TABLE_NAME_DESC' + | 'OBJECT_TABLE_ID_ASC' + | 'OBJECT_TABLE_ID_DESC' + | 'STORE_TABLE_ID_ASC' + | 'STORE_TABLE_ID_DESC' + | 'COMMIT_TABLE_ID_ASC' + | 'COMMIT_TABLE_ID_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_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' - | 'HAS_CONFIG_ASC' - | 'HAS_CONFIG_DESC'; + | 'FUNCTION_PREFIX_ASC' + | 'FUNCTION_PREFIX_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; export type RateLimitMetersModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6618,6 +6711,46 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type PrincipalAuthModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC'; export type ComputeLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -8755,47 +8888,89 @@ export interface DeleteSecureTableProvisionInput { clientMutationId?: string; id: string; } -export interface CreateMerkleStoreModuleInput { +export interface CreateDatabaseProvisionModuleInput { clientMutationId?: string; - merkleStoreModule: { - databaseId: string; - schemaId?: string; + databaseProvisionModule: { + databaseName: string; + ownerId: string; + subdomain?: string; + domain: string; + modules?: Record; + options?: Record; + bootstrapUser?: boolean; + status?: string; + errorMessage?: string; + databaseId?: string; + completedAt?: string; + }; +} +export interface DatabaseProvisionModulePatch { + databaseName?: string | null; + ownerId?: string | null; + subdomain?: string | null; + domain?: string | null; + modules?: Record | null; + options?: Record | null; + bootstrapUser?: boolean | null; + status?: string | null; + errorMessage?: string | null; + databaseId?: string | null; + completedAt?: string | null; +} +export interface UpdateDatabaseProvisionModuleInput { + clientMutationId?: string; + id: string; + databaseProvisionModulePatch: DatabaseProvisionModulePatch; +} +export interface DeleteDatabaseProvisionModuleInput { + clientMutationId?: string; + id: string; +} +export interface CreateConfigSecretsModuleInput { + clientMutationId?: string; + configSecretsModule: { + databaseId: string; + schemaId?: string; privateSchemaId?: string; publicSchemaName?: string; privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; + tableId?: string; + configDefinitionsTableId?: string; + tableName?: string; apiName?: string; privateApiName?: string; scope?: string; - functionPrefix?: string; + prefix?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + hasConfig?: boolean; }; } -export interface MerkleStoreModulePatch { +export interface ConfigSecretsModulePatch { databaseId?: string | null; schemaId?: string | null; privateSchemaId?: string | null; publicSchemaName?: string | null; privateSchemaName?: string | null; - objectTableId?: string | null; - storeTableId?: string | null; - commitTableId?: string | null; - refTableId?: string | null; - prefix?: string | null; + tableId?: string | null; + configDefinitionsTableId?: string | null; + tableName?: string | null; apiName?: string | null; privateApiName?: string | null; scope?: string | null; - functionPrefix?: string | null; + prefix?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + hasConfig?: boolean | null; } -export interface UpdateMerkleStoreModuleInput { +export interface UpdateConfigSecretsModuleInput { clientMutationId?: string; id: string; - merkleStoreModulePatch: MerkleStoreModulePatch; + configSecretsModulePatch: ConfigSecretsModulePatch; } -export interface DeleteMerkleStoreModuleInput { +export interface DeleteConfigSecretsModuleInput { clientMutationId?: string; id: string; } @@ -8845,89 +9020,49 @@ export interface DeleteGraphModuleInput { clientMutationId?: string; id: string; } -export interface CreateDatabaseProvisionModuleInput { - clientMutationId?: string; - databaseProvisionModule: { - databaseName: string; - ownerId: string; - subdomain?: string; - domain: string; - modules?: Record; - options?: Record; - bootstrapUser?: boolean; - status?: string; - errorMessage?: string; - databaseId?: string; - completedAt?: string; - }; -} -export interface DatabaseProvisionModulePatch { - databaseName?: string | null; - ownerId?: string | null; - subdomain?: string | null; - domain?: string | null; - modules?: Record | null; - options?: Record | null; - bootstrapUser?: boolean | null; - status?: string | null; - errorMessage?: string | null; - databaseId?: string | null; - completedAt?: string | null; -} -export interface UpdateDatabaseProvisionModuleInput { - clientMutationId?: string; - id: string; - databaseProvisionModulePatch: DatabaseProvisionModulePatch; -} -export interface DeleteDatabaseProvisionModuleInput { - clientMutationId?: string; - id: string; -} -export interface CreateConfigSecretsModuleInput { +export interface CreateMerkleStoreModuleInput { clientMutationId?: string; - configSecretsModule: { + merkleStoreModule: { databaseId: string; schemaId?: string; privateSchemaId?: string; publicSchemaName?: string; privateSchemaName?: string; - tableId?: string; - configDefinitionsTableId?: string; - tableName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; apiName?: string; privateApiName?: string; scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - hasConfig?: boolean; + functionPrefix?: string; + permissionKey?: string; }; } -export interface ConfigSecretsModulePatch { +export interface MerkleStoreModulePatch { databaseId?: string | null; schemaId?: string | null; privateSchemaId?: string | null; publicSchemaName?: string | null; privateSchemaName?: string | null; - tableId?: string | null; - configDefinitionsTableId?: string | null; - tableName?: string | null; + objectTableId?: string | null; + storeTableId?: string | null; + commitTableId?: string | null; + refTableId?: string | null; + prefix?: string | null; apiName?: string | null; privateApiName?: string | null; scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - hasConfig?: boolean | null; + functionPrefix?: string | null; + permissionKey?: string | null; } -export interface UpdateConfigSecretsModuleInput { +export interface UpdateMerkleStoreModuleInput { clientMutationId?: string; id: string; - configSecretsModulePatch: ConfigSecretsModulePatch; + merkleStoreModulePatch: MerkleStoreModulePatch; } -export interface DeleteConfigSecretsModuleInput { +export interface DeleteMerkleStoreModuleInput { clientMutationId?: string; id: string; } @@ -9217,6 +9352,56 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } +export interface CreatePrincipalAuthModuleInput { + clientMutationId?: string; + principalAuthModule: { + databaseId: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; + }; +} +export interface PrincipalAuthModulePatch { + databaseId?: string | null; + schemaId?: string | null; + principalsTableId?: string | null; + principalEntitiesTableId?: string | null; + principalScopeOverridesTableId?: string | null; + usersTableId?: string | null; + sessionsTableId?: string | null; + sessionCredentialsTableId?: string | null; + auditsTableId?: string | null; + principalsTableName?: string | null; + createPrincipalFunction?: string | null; + deletePrincipalFunction?: string | null; + createOrgPrincipalFunction?: string | null; + deleteOrgPrincipalFunction?: string | null; + createOrgApiKeyFunction?: string | null; + revokeOrgApiKeyFunction?: string | null; + apiName?: string | null; +} +export interface UpdatePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; + principalAuthModulePatch: PrincipalAuthModulePatch; +} +export interface DeletePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateComputeLogModuleInput { clientMutationId?: string; computeLogModule: { @@ -11348,45 +11533,6 @@ export interface SecureTableProvisionInput { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[]; } -/** An input for mutations affecting `MerkleStoreModule` */ -export interface MerkleStoreModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - functionPrefix?: string; - createdAt?: string; -} -/** 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?: Record; - provisions?: Record; - defaultPermissions?: string[]; - createdAt?: string; -} /** An input for mutations affecting `DatabaseProvisionModule` */ export interface DatabaseProvisionModuleInput { id?: string; @@ -11433,6 +11579,46 @@ export interface ConfigSecretsModuleInput { provisions?: Record; hasConfig?: boolean; } +/** 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?: Record; + provisions?: Record; + defaultPermissions?: string[]; + createdAt?: string; +} +/** An input for mutations affecting `MerkleStoreModule` */ +export interface MerkleStoreModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + functionPrefix?: string; + permissionKey?: string; + createdAt?: string; +} /** An input for mutations affecting `RateLimitMetersModule` */ export interface RateLimitMetersModuleInput { id?: string; @@ -11550,7 +11736,28 @@ export interface InvitesModuleInput { prefix?: string; entityTableId?: string; apiName?: string; - privateApiName?: string; + privateApiName?: string; +} +/** An input for mutations affecting `PrincipalAuthModule` */ +export interface PrincipalAuthModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; } /** An input for mutations affecting `ComputeLogModule` */ export interface ComputeLogModuleInput { @@ -12970,6 +13177,8 @@ export interface MerkleStoreModuleFilter { scope?: StringFilter; /** Filter by the object’s `functionPrefix` field. */ functionPrefix?: StringFilter; + /** Filter by the object’s `permissionKey` field. */ + permissionKey?: StringFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Checks for all expressions in this list. */ @@ -14248,96 +14457,6 @@ export type DeleteSecureTableProvisionPayloadSelect = { select: SecureTableProvisionEdgeSelect; }; }; -export interface CreateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was created by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type CreateMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface UpdateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was updated by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type UpdateMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface DeleteMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was deleted by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type DeleteMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface CreateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was created by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type CreateGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; -export interface UpdateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was updated by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type UpdateGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; -export interface DeleteGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was deleted by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type DeleteGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; export interface CreateDatabaseProvisionModulePayload { clientMutationId?: string | null; /** The `DatabaseProvisionModule` that was created by this mutation. */ @@ -14428,6 +14547,96 @@ export type DeleteConfigSecretsModulePayloadSelect = { select: ConfigSecretsModuleEdgeSelect; }; }; +export interface CreateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was created by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type CreateGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface UpdateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was updated by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type UpdateGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface DeleteGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was deleted by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type DeleteGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface CreateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was created by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type CreateMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; +export interface UpdateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was updated by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type UpdateMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; +export interface DeleteMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was deleted by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type DeleteMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; export interface CreateRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was created by this mutation. */ @@ -14698,6 +14907,51 @@ export type DeleteInvitesModulePayloadSelect = { select: InvitesModuleEdgeSelect; }; }; +export interface CreatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was created by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type CreatePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; +export interface UpdatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was updated by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type UpdatePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; +export interface DeletePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was deleted by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type DeletePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ @@ -16065,30 +16319,6 @@ export type SecureTableProvisionEdgeSelect = { select: SecureTableProvisionSelect; }; }; -/** A `MerkleStoreModule` edge in the connection. */ -export interface MerkleStoreModuleEdge { - cursor?: string | null; - /** The `MerkleStoreModule` at the end of the edge. */ - node?: MerkleStoreModule | null; -} -export type MerkleStoreModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: MerkleStoreModuleSelect; - }; -}; -/** A `GraphModule` edge in the connection. */ -export interface GraphModuleEdge { - cursor?: string | null; - /** The `GraphModule` at the end of the edge. */ - node?: GraphModule | null; -} -export type GraphModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: GraphModuleSelect; - }; -}; /** A `DatabaseProvisionModule` edge in the connection. */ export interface DatabaseProvisionModuleEdge { cursor?: string | null; @@ -16113,6 +16343,30 @@ export type ConfigSecretsModuleEdgeSelect = { select: ConfigSecretsModuleSelect; }; }; +/** A `GraphModule` edge in the connection. */ +export interface GraphModuleEdge { + cursor?: string | null; + /** The `GraphModule` at the end of the edge. */ + node?: GraphModule | null; +} +export type GraphModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: GraphModuleSelect; + }; +}; +/** A `MerkleStoreModule` edge in the connection. */ +export interface MerkleStoreModuleEdge { + cursor?: string | null; + /** The `MerkleStoreModule` at the end of the edge. */ + node?: MerkleStoreModule | null; +} +export type MerkleStoreModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: MerkleStoreModuleSelect; + }; +}; /** A `RateLimitMetersModule` edge in the connection. */ export interface RateLimitMetersModuleEdge { cursor?: string | null; @@ -16185,6 +16439,18 @@ export type InvitesModuleEdgeSelect = { select: InvitesModuleSelect; }; }; +/** A `PrincipalAuthModule` edge in the connection. */ +export interface PrincipalAuthModuleEdge { + cursor?: string | null; + /** The `PrincipalAuthModule` at the end of the edge. */ + node?: PrincipalAuthModule | null; +} +export type PrincipalAuthModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: PrincipalAuthModuleSelect; + }; +}; /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; diff --git a/sdk/constructive-cli/src/modules/orm/models/index.ts b/sdk/constructive-cli/src/modules/orm/models/index.ts index 2ff305f2fc..df6b328d8a 100644 --- a/sdk/constructive-cli/src/modules/orm/models/index.ts +++ b/sdk/constructive-cli/src/modules/orm/models/index.ts @@ -29,16 +29,17 @@ export { BlueprintConstructionModel } from './blueprintConstruction'; export { CryptoAuthModuleModel } from './cryptoAuthModule'; export { SessionsModuleModel } from './sessionsModule'; export { SecureTableProvisionModel } from './secureTableProvision'; -export { MerkleStoreModuleModel } from './merkleStoreModule'; -export { GraphModuleModel } from './graphModule'; export { DatabaseProvisionModuleModel } from './databaseProvisionModule'; export { ConfigSecretsModuleModel } from './configSecretsModule'; +export { GraphModuleModel } from './graphModule'; +export { MerkleStoreModuleModel } from './merkleStoreModule'; export { RateLimitMetersModuleModel } from './rateLimitMetersModule'; export { RealtimeModuleModel } from './realtimeModule'; export { WebauthnAuthModuleModel } from './webauthnAuthModule'; export { FunctionInvocationModuleModel } from './functionInvocationModule'; export { FunctionModuleModel } from './functionModule'; export { InvitesModuleModel } from './invitesModule'; +export { PrincipalAuthModuleModel } from './principalAuthModule'; export { ComputeLogModuleModel } from './computeLogModule'; export { InferenceLogModuleModel } from './inferenceLogModule'; export { NamespaceModuleModel } from './namespaceModule'; diff --git a/sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts b/sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts new file mode 100644 index 0000000000..c0e9d913d3 --- /dev/null +++ b/sdk/constructive-cli/src/modules/orm/models/principalAuthModule.ts @@ -0,0 +1,245 @@ +/** + * PrincipalAuthModule 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 { + PrincipalAuthModule, + PrincipalAuthModuleWithRelations, + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy, + CreatePrincipalAuthModuleInput, + UpdatePrincipalAuthModuleInput, + PrincipalAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalAuthModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModules: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + 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, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', + document, + variables, + transform: (data: { + principalAuthModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', + document, + variables, + transform: (data: { + principalAuthModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalAuthModule', + 'createPrincipalAuthModule', + 'principalAuthModule', + args.select, + args.data, + 'CreatePrincipalAuthModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'createPrincipalAuthModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrincipalAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PrincipalAuthModule', + 'updatePrincipalAuthModule', + 'principalAuthModule', + args.select, + args.where.id, + args.data, + 'UpdatePrincipalAuthModuleInput', + 'id', + 'principalAuthModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'updatePrincipalAuthModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PrincipalAuthModule', + 'deletePrincipalAuthModule', + 'principalAuthModule', + { + id: args.where.id, + }, + 'DeletePrincipalAuthModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'deletePrincipalAuthModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/auth/README.md b/sdk/constructive-react/src/auth/README.md index 68a599dfc4..a8c147a4a4 100644 --- a/sdk/constructive-react/src/auth/README.md +++ b/sdk/constructive-react/src/auth/README.md @@ -8,9 +8,9 @@ ## Overview -- **Tables:** 9 +- **Tables:** 13 - **Custom queries:** 5 -- **Custom mutations:** 25 +- **Custom mutations:** 29 **Generators:** ORM, React Query diff --git a/sdk/constructive-react/src/auth/hooks/README.md b/sdk/constructive-react/src/auth/hooks/README.md index 9f6a662440..7251540918 100644 --- a/sdk/constructive-react/src/auth/hooks/README.md +++ b/sdk/constructive-react/src/auth/hooks/README.md @@ -32,6 +32,21 @@ function App() { | Hook | Type | Description | |------|------|-------------| +| `usePrincipalsQuery` | Query | Scoped sub-identities (API keys and agents) with precomputed SPRT | +| `usePrincipalQuery` | Query | Scoped sub-identities (API keys and agents) with precomputed SPRT | +| `useCreatePrincipalMutation` | Mutation | Scoped sub-identities (API keys and agents) with precomputed SPRT | +| `useUpdatePrincipalMutation` | Mutation | Scoped sub-identities (API keys and agents) with precomputed SPRT | +| `useDeletePrincipalMutation` | Mutation | Scoped sub-identities (API keys and agents) with precomputed SPRT | +| `usePrincipalEntitiesQuery` | Query | Association table scoping principals to specific organizations | +| `usePrincipalEntityQuery` | Query | Association table scoping principals to specific organizations | +| `useCreatePrincipalEntityMutation` | Mutation | Association table scoping principals to specific organizations | +| `useUpdatePrincipalEntityMutation` | Mutation | Association table scoping principals to specific organizations | +| `useDeletePrincipalEntityMutation` | Mutation | Association table scoping principals to specific organizations | +| `usePrincipalScopeOverridesQuery` | Query | Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. | +| `usePrincipalScopeOverrideQuery` | Query | Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. | +| `useCreatePrincipalScopeOverrideMutation` | Mutation | Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. | +| `useUpdatePrincipalScopeOverrideMutation` | Mutation | Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. | +| `useDeletePrincipalScopeOverrideMutation` | Mutation | Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. | | `useEmailsQuery` | Query | User email addresses with verification and primary-email management | | `useEmailQuery` | Query | User email addresses with verification and primary-email management | | `useCreateEmailMutation` | Mutation | User email addresses with verification and primary-email management | @@ -69,25 +84,32 @@ function App() { | `useCreateUserConnectedAccountMutation` | Mutation | Create a userConnectedAccount | | `useUpdateUserConnectedAccountMutation` | Mutation | Update a userConnectedAccount | | `useDeleteUserConnectedAccountMutation` | Mutation | Delete a userConnectedAccount | +| `useOrgApiKeyListsQuery` | Query | List all orgApiKeyLists | +| `useOrgApiKeyListQuery` | Query | Get one orgApiKeyList | +| `useCreateOrgApiKeyListMutation` | Mutation | Create a orgApiKeyList | +| `useUpdateOrgApiKeyListMutation` | Mutation | Update a orgApiKeyList | +| `useDeleteOrgApiKeyListMutation` | Mutation | Delete a orgApiKeyList | | `useUsersQuery` | Query | List all users | | `useUserQuery` | Query | Get one user | | `useCreateUserMutation` | Mutation | Create a user | | `useUpdateUserMutation` | Mutation | Update a user | | `useDeleteUserMutation` | Mutation | Delete a user | | `useCurrentUserAgentQuery` | Query | currentUserAgent | -| `useCurrentIpAddressQuery` | Query | currentIpAddress | | `useCurrentUserIdQuery` | Query | currentUserId | +| `useCurrentIpAddressQuery` | Query | currentIpAddress | | `useRequireStepUpQuery` | Query | requireStepUp | | `useCurrentUserQuery` | Query | currentUser | | `useSignOutMutation` | Mutation | signOut | | `useSendAccountDeletionEmailMutation` | Mutation | sendAccountDeletionEmail | | `useCheckPasswordMutation` | Mutation | checkPassword | +| `useDeleteOrgPrincipalMutation` | Mutation | deleteOrgPrincipal | | `useDisconnectAccountMutation` | Mutation | disconnectAccount | | `useRevokeApiKeyMutation` | Mutation | revokeApiKey | | `useRevokeSessionMutation` | Mutation | revokeSession | | `useVerifyPasswordMutation` | Mutation | verifyPassword | | `useVerifyTotpMutation` | Mutation | verifyTotp | | `useConfirmDeleteAccountMutation` | Mutation | confirmDeleteAccount | +| `useRevokeOrgApiKeyMutation` | Mutation | revokeOrgApiKey | | `useSetPasswordMutation` | Mutation | setPassword | | `useVerifyEmailMutation` | Mutation | verifyEmail | | `useProvisionNewUserMutation` | Mutation | provisionNewUser | @@ -98,7 +120,9 @@ function App() { | `useSignUpMutation` | Mutation | signUp | | `useSignInMutation` | Mutation | signIn | | `useLinkIdentityMutation` | Mutation | linkIdentity | +| `useCreateOrgPrincipalMutation` | Mutation | createOrgPrincipal | | `useExtendTokenExpiresMutation` | Mutation | extendTokenExpires | +| `useCreateOrgApiKeyMutation` | Mutation | createOrgApiKey | | `useCreateApiKeyMutation` | Mutation | createApiKey | | `useRequestCrossOriginTokenMutation` | Mutation | requestCrossOriginToken | | `useForgotPasswordMutation` | Mutation | forgotPassword | @@ -110,6 +134,69 @@ and lifecycle settings. | ## Table Hooks +### Principal + +```typescript +// List all principals +const { data, isLoading } = usePrincipalsQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }, +}); + +// Get one principal +const { data: item } = usePrincipalQuery({ + principalId: '', + selection: { fields: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }, +}); + +// Create a principal +const { mutate: create } = useCreatePrincipalMutation({ + selection: { fields: { principalId: true } }, +}); +create({ id: '', ownerId: '', userId: '', name: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' }); +``` + +### PrincipalEntity + +```typescript +// List all principalEntities +const { data, isLoading } = usePrincipalEntitiesQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }, +}); + +// Get one principalEntity +const { data: item } = usePrincipalEntityQuery({ + id: '', + selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }, +}); + +// Create a principalEntity +const { mutate: create } = useCreatePrincipalEntityMutation({ + selection: { fields: { id: true } }, +}); +create({ principalId: '', entityId: '', ownerId: '' }); +``` + +### PrincipalScopeOverride + +```typescript +// List all principalScopeOverrides +const { data, isLoading } = usePrincipalScopeOverridesQuery({ + selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }, +}); + +// Get one principalScopeOverride +const { data: item } = usePrincipalScopeOverrideQuery({ + id: '', + selection: { fields: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }, +}); + +// Create a principalScopeOverride +const { mutate: create } = useCreatePrincipalScopeOverrideMutation({ + selection: { fields: { id: true } }, +}); +create({ principalId: '', membershipType: '', allowedMask: '', isAdmin: '', isReadOnly: '' }); +``` + ### Email ```typescript @@ -272,6 +359,27 @@ const { mutate: create } = useCreateUserConnectedAccountMutation({ create({ ownerId: '', service: '', identifier: '', details: '', isVerified: '' }); ``` +### OrgApiKeyList + +```typescript +// List all orgApiKeyLists +const { data, isLoading } = useOrgApiKeyListsQuery({ + selection: { fields: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }, +}); + +// Get one orgApiKeyList +const { data: item } = useOrgApiKeyListQuery({ + id: '', + selection: { fields: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }, +}); + +// Create a orgApiKeyList +const { mutate: create } = useCreateOrgApiKeyListMutation({ + selection: { fields: { id: true } }, +}); +create({ keyId: '', name: '', principalId: '', orgId: '', expiresAt: '', revokedAt: '', lastUsedAt: '', mfaLevel: '', accessLevel: '' }); +``` + ### User ```typescript @@ -302,16 +410,16 @@ currentUserAgent - **Type:** query - **Arguments:** none -### `useCurrentIpAddressQuery` +### `useCurrentUserIdQuery` -currentIpAddress +currentUserId - **Type:** query - **Arguments:** none -### `useCurrentUserIdQuery` +### `useCurrentIpAddressQuery` -currentUserId +currentIpAddress - **Type:** query - **Arguments:** none @@ -367,6 +475,17 @@ checkPassword |----------|------| | `input` | CheckPasswordInput (required) | +### `useDeleteOrgPrincipalMutation` + +deleteOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | DeleteOrgPrincipalInput (required) | + ### `useDisconnectAccountMutation` disconnectAccount @@ -433,6 +552,17 @@ confirmDeleteAccount |----------|------| | `input` | ConfirmDeleteAccountInput (required) | +### `useRevokeOrgApiKeyMutation` + +revokeOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | RevokeOrgApiKeyInput (required) | + ### `useSetPasswordMutation` setPassword @@ -543,6 +673,17 @@ linkIdentity |----------|------| | `input` | LinkIdentityInput (required) | +### `useCreateOrgPrincipalMutation` + +createOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgPrincipalInput (required) | + ### `useExtendTokenExpiresMutation` extendTokenExpires @@ -554,6 +695,17 @@ extendTokenExpires |----------|------| | `input` | ExtendTokenExpiresInput (required) | +### `useCreateOrgApiKeyMutation` + +createOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgApiKeyInput (required) | + ### `useCreateApiKeyMutation` createApiKey diff --git a/sdk/constructive-react/src/auth/hooks/index.ts b/sdk/constructive-react/src/auth/hooks/index.ts index 4d4f35cad9..3c7b66c74b 100644 --- a/sdk/constructive-react/src/auth/hooks/index.ts +++ b/sdk/constructive-react/src/auth/hooks/index.ts @@ -2,7 +2,7 @@ * GraphQL SDK * @generated by @constructive-io/graphql-codegen * - * Tables: Email, PhoneNumber, CryptoAddress, WebauthnCredential, AuditLogAuth, IdentityProvider, RoleType, UserConnectedAccount, User + * Tables: Principal, PrincipalEntity, PrincipalScopeOverride, Email, PhoneNumber, CryptoAddress, WebauthnCredential, AuditLogAuth, IdentityProvider, RoleType, UserConnectedAccount, OrgApiKeyList, User * * Usage: * diff --git a/sdk/constructive-react/src/auth/hooks/invalidation.ts b/sdk/constructive-react/src/auth/hooks/invalidation.ts index a741da131e..8665adcbef 100644 --- a/sdk/constructive-react/src/auth/hooks/invalidation.ts +++ b/sdk/constructive-react/src/auth/hooks/invalidation.ts @@ -15,6 +15,9 @@ import type { QueryClient } from '@tanstack/react-query'; import { + principalKeys, + principalEntityKeys, + principalScopeOverrideKeys, emailKeys, phoneNumberKeys, cryptoAddressKeys, @@ -23,6 +26,7 @@ import { identityProviderKeys, roleTypeKeys, userConnectedAccountKeys, + orgApiKeyListKeys, userKeys, } from './query-keys'; /** @@ -45,6 +49,57 @@ import { * ``` */ export const invalidate = { + /** Invalidate principal queries */ principal: { + /** Invalidate all principal queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalKeys.all, + }), + /** Invalidate principal list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalKeys.lists(), + }), + /** Invalidate a specific principal */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: principalKeys.detail(id), + }), + }, + /** Invalidate principalEntity queries */ principalEntity: { + /** Invalidate all principalEntity queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalEntityKeys.all, + }), + /** Invalidate principalEntity list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalEntityKeys.lists(), + }), + /** Invalidate a specific principalEntity */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: principalEntityKeys.detail(id), + }), + }, + /** Invalidate principalScopeOverride queries */ principalScopeOverride: { + /** Invalidate all principalScopeOverride queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalScopeOverrideKeys.all, + }), + /** Invalidate principalScopeOverride list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalScopeOverrideKeys.lists(), + }), + /** Invalidate a specific principalScopeOverride */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: principalScopeOverrideKeys.detail(id), + }), + }, /** Invalidate email queries */ email: { /** Invalidate all email queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -175,6 +230,23 @@ export const invalidate = { queryKey: userConnectedAccountKeys.detail(id), }), }, + /** Invalidate orgApiKeyList queries */ orgApiKeyList: { + /** Invalidate all orgApiKeyList queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgApiKeyListKeys.all, + }), + /** Invalidate orgApiKeyList list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: orgApiKeyListKeys.lists(), + }), + /** Invalidate a specific orgApiKeyList */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: orgApiKeyListKeys.detail(id), + }), + }, /** Invalidate user queries */ user: { /** Invalidate all user queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -202,6 +274,27 @@ export const invalidate = { * instead of just invalidating (which would trigger a refetch). */ export const remove = { + /** Remove principal from cache */ principal: (queryClient: QueryClient, id: string | number) => { + queryClient.removeQueries({ + queryKey: principalKeys.detail(id), + }); + }, + /** Remove principalEntity from cache */ principalEntity: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: principalEntityKeys.detail(id), + }); + }, + /** Remove principalScopeOverride from cache */ principalScopeOverride: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: principalScopeOverrideKeys.detail(id), + }); + }, /** Remove email from cache */ email: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ queryKey: emailKeys.detail(id), @@ -260,6 +353,14 @@ export const remove = { queryKey: userConnectedAccountKeys.detail(id), }); }, + /** Remove orgApiKeyList from cache */ orgApiKeyList: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: orgApiKeyListKeys.detail(id), + }); + }, /** Remove user from cache */ user: (queryClient: QueryClient, id: string | number) => { queryClient.removeQueries({ queryKey: userKeys.detail(id), diff --git a/sdk/constructive-react/src/auth/hooks/mutation-keys.ts b/sdk/constructive-react/src/auth/hooks/mutation-keys.ts index a8ccdee7d7..badc510206 100644 --- a/sdk/constructive-react/src/auth/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/auth/hooks/mutation-keys.ts @@ -18,6 +18,35 @@ // Entity Mutation Keys // ============================================================================ +export const principalMutationKeys = { + /** All principal mutation keys */ all: ['mutation', 'principal'] as const, + /** Create principal mutation key */ create: () => ['mutation', 'principal', 'create'] as const, + /** Update principal mutation key */ update: (id: string | number) => + ['mutation', 'principal', 'update', id] as const, + /** Delete principal mutation key */ delete: (id: string | number) => + ['mutation', 'principal', 'delete', id] as const, +} as const; +export const principalEntityMutationKeys = { + /** All principalEntity mutation keys */ all: ['mutation', 'principalentity'] as const, + /** Create principalEntity mutation key */ create: () => + ['mutation', 'principalentity', 'create'] as const, + /** Update principalEntity mutation key */ update: (id: string | number) => + ['mutation', 'principalentity', 'update', id] as const, + /** Delete principalEntity mutation key */ delete: (id: string | number) => + ['mutation', 'principalentity', 'delete', id] as const, +} as const; +export const principalScopeOverrideMutationKeys = { + /** All principalScopeOverride mutation keys */ all: [ + 'mutation', + 'principalscopeoverride', + ] as const, + /** Create principalScopeOverride mutation key */ create: () => + ['mutation', 'principalscopeoverride', 'create'] as const, + /** Update principalScopeOverride mutation key */ update: (id: string | number) => + ['mutation', 'principalscopeoverride', 'update', id] as const, + /** Delete principalScopeOverride mutation key */ delete: (id: string | number) => + ['mutation', 'principalscopeoverride', 'delete', id] as const, +} as const; export const emailMutationKeys = { /** All email mutation keys */ all: ['mutation', 'email'] as const, /** Create email mutation key */ create: () => ['mutation', 'email', 'create'] as const, @@ -88,6 +117,15 @@ export const userConnectedAccountMutationKeys = { /** Delete userConnectedAccount mutation key */ delete: (id: string | number) => ['mutation', 'userconnectedaccount', 'delete', id] as const, } as const; +export const orgApiKeyListMutationKeys = { + /** All orgApiKeyList mutation keys */ all: ['mutation', 'orgapikeylist'] as const, + /** Create orgApiKeyList mutation key */ create: () => + ['mutation', 'orgapikeylist', 'create'] as const, + /** Update orgApiKeyList mutation key */ update: (id: string | number) => + ['mutation', 'orgapikeylist', 'update', id] as const, + /** Delete orgApiKeyList mutation key */ delete: (id: string | number) => + ['mutation', 'orgapikeylist', 'delete', id] as const, +} as const; export const userMutationKeys = { /** All user mutation keys */ all: ['mutation', 'user'] as const, /** Create user mutation key */ create: () => ['mutation', 'user', 'create'] as const, @@ -116,6 +154,10 @@ export const customMutationKeys = { identifier ? (['mutation', 'checkPassword', identifier] as const) : (['mutation', 'checkPassword'] as const), + /** Mutation key for deleteOrgPrincipal */ deleteOrgPrincipal: (identifier?: string) => + identifier + ? (['mutation', 'deleteOrgPrincipal', identifier] as const) + : (['mutation', 'deleteOrgPrincipal'] as const), /** Mutation key for disconnectAccount */ disconnectAccount: (identifier?: string) => identifier ? (['mutation', 'disconnectAccount', identifier] as const) @@ -140,6 +182,10 @@ export const customMutationKeys = { identifier ? (['mutation', 'confirmDeleteAccount', identifier] as const) : (['mutation', 'confirmDeleteAccount'] as const), + /** Mutation key for revokeOrgApiKey */ revokeOrgApiKey: (identifier?: string) => + identifier + ? (['mutation', 'revokeOrgApiKey', identifier] as const) + : (['mutation', 'revokeOrgApiKey'] as const), /** Mutation key for setPassword */ setPassword: (identifier?: string) => identifier ? (['mutation', 'setPassword', identifier] as const) @@ -176,10 +222,18 @@ export const customMutationKeys = { identifier ? (['mutation', 'linkIdentity', identifier] as const) : (['mutation', 'linkIdentity'] as const), + /** Mutation key for createOrgPrincipal */ createOrgPrincipal: (identifier?: string) => + identifier + ? (['mutation', 'createOrgPrincipal', identifier] as const) + : (['mutation', 'createOrgPrincipal'] as const), /** Mutation key for extendTokenExpires */ extendTokenExpires: (identifier?: string) => identifier ? (['mutation', 'extendTokenExpires', identifier] as const) : (['mutation', 'extendTokenExpires'] as const), + /** Mutation key for createOrgApiKey */ createOrgApiKey: (identifier?: string) => + identifier + ? (['mutation', 'createOrgApiKey', identifier] as const) + : (['mutation', 'createOrgApiKey'] as const), /** Mutation key for createApiKey */ createApiKey: (identifier?: string) => identifier ? (['mutation', 'createApiKey', identifier] as const) @@ -224,6 +278,9 @@ export const customMutationKeys = { * ``` */ export const mutationKeys = { + principal: principalMutationKeys, + principalEntity: principalEntityMutationKeys, + principalScopeOverride: principalScopeOverrideMutationKeys, email: emailMutationKeys, phoneNumber: phoneNumberMutationKeys, cryptoAddress: cryptoAddressMutationKeys, @@ -232,6 +289,7 @@ export const mutationKeys = { identityProvider: identityProviderMutationKeys, roleType: roleTypeMutationKeys, userConnectedAccount: userConnectedAccountMutationKeys, + orgApiKeyList: orgApiKeyListMutationKeys, user: userMutationKeys, custom: customMutationKeys, } as const; diff --git a/sdk/constructive-react/src/auth/hooks/mutations/index.ts b/sdk/constructive-react/src/auth/hooks/mutations/index.ts index 91e5cfdec7..c068e69ef7 100644 --- a/sdk/constructive-react/src/auth/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/auth/hooks/mutations/index.ts @@ -3,6 +3,12 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ +export * from './useCreatePrincipalMutation'; +export * from './useDeletePrincipalMutation'; +export * from './useCreatePrincipalEntityMutation'; +export * from './useUpdatePrincipalEntityMutation'; +export * from './useDeletePrincipalEntityMutation'; +export * from './useCreatePrincipalScopeOverrideMutation'; export * from './useCreateEmailMutation'; export * from './useUpdateEmailMutation'; export * from './useDeleteEmailMutation'; @@ -23,18 +29,21 @@ export * from './useCreateRoleTypeMutation'; export * from './useUpdateRoleTypeMutation'; export * from './useDeleteRoleTypeMutation'; export * from './useCreateUserConnectedAccountMutation'; +export * from './useCreateOrgApiKeyListMutation'; export * from './useCreateUserMutation'; export * from './useUpdateUserMutation'; export * from './useDeleteUserMutation'; export * from './useSignOutMutation'; export * from './useSendAccountDeletionEmailMutation'; export * from './useCheckPasswordMutation'; +export * from './useDeleteOrgPrincipalMutation'; export * from './useDisconnectAccountMutation'; export * from './useRevokeApiKeyMutation'; export * from './useRevokeSessionMutation'; export * from './useVerifyPasswordMutation'; export * from './useVerifyTotpMutation'; export * from './useConfirmDeleteAccountMutation'; +export * from './useRevokeOrgApiKeyMutation'; export * from './useSetPasswordMutation'; export * from './useVerifyEmailMutation'; export * from './useProvisionNewUserMutation'; @@ -45,7 +54,9 @@ export * from './useSignUpSmsMutation'; export * from './useSignUpMutation'; export * from './useSignInMutation'; export * from './useLinkIdentityMutation'; +export * from './useCreateOrgPrincipalMutation'; export * from './useExtendTokenExpiresMutation'; +export * from './useCreateOrgApiKeyMutation'; export * from './useCreateApiKeyMutation'; export * from './useRequestCrossOriginTokenMutation'; export * from './useForgotPasswordMutation'; diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts new file mode 100644 index 0000000000..8ee7097912 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyListMutation.ts @@ -0,0 +1,88 @@ +/** + * Create mutation hook for OrgApiKeyList + * @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 { orgApiKeyListKeys } from '../query-keys'; +import { orgApiKeyListMutationKeys } from '../mutation-keys'; +import type { + OrgApiKeyListSelect, + OrgApiKeyListWithRelations, + CreateOrgApiKeyListInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + OrgApiKeyListSelect, + OrgApiKeyListWithRelations, + CreateOrgApiKeyListInput, +} from '../../orm/input-types'; +/** + * Mutation hook for creating a OrgApiKeyList + * + * @example + * ```tsx + * const { mutate, isPending } = useCreateOrgApiKeyListMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreateOrgApiKeyListMutation( + params: { + selection: { + fields: S & OrgApiKeyListSelect; + } & HookStrictSelect, OrgApiKeyListSelect>; + } & Omit< + UseMutationOptions< + { + createOrgApiKeyList: { + orgApiKeyList: InferSelectResult; + }; + }, + Error, + CreateOrgApiKeyListInput['orgApiKeyList'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgApiKeyList: { + orgApiKeyList: InferSelectResult; + }; + }, + Error, + CreateOrgApiKeyListInput['orgApiKeyList'] +>; +export function useCreateOrgApiKeyListMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: orgApiKeyListMutationKeys.create(), + mutationFn: (data: CreateOrgApiKeyListInput['orgApiKeyList']) => + getClient() + .orgApiKeyList.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: orgApiKeyListKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts new file mode 100644 index 0000000000..c04772ebde --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgApiKeyMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for createOrgApiKey + * @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 { CreateOrgApiKeyVariables } from '../../orm/mutation'; +import type { CreateOrgApiKeyPayloadSelect, CreateOrgApiKeyPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CreateOrgApiKeyVariables } from '../../orm/mutation'; +export type { CreateOrgApiKeyPayloadSelect } from '../../orm/input-types'; +export function useCreateOrgApiKeyMutation( + params: { + selection: { + fields: S & CreateOrgApiKeyPayloadSelect; + } & HookStrictSelect, CreateOrgApiKeyPayloadSelect>; + } & Omit< + UseMutationOptions< + { + createOrgApiKey: InferSelectResult | null; + }, + Error, + CreateOrgApiKeyVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgApiKey: InferSelectResult | null; + }, + Error, + CreateOrgApiKeyVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.createOrgApiKey(), + mutationFn: (variables: CreateOrgApiKeyVariables) => + getClient() + .mutation.createOrgApiKey(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgPrincipalMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgPrincipalMutation.ts new file mode 100644 index 0000000000..26f019f9cc --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreateOrgPrincipalMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for createOrgPrincipal + * @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 { CreateOrgPrincipalVariables } from '../../orm/mutation'; +import type { + CreateOrgPrincipalPayloadSelect, + CreateOrgPrincipalPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { CreateOrgPrincipalVariables } from '../../orm/mutation'; +export type { CreateOrgPrincipalPayloadSelect } from '../../orm/input-types'; +export function useCreateOrgPrincipalMutation( + params: { + selection: { + fields: S & CreateOrgPrincipalPayloadSelect; + } & HookStrictSelect, CreateOrgPrincipalPayloadSelect>; + } & Omit< + UseMutationOptions< + { + createOrgPrincipal: InferSelectResult | null; + }, + Error, + CreateOrgPrincipalVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + createOrgPrincipal: InferSelectResult | null; + }, + Error, + CreateOrgPrincipalVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.createOrgPrincipal(), + mutationFn: (variables: CreateOrgPrincipalVariables) => + getClient() + .mutation.createOrgPrincipal(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts new file mode 100644 index 0000000000..16edd29ff9 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalEntityMutation.ts @@ -0,0 +1,91 @@ +/** + * Association table scoping principals to specific organizations + * @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 { principalEntityKeys } from '../query-keys'; +import { principalEntityMutationKeys } from '../mutation-keys'; +import type { + PrincipalEntitySelect, + PrincipalEntityWithRelations, + CreatePrincipalEntityInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalEntitySelect, + PrincipalEntityWithRelations, + CreatePrincipalEntityInput, +} from '../../orm/input-types'; +/** + * Association table scoping principals to specific organizations + * + * @example + * ```tsx + * const { mutate, isPending } = useCreatePrincipalEntityMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreatePrincipalEntityMutation( + params: { + selection: { + fields: S & PrincipalEntitySelect; + } & HookStrictSelect, PrincipalEntitySelect>; + } & Omit< + UseMutationOptions< + { + createPrincipalEntity: { + principalEntity: InferSelectResult; + }; + }, + Error, + CreatePrincipalEntityInput['principalEntity'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPrincipalEntity: { + principalEntity: InferSelectResult; + }; + }, + Error, + CreatePrincipalEntityInput['principalEntity'] +>; +export function useCreatePrincipalEntityMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: principalEntityMutationKeys.create(), + mutationFn: (data: CreatePrincipalEntityInput['principalEntity']) => + getClient() + .principalEntity.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: principalEntityKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts new file mode 100644 index 0000000000..6b805d782c --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts @@ -0,0 +1,88 @@ +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * @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 { principalKeys } from '../query-keys'; +import { principalMutationKeys } from '../mutation-keys'; +import type { + PrincipalSelect, + PrincipalWithRelations, + CreatePrincipalInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalSelect, + PrincipalWithRelations, + CreatePrincipalInput, +} from '../../orm/input-types'; +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```tsx + * const { mutate, isPending } = useCreatePrincipalMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreatePrincipalMutation( + params: { + selection: { + fields: S & PrincipalSelect; + } & HookStrictSelect, PrincipalSelect>; + } & Omit< + UseMutationOptions< + { + createPrincipal: { + principal: InferSelectResult; + }; + }, + Error, + CreatePrincipalInput['principal'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPrincipal: { + principal: InferSelectResult; + }; + }, + Error, + CreatePrincipalInput['principal'] +>; +export function useCreatePrincipalMutation( + params: { + selection: SelectionConfig; + } & Omit, 'mutationFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: principalMutationKeys.create(), + mutationFn: (data: CreatePrincipalInput['principal']) => + getClient() + .principal.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: principalKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts new file mode 100644 index 0000000000..c54e6183dd --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalScopeOverrideMutation.ts @@ -0,0 +1,91 @@ +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * @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 { principalScopeOverrideKeys } from '../query-keys'; +import { principalScopeOverrideMutationKeys } from '../mutation-keys'; +import type { + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideWithRelations, + CreatePrincipalScopeOverrideInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideWithRelations, + CreatePrincipalScopeOverrideInput, +} from '../../orm/input-types'; +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * + * @example + * ```tsx + * const { mutate, isPending } = useCreatePrincipalScopeOverrideMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreatePrincipalScopeOverrideMutation( + params: { + selection: { + fields: S & PrincipalScopeOverrideSelect; + } & HookStrictSelect, PrincipalScopeOverrideSelect>; + } & Omit< + UseMutationOptions< + { + createPrincipalScopeOverride: { + principalScopeOverride: InferSelectResult; + }; + }, + Error, + CreatePrincipalScopeOverrideInput['principalScopeOverride'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPrincipalScopeOverride: { + principalScopeOverride: InferSelectResult; + }; + }, + Error, + CreatePrincipalScopeOverrideInput['principalScopeOverride'] +>; +export function useCreatePrincipalScopeOverrideMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: principalScopeOverrideMutationKeys.create(), + mutationFn: (data: CreatePrincipalScopeOverrideInput['principalScopeOverride']) => + getClient() + .principalScopeOverride.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: principalScopeOverrideKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts new file mode 100644 index 0000000000..a5fd0a0422 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeleteOrgPrincipalMutation.ts @@ -0,0 +1,58 @@ +/** + * Custom mutation hook for deleteOrgPrincipal + * @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 { DeleteOrgPrincipalVariables } from '../../orm/mutation'; +import type { + DeleteOrgPrincipalPayloadSelect, + DeleteOrgPrincipalPayload, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { DeleteOrgPrincipalVariables } from '../../orm/mutation'; +export type { DeleteOrgPrincipalPayloadSelect } from '../../orm/input-types'; +export function useDeleteOrgPrincipalMutation( + params: { + selection: { + fields: S & DeleteOrgPrincipalPayloadSelect; + } & HookStrictSelect, DeleteOrgPrincipalPayloadSelect>; + } & Omit< + UseMutationOptions< + { + deleteOrgPrincipal: InferSelectResult | null; + }, + Error, + DeleteOrgPrincipalVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + deleteOrgPrincipal: InferSelectResult | null; + }, + Error, + DeleteOrgPrincipalVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.deleteOrgPrincipal(), + mutationFn: (variables: DeleteOrgPrincipalVariables) => + getClient() + .mutation.deleteOrgPrincipal(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts new file mode 100644 index 0000000000..f084cb2466 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalEntityMutation.ts @@ -0,0 +1,98 @@ +/** + * Association table scoping principals to specific organizations + * @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 { principalEntityKeys } from '../query-keys'; +import { principalEntityMutationKeys } from '../mutation-keys'; +import type { PrincipalEntitySelect, PrincipalEntityWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PrincipalEntitySelect, PrincipalEntityWithRelations } from '../../orm/input-types'; +/** + * Association table scoping principals to specific organizations + * + * @example + * ```tsx + * const { mutate, isPending } = useDeletePrincipalEntityMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeletePrincipalEntityMutation( + params: { + selection: { + fields: S & PrincipalEntitySelect; + } & HookStrictSelect, PrincipalEntitySelect>; + } & Omit< + UseMutationOptions< + { + deletePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePrincipalEntityMutation( + 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: principalEntityMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .principalEntity.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: principalEntityKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: principalEntityKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts new file mode 100644 index 0000000000..80296db9fb --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useDeletePrincipalMutation.ts @@ -0,0 +1,98 @@ +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * @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 { principalKeys } from '../query-keys'; +import { principalMutationKeys } from '../mutation-keys'; +import type { PrincipalSelect, PrincipalWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PrincipalSelect, PrincipalWithRelations } from '../../orm/input-types'; +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```tsx + * const { mutate, isPending } = useDeletePrincipalMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ principalId: 'value-to-delete' }); + * ``` + */ +export function useDeletePrincipalMutation( + params: { + selection: { + fields: S & PrincipalSelect; + } & HookStrictSelect, PrincipalSelect>; + } & Omit< + UseMutationOptions< + { + deletePrincipal: { + principal: InferSelectResult; + }; + }, + Error, + { + principalId: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePrincipal: { + principal: InferSelectResult; + }; + }, + Error, + { + principalId: string; + } +>; +export function useDeletePrincipalMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + principalId: string; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: principalMutationKeys.all, + mutationFn: ({ principalId }: { principalId: string }) => + getClient() + .principal.delete({ + where: { + principalId, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: principalKeys.detail(variables.principalId), + }); + queryClient.invalidateQueries({ + queryKey: principalKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts new file mode 100644 index 0000000000..69d97ad4c7 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useRevokeOrgApiKeyMutation.ts @@ -0,0 +1,55 @@ +/** + * Custom mutation hook for revokeOrgApiKey + * @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 { RevokeOrgApiKeyVariables } from '../../orm/mutation'; +import type { RevokeOrgApiKeyPayloadSelect, RevokeOrgApiKeyPayload } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect, StrictSelect } from '../../orm/select-types'; +export type { RevokeOrgApiKeyVariables } from '../../orm/mutation'; +export type { RevokeOrgApiKeyPayloadSelect } from '../../orm/input-types'; +export function useRevokeOrgApiKeyMutation( + params: { + selection: { + fields: S & RevokeOrgApiKeyPayloadSelect; + } & HookStrictSelect, RevokeOrgApiKeyPayloadSelect>; + } & Omit< + UseMutationOptions< + { + revokeOrgApiKey: InferSelectResult | null; + }, + Error, + RevokeOrgApiKeyVariables + >, + 'mutationFn' + > +): UseMutationResult< + { + revokeOrgApiKey: InferSelectResult | null; + }, + Error, + RevokeOrgApiKeyVariables +> { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + return useMutation({ + mutationKey: customMutationKeys.revokeOrgApiKey(), + mutationFn: (variables: RevokeOrgApiKeyVariables) => + getClient() + .mutation.revokeOrgApiKey(variables, { + select: args.select, + } as { + select: S; + } & StrictSelect) + .unwrap(), + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts b/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts new file mode 100644 index 0000000000..3c6e55c0a1 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/mutations/useUpdatePrincipalEntityMutation.ts @@ -0,0 +1,116 @@ +/** + * Association table scoping principals to specific organizations + * @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 { principalEntityKeys } from '../query-keys'; +import { principalEntityMutationKeys } from '../mutation-keys'; +import type { + PrincipalEntitySelect, + PrincipalEntityWithRelations, + PrincipalEntityPatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalEntitySelect, + PrincipalEntityWithRelations, + PrincipalEntityPatch, +} from '../../orm/input-types'; +/** + * Association table scoping principals to specific organizations + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdatePrincipalEntityMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', principalEntityPatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdatePrincipalEntityMutation( + params: { + selection: { + fields: S & PrincipalEntitySelect; + } & HookStrictSelect, PrincipalEntitySelect>; + } & Omit< + UseMutationOptions< + { + updatePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }, + Error, + { + id: string; + principalEntityPatch: PrincipalEntityPatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }, + Error, + { + id: string; + principalEntityPatch: PrincipalEntityPatch; + } +>; +export function useUpdatePrincipalEntityMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + principalEntityPatch: PrincipalEntityPatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: principalEntityMutationKeys.all, + mutationFn: ({ + id, + principalEntityPatch, + }: { + id: string; + principalEntityPatch: PrincipalEntityPatch; + }) => + getClient() + .principalEntity.update({ + where: { + id, + }, + data: principalEntityPatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: principalEntityKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: principalEntityKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/index.ts b/sdk/constructive-react/src/auth/hooks/queries/index.ts index 1360e7d8da..75187fba9a 100644 --- a/sdk/constructive-react/src/auth/hooks/queries/index.ts +++ b/sdk/constructive-react/src/auth/hooks/queries/index.ts @@ -3,6 +3,12 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ +export * from './usePrincipalsQuery'; +export * from './usePrincipalQuery'; +export * from './usePrincipalEntitiesQuery'; +export * from './usePrincipalEntityQuery'; +export * from './usePrincipalScopeOverridesQuery'; +export * from './usePrincipalScopeOverrideQuery'; export * from './useEmailsQuery'; export * from './useEmailQuery'; export * from './usePhoneNumbersQuery'; @@ -18,10 +24,12 @@ export * from './useRoleTypesQuery'; export * from './useRoleTypeQuery'; export * from './useUserConnectedAccountsQuery'; export * from './useUserConnectedAccountQuery'; +export * from './useOrgApiKeyListsQuery'; +export * from './useOrgApiKeyListQuery'; export * from './useUsersQuery'; export * from './useUserQuery'; export * from './useCurrentUserAgentQuery'; -export * from './useCurrentIpAddressQuery'; export * from './useCurrentUserIdQuery'; +export * from './useCurrentIpAddressQuery'; export * from './useRequireStepUpQuery'; export * from './useCurrentUserQuery'; diff --git a/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts new file mode 100644 index 0000000000..77ac426fde --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListQuery.ts @@ -0,0 +1,138 @@ +/** + * Single item query hook for OrgApiKeyList + * @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 { orgApiKeyListKeys } from '../query-keys'; +import type { OrgApiKeyListSelect, OrgApiKeyListWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { OrgApiKeyListSelect, OrgApiKeyListWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const orgApiKeyListQueryKey = orgApiKeyListKeys.detail; +/** + * Query hook for fetching a single OrgApiKeyList + * + * @example + * ```tsx + * const { data, isLoading } = useOrgApiKeyListQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function useOrgApiKeyListQuery< + S extends OrgApiKeyListSelect, + TData = { + orgApiKeyList: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgApiKeyListSelect>; + } & Omit< + UseQueryOptions< + { + orgApiKeyList: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgApiKeyListQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: orgApiKeyListKeys.detail(params.id), + queryFn: () => + getClient() + .orgApiKeyList.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Fetch a single OrgApiKeyList without React hooks + * + * @example + * ```ts + * const data = await fetchOrgApiKeyListQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchOrgApiKeyListQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgApiKeyListSelect>; +}): Promise<{ + orgApiKeyList: InferSelectResult | null; +}>; +export async function fetchOrgApiKeyListQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .orgApiKeyList.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Prefetch a single OrgApiKeyList for SSR or cache warming + * + * @example + * ```ts + * await prefetchOrgApiKeyListQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchOrgApiKeyListQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, OrgApiKeyListSelect>; + } +): Promise; +export async function prefetchOrgApiKeyListQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: orgApiKeyListKeys.detail(params.id), + queryFn: () => + getClient() + .orgApiKeyList.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListsQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListsQuery.ts new file mode 100644 index 0000000000..3657e56ab4 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/useOrgApiKeyListsQuery.ts @@ -0,0 +1,151 @@ +/** + * List query hook for OrgApiKeyList + * @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 { orgApiKeyListKeys } from '../query-keys'; +import type { + OrgApiKeyListSelect, + OrgApiKeyListWithRelations, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + OrgApiKeyListSelect, + OrgApiKeyListWithRelations, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const orgApiKeyListsQueryKey = orgApiKeyListKeys.list; +/** + * Query hook for fetching OrgApiKeyList list + * + * @example + * ```tsx + * const { data, isLoading } = useOrgApiKeyListsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function useOrgApiKeyListsQuery< + S extends OrgApiKeyListSelect, + TData = { + orgApiKeyLists: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgApiKeyListSelect>; + } & Omit< + UseQueryOptions< + { + orgApiKeyLists: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function useOrgApiKeyListsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + OrgApiKeyListSelect, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: orgApiKeyListKeys.list(args), + queryFn: () => getClient().orgApiKeyList.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Fetch OrgApiKeyList list without React hooks + * + * @example + * ```ts + * const data = await fetchOrgApiKeyListsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchOrgApiKeyListsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgApiKeyListSelect>; +}): Promise<{ + orgApiKeyLists: ConnectionResult>; +}>; +export async function fetchOrgApiKeyListsQuery(params: { + selection: ListSelectionConfig; +}) { + const args = buildListSelectionArgs< + OrgApiKeyListSelect, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy + >(params.selection); + return getClient().orgApiKeyList.findMany(args).unwrap(); +} +/** + * Prefetch OrgApiKeyList list for SSR or cache warming + * + * @example + * ```ts + * await prefetchOrgApiKeyListsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchOrgApiKeyListsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, OrgApiKeyListSelect>; + } +): Promise; +export async function prefetchOrgApiKeyListsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs< + OrgApiKeyListSelect, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: orgApiKeyListKeys.list(args), + queryFn: () => getClient().orgApiKeyList.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntitiesQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntitiesQuery.ts new file mode 100644 index 0000000000..0b56b03bcf --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntitiesQuery.ts @@ -0,0 +1,163 @@ +/** + * Association table scoping principals to specific organizations + * @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 { principalEntityKeys } from '../query-keys'; +import type { + PrincipalEntitySelect, + PrincipalEntityWithRelations, + PrincipalEntityFilter, + PrincipalEntityOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PrincipalEntitySelect, + PrincipalEntityWithRelations, + PrincipalEntityFilter, + PrincipalEntityOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalEntitiesQueryKey = principalEntityKeys.list; +/** + * Association table scoping principals to specific organizations + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalEntitiesQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function usePrincipalEntitiesQuery< + S extends PrincipalEntitySelect, + TData = { + principalEntities: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalEntitySelect>; + } & Omit< + UseQueryOptions< + { + principalEntities: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalEntitiesQuery( + params: { + selection: ListSelectionConfig< + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalEntityKeys.list(args), + queryFn: () => getClient().principalEntity.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Association table scoping principals to specific organizations + * + * @example + * ```ts + * const data = await fetchPrincipalEntitiesQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchPrincipalEntitiesQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalEntitySelect>; +}): Promise<{ + principalEntities: ConnectionResult>; +}>; +export async function fetchPrincipalEntitiesQuery(params: { + selection: ListSelectionConfig< + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy + >; +}) { + const args = buildListSelectionArgs< + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy + >(params.selection); + return getClient().principalEntity.findMany(args).unwrap(); +} +/** + * Association table scoping principals to specific organizations + * + * @example + * ```ts + * await prefetchPrincipalEntitiesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchPrincipalEntitiesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalEntitySelect>; + } +): Promise; +export async function prefetchPrincipalEntitiesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: principalEntityKeys.list(args), + queryFn: () => getClient().principalEntity.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntityQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntityQuery.ts new file mode 100644 index 0000000000..dac8ed3dce --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalEntityQuery.ts @@ -0,0 +1,138 @@ +/** + * Association table scoping principals to specific organizations + * @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 { principalEntityKeys } from '../query-keys'; +import type { PrincipalEntitySelect, PrincipalEntityWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PrincipalEntitySelect, PrincipalEntityWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalEntityQueryKey = principalEntityKeys.detail; +/** + * Association table scoping principals to specific organizations + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalEntityQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function usePrincipalEntityQuery< + S extends PrincipalEntitySelect, + TData = { + principalEntity: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalEntitySelect>; + } & Omit< + UseQueryOptions< + { + principalEntity: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalEntityQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalEntityKeys.detail(params.id), + queryFn: () => + getClient() + .principalEntity.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Association table scoping principals to specific organizations + * + * @example + * ```ts + * const data = await fetchPrincipalEntityQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchPrincipalEntityQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalEntitySelect>; +}): Promise<{ + principalEntity: InferSelectResult | null; +}>; +export async function fetchPrincipalEntityQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .principalEntity.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Association table scoping principals to specific organizations + * + * @example + * ```ts + * await prefetchPrincipalEntityQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchPrincipalEntityQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalEntitySelect>; + } +): Promise; +export async function prefetchPrincipalEntityQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: principalEntityKeys.detail(params.id), + queryFn: () => + getClient() + .principalEntity.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalQuery.ts new file mode 100644 index 0000000000..14b3d0a9d2 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalQuery.ts @@ -0,0 +1,138 @@ +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * @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 { principalKeys } from '../query-keys'; +import type { PrincipalSelect, PrincipalWithRelations } from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { PrincipalSelect, PrincipalWithRelations } from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalQueryKey = principalKeys.detail; +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalQuery({ + * principalId: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function usePrincipalQuery< + S extends PrincipalSelect, + TData = { + principal: InferSelectResult | null; + }, +>( + params: { + principalId: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalSelect>; + } & Omit< + UseQueryOptions< + { + principal: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalQuery( + params: { + principalId: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalKeys.detail(params.principalId), + queryFn: () => + getClient() + .principal.findOne({ + principalId: params.principalId, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```ts + * const data = await fetchPrincipalQuery({ + * principalId: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchPrincipalQuery(params: { + principalId: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalSelect>; +}): Promise<{ + principal: InferSelectResult | null; +}>; +export async function fetchPrincipalQuery(params: { + principalId: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .principal.findOne({ + principalId: params.principalId, + select: args.select, + }) + .unwrap(); +} +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```ts + * await prefetchPrincipalQuery(queryClient, { principalId: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchPrincipalQuery( + queryClient: QueryClient, + params: { + principalId: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalSelect>; + } +): Promise; +export async function prefetchPrincipalQuery( + queryClient: QueryClient, + params: { + principalId: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: principalKeys.detail(params.principalId), + queryFn: () => + getClient() + .principal.findOne({ + principalId: params.principalId, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverrideQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverrideQuery.ts new file mode 100644 index 0000000000..9930844113 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverrideQuery.ts @@ -0,0 +1,146 @@ +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * @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 { principalScopeOverrideKeys } from '../query-keys'; +import type { + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalScopeOverrideQueryKey = principalScopeOverrideKeys.detail; +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalScopeOverrideQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function usePrincipalScopeOverrideQuery< + S extends PrincipalScopeOverrideSelect, + TData = { + principalScopeOverride: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalScopeOverrideSelect>; + } & Omit< + UseQueryOptions< + { + principalScopeOverride: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalScopeOverrideQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalScopeOverrideKeys.detail(params.id), + queryFn: () => + getClient() + .principalScopeOverride.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * + * @example + * ```ts + * const data = await fetchPrincipalScopeOverrideQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchPrincipalScopeOverrideQuery< + S extends PrincipalScopeOverrideSelect, +>(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalScopeOverrideSelect>; +}): Promise<{ + principalScopeOverride: InferSelectResult | null; +}>; +export async function fetchPrincipalScopeOverrideQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .principalScopeOverride.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * + * @example + * ```ts + * await prefetchPrincipalScopeOverrideQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchPrincipalScopeOverrideQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalScopeOverrideSelect>; + } +): Promise; +export async function prefetchPrincipalScopeOverrideQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: principalScopeOverrideKeys.detail(params.id), + queryFn: () => + getClient() + .principalScopeOverride.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverridesQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverridesQuery.ts new file mode 100644 index 0000000000..521c5fdee6 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalScopeOverridesQuery.ts @@ -0,0 +1,180 @@ +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * @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 { principalScopeOverrideKeys } from '../query-keys'; +import type { + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideWithRelations, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideWithRelations, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalScopeOverridesQueryKey = principalScopeOverrideKeys.list; +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalScopeOverridesQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function usePrincipalScopeOverridesQuery< + S extends PrincipalScopeOverrideSelect, + TData = { + principalScopeOverrides: ConnectionResult< + InferSelectResult + >; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalScopeOverrideSelect>; + } & Omit< + UseQueryOptions< + { + principalScopeOverrides: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalScopeOverridesQuery( + params: { + selection: ListSelectionConfig< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalScopeOverrideKeys.list(args), + queryFn: () => getClient().principalScopeOverride.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * + * @example + * ```ts + * const data = await fetchPrincipalScopeOverridesQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchPrincipalScopeOverridesQuery< + S extends PrincipalScopeOverrideSelect, +>(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalScopeOverrideSelect>; +}): Promise<{ + principalScopeOverrides: ConnectionResult< + InferSelectResult + >; +}>; +export async function fetchPrincipalScopeOverridesQuery(params: { + selection: ListSelectionConfig< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + >; +}) { + const args = buildListSelectionArgs< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + >(params.selection); + return getClient().principalScopeOverride.findMany(args).unwrap(); +} +/** + * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. + * + * @example + * ```ts + * await prefetchPrincipalScopeOverridesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchPrincipalScopeOverridesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalScopeOverrideSelect>; + } +): Promise; +export async function prefetchPrincipalScopeOverridesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: principalScopeOverrideKeys.list(args), + queryFn: () => getClient().principalScopeOverride.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/queries/usePrincipalsQuery.ts b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalsQuery.ts new file mode 100644 index 0000000000..1561904175 --- /dev/null +++ b/sdk/constructive-react/src/auth/hooks/queries/usePrincipalsQuery.ts @@ -0,0 +1,145 @@ +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * @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 { principalKeys } from '../query-keys'; +import type { + PrincipalSelect, + PrincipalWithRelations, + PrincipalFilter, + PrincipalOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PrincipalSelect, + PrincipalWithRelations, + PrincipalFilter, + PrincipalOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalsQueryKey = principalKeys.list; +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalsQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function usePrincipalsQuery< + S extends PrincipalSelect, + TData = { + principals: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalSelect>; + } & Omit< + UseQueryOptions< + { + principals: ConnectionResult>; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalsQuery( + params: { + selection: ListSelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs( + params.selection + ); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalKeys.list(args), + queryFn: () => getClient().principal.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```ts + * const data = await fetchPrincipalsQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchPrincipalsQuery(params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalSelect>; +}): Promise<{ + principals: ConnectionResult>; +}>; +export async function fetchPrincipalsQuery(params: { + selection: ListSelectionConfig; +}) { + const args = buildListSelectionArgs( + params.selection + ); + return getClient().principal.findMany(args).unwrap(); +} +/** + * Scoped sub-identities (API keys and agents) with precomputed SPRT + * + * @example + * ```ts + * await prefetchPrincipalsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchPrincipalsQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit, 'fields'> & + HookStrictSelect, PrincipalSelect>; + } +): Promise; +export async function prefetchPrincipalsQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig; + } +): Promise { + const args = buildListSelectionArgs( + params.selection + ); + await queryClient.prefetchQuery({ + queryKey: principalKeys.list(args), + queryFn: () => getClient().principal.findMany(args).unwrap(), + }); +} diff --git a/sdk/constructive-react/src/auth/hooks/query-keys.ts b/sdk/constructive-react/src/auth/hooks/query-keys.ts index 32d6a1591b..316406bf6d 100644 --- a/sdk/constructive-react/src/auth/hooks/query-keys.ts +++ b/sdk/constructive-react/src/auth/hooks/query-keys.ts @@ -19,6 +19,33 @@ // Entity Query Keys // ============================================================================ +export const principalKeys = { + /** All principal queries */ all: ['principal'] as const, + /** List query keys */ lists: () => [...principalKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...principalKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...principalKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...principalKeys.details(), id] as const, +} as const; +export const principalEntityKeys = { + /** All principalEntity queries */ all: ['principalentity'] as const, + /** List query keys */ lists: () => [...principalEntityKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...principalEntityKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...principalEntityKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...principalEntityKeys.details(), id] as const, +} as const; +export const principalScopeOverrideKeys = { + /** All principalScopeOverride queries */ all: ['principalscopeoverride'] as const, + /** List query keys */ lists: () => [...principalScopeOverrideKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...principalScopeOverrideKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...principalScopeOverrideKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...principalScopeOverrideKeys.details(), id] as const, +} as const; export const emailKeys = { /** All email queries */ all: ['email'] as const, /** List query keys */ lists: () => [...emailKeys.all, 'list'] as const, @@ -91,6 +118,15 @@ export const userConnectedAccountKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...userConnectedAccountKeys.details(), id] as const, } as const; +export const orgApiKeyListKeys = { + /** All orgApiKeyList queries */ all: ['orgapikeylist'] as const, + /** List query keys */ lists: () => [...orgApiKeyListKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...orgApiKeyListKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...orgApiKeyListKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...orgApiKeyListKeys.details(), id] as const, +} as const; export const userKeys = { /** All user queries */ all: ['user'] as const, /** List query keys */ lists: () => [...userKeys.all, 'list'] as const, @@ -107,8 +143,8 @@ export const userKeys = { export const customQueryKeys = { /** Query key for currentUserAgent */ currentUserAgent: () => ['currentUserAgent'] as const, - /** Query key for currentIpAddress */ currentIpAddress: () => ['currentIpAddress'] as const, /** Query key for currentUserId */ currentUserId: () => ['currentUserId'] as const, + /** Query key for currentIpAddress */ currentIpAddress: () => ['currentIpAddress'] as const, /** Query key for requireStepUp */ requireStepUp: (variables?: object) => ['requireStepUp', variables] as const, /** Query key for currentUser */ currentUser: () => ['currentUser'] as const, @@ -136,6 +172,9 @@ export const customQueryKeys = { * ``` */ export const queryKeys = { + principal: principalKeys, + principalEntity: principalEntityKeys, + principalScopeOverride: principalScopeOverrideKeys, email: emailKeys, phoneNumber: phoneNumberKeys, cryptoAddress: cryptoAddressKeys, @@ -144,6 +183,7 @@ export const queryKeys = { identityProvider: identityProviderKeys, roleType: roleTypeKeys, userConnectedAccount: userConnectedAccountKeys, + orgApiKeyList: orgApiKeyListKeys, user: userKeys, custom: customQueryKeys, } as const; diff --git a/sdk/constructive-react/src/auth/orm/README.md b/sdk/constructive-react/src/auth/orm/README.md index 68bf0ce72d..343ccbb2bd 100644 --- a/sdk/constructive-react/src/auth/orm/README.md +++ b/sdk/constructive-react/src/auth/orm/README.md @@ -21,6 +21,9 @@ const db = createClient({ | Model | Operations | |-------|------------| +| `principal` | findMany, findOne, create, update, delete | +| `principalEntity` | findMany, findOne, create, update, delete | +| `principalScopeOverride` | findMany, findOne, create, update, delete | | `email` | findMany, findOne, create, update, delete | | `phoneNumber` | findMany, findOne, create, update, delete | | `cryptoAddress` | findMany, findOne, create, update, delete | @@ -29,10 +32,118 @@ const db = createClient({ | `identityProvider` | findMany, findOne, create, update, delete | | `roleType` | findMany, findOne, create, update, delete | | `userConnectedAccount` | findMany, findOne, create, update, delete | +| `orgApiKeyList` | findMany, findOne, create, update, delete | | `user` | findMany, findOne, create, update, delete | ## Table Operations +### `db.principal` + +CRUD operations for Principal records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `ownerId` | UUID | Yes | +| `userId` | UUID | Yes | +| `name` | String | Yes | +| `allowedMask` | BitString | Yes | +| `isReadOnly` | Boolean | Yes | +| `bypassStepUp` | Boolean | Yes | + +**Operations:** + +```typescript +// List all principal records +const items = await db.principal.findMany({ select: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }).execute(); + +// Get one by principalId +const item = await db.principal.findOne({ principalId: '', select: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }).execute(); + +// Create +const created = await db.principal.create({ data: { id: '', ownerId: '', userId: '', name: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' }, select: { principalId: true } }).execute(); + +// Update +const updated = await db.principal.update({ where: { principalId: '' }, data: { id: '' }, select: { principalId: true } }).execute(); + +// Delete +const deleted = await db.principal.delete({ where: { principalId: '' } }).execute(); +``` + +### `db.principalEntity` + +CRUD operations for PrincipalEntity records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `principalId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `ownerId` | UUID | Yes | + +**Operations:** + +```typescript +// List all principalEntity records +const items = await db.principalEntity.findMany({ select: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }).execute(); + +// Get one by id +const item = await db.principalEntity.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }).execute(); + +// Create +const created = await db.principalEntity.create({ data: { principalId: '', entityId: '', ownerId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalEntity.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalEntity.delete({ where: { id: '' } }).execute(); +``` + +### `db.principalScopeOverride` + +CRUD operations for PrincipalScopeOverride records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `principalId` | UUID | Yes | +| `membershipType` | Int | Yes | +| `allowedMask` | BitString | Yes | +| `isAdmin` | Boolean | Yes | +| `isReadOnly` | Boolean | Yes | + +**Operations:** + +```typescript +// List all principalScopeOverride records +const items = await db.principalScopeOverride.findMany({ select: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }).execute(); + +// Get one by id +const item = await db.principalScopeOverride.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }).execute(); + +// Create +const created = await db.principalScopeOverride.create({ data: { principalId: '', membershipType: '', allowedMask: '', isAdmin: '', isReadOnly: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalScopeOverride.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalScopeOverride.delete({ where: { id: '' } }).execute(); +``` + ### `db.email` CRUD operations for Email records. @@ -319,6 +430,46 @@ const updated = await db.userConnectedAccount.update({ where: { id: '' }, const deleted = await db.userConnectedAccount.delete({ where: { id: '' } }).execute(); ``` +### `db.orgApiKeyList` + +CRUD operations for OrgApiKeyList records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `keyId` | String | Yes | +| `name` | String | Yes | +| `principalId` | UUID | Yes | +| `orgId` | UUID | Yes | +| `expiresAt` | Datetime | Yes | +| `revokedAt` | Datetime | Yes | +| `lastUsedAt` | Datetime | Yes | +| `mfaLevel` | String | Yes | +| `accessLevel` | String | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | + +**Operations:** + +```typescript +// List all orgApiKeyList records +const items = await db.orgApiKeyList.findMany({ select: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }).execute(); + +// Get one by id +const item = await db.orgApiKeyList.findOne({ id: '', select: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }).execute(); + +// Create +const created = await db.orgApiKeyList.create({ data: { keyId: '', name: '', principalId: '', orgId: '', expiresAt: '', revokedAt: '', lastUsedAt: '', mfaLevel: '', accessLevel: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgApiKeyList.update({ where: { id: '' }, data: { keyId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgApiKeyList.delete({ where: { id: '' } }).execute(); +``` + ### `db.user` CRUD operations for User records. @@ -374,26 +525,26 @@ currentUserAgent const result = await db.query.currentUserAgent().execute(); ``` -### `db.query.currentIpAddress` +### `db.query.currentUserId` -currentIpAddress +currentUserId - **Type:** query - **Arguments:** none ```typescript -const result = await db.query.currentIpAddress().execute(); +const result = await db.query.currentUserId().execute(); ``` -### `db.query.currentUserId` +### `db.query.currentIpAddress` -currentUserId +currentIpAddress - **Type:** query - **Arguments:** none ```typescript -const result = await db.query.currentUserId().execute(); +const result = await db.query.currentIpAddress().execute(); ``` ### `db.query.requireStepUp` @@ -467,6 +618,21 @@ checkPassword const result = await db.mutation.checkPassword({ input: { password: '' } }).execute(); ``` +### `db.mutation.deleteOrgPrincipal` + +deleteOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | DeleteOrgPrincipalInput (required) | + +```typescript +const result = await db.mutation.deleteOrgPrincipal({ input: { principalId: '' } }).execute(); +``` + ### `db.mutation.disconnectAccount` disconnectAccount @@ -557,6 +723,21 @@ confirmDeleteAccount const result = await db.mutation.confirmDeleteAccount({ input: { userId: '', token: '' } }).execute(); ``` +### `db.mutation.revokeOrgApiKey` + +revokeOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | RevokeOrgApiKeyInput (required) | + +```typescript +const result = await db.mutation.revokeOrgApiKey({ input: { keyId: '', orgId: '' } }).execute(); +``` + ### `db.mutation.setPassword` setPassword @@ -707,6 +888,21 @@ linkIdentity const result = await db.mutation.linkIdentity({ input: { service: '', identifier: '', details: '' } }).execute(); ``` +### `db.mutation.createOrgPrincipal` + +createOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgPrincipalInput (required) | + +```typescript +const result = await db.mutation.createOrgPrincipal({ input: { name: '', orgId: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' } }).execute(); +``` + ### `db.mutation.extendTokenExpires` extendTokenExpires @@ -722,6 +918,21 @@ extendTokenExpires const result = await db.mutation.extendTokenExpires({ input: { amount: '' } }).execute(); ``` +### `db.mutation.createOrgApiKey` + +createOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgApiKeyInput (required) | + +```typescript +const result = await db.mutation.createOrgApiKey({ input: '' }).execute(); +``` + ### `db.mutation.createApiKey` createApiKey @@ -734,7 +945,7 @@ createApiKey | `input` | CreateApiKeyInput (required) | ```typescript -const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '' } }).execute(); +const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '', principalId: '' } }).execute(); ``` ### `db.mutation.requestCrossOriginToken` diff --git a/sdk/constructive-react/src/auth/orm/index.ts b/sdk/constructive-react/src/auth/orm/index.ts index 35448d7362..f3ecc5703a 100644 --- a/sdk/constructive-react/src/auth/orm/index.ts +++ b/sdk/constructive-react/src/auth/orm/index.ts @@ -5,6 +5,9 @@ */ import { OrmClient } from './client'; import type { OrmClientConfig } from './client'; +import { PrincipalModel } from './models/principal'; +import { PrincipalEntityModel } from './models/principalEntity'; +import { PrincipalScopeOverrideModel } from './models/principalScopeOverride'; import { EmailModel } from './models/email'; import { PhoneNumberModel } from './models/phoneNumber'; import { CryptoAddressModel } from './models/cryptoAddress'; @@ -13,6 +16,7 @@ import { AuditLogAuthModel } from './models/auditLogAuth'; import { IdentityProviderModel } from './models/identityProvider'; import { RoleTypeModel } from './models/roleType'; import { UserConnectedAccountModel } from './models/userConnectedAccount'; +import { OrgApiKeyListModel } from './models/orgApiKeyList'; import { UserModel } from './models/user'; import { createQueryOperations } from './query'; import { createMutationOperations } from './mutation'; @@ -49,6 +53,9 @@ export { createMutationOperations } from './mutation'; export function createClient(config: OrmClientConfig) { const client = new OrmClient(config); return { + principal: new PrincipalModel(client), + principalEntity: new PrincipalEntityModel(client), + principalScopeOverride: new PrincipalScopeOverrideModel(client), email: new EmailModel(client), phoneNumber: new PhoneNumberModel(client), cryptoAddress: new CryptoAddressModel(client), @@ -57,6 +64,7 @@ export function createClient(config: OrmClientConfig) { identityProvider: new IdentityProviderModel(client), roleType: new RoleTypeModel(client), userConnectedAccount: new UserConnectedAccountModel(client), + orgApiKeyList: new OrgApiKeyListModel(client), user: new UserModel(client), query: createQueryOperations(client), mutation: createMutationOperations(client), diff --git a/sdk/constructive-react/src/auth/orm/input-types.ts b/sdk/constructive-react/src/auth/orm/input-types.ts index 734fe10c3a..f47ec67005 100644 --- a/sdk/constructive-react/src/auth/orm/input-types.ts +++ b/sdk/constructive-react/src/auth/orm/input-types.ts @@ -235,8 +235,54 @@ export type Base64EncodedBinary = unknown; export type ConstructiveInternalTypeEmail = unknown; export type ConstructiveInternalTypeImage = unknown; export type ConstructiveInternalTypeOrigin = unknown; -/** User email addresses with verification and primary-email management */ +/** Scoped sub-identities (API keys and agents) with precomputed SPRT */ // ============ Entity Types ============ +export interface Principal { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The human user who owns and manages this principal */ + ownerId?: string | null; + /** The user row (type=3 Principal) that represents this principal identity */ + userId?: string | null; + /** Human-readable label for this principal (e.g., billing-bot, ci-deploy-key) */ + name?: string | null; + /** Permission bitmask subset; all-1s means inherit all parent permissions */ + allowedMask?: string | null; + /** Whether this principal is restricted to read-only operations */ + isReadOnly?: boolean | null; + /** Whether this principal bypasses MFA step-up requirements */ + bypassStepUp?: boolean | null; +} +/** Association table scoping principals to specific organizations */ +export interface PrincipalEntity { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The principal this scoping row belongs to */ + principalId?: string | null; + /** The organization this principal is scoped to */ + entityId?: string | null; + /** Denormalized owner_id from principals table for RLS */ + ownerId?: string | null; +} +/** Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. */ +export interface PrincipalScopeOverride { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The principal this override applies to */ + principalId?: string | null; + /** The scope level (membership_type) this override restricts */ + membershipType?: number | null; + /** Permission bitmask for this scope; AND-masked with parent permissions during cascade */ + allowedMask?: string | null; + /** Whether this principal has admin access at this scope (default true = inherit from parent) */ + isAdmin?: boolean | null; + /** Whether this principal is restricted to read-only at this scope */ + isReadOnly?: boolean | null; +} +/** User email addresses with verification and primary-email management */ export interface Email { id: string; ownerId?: string | null; @@ -349,6 +395,20 @@ export interface UserConnectedAccount { createdAt?: string | null; updatedAt?: string | null; } +export interface OrgApiKeyList { + id: string; + keyId?: string | null; + name?: string | null; + principalId?: string | null; + orgId?: string | null; + expiresAt?: string | null; + revokedAt?: string | null; + lastUsedAt?: string | null; + mfaLevel?: string | null; + accessLevel?: string | null; + createdAt?: string | null; + updatedAt?: string | null; +} export interface User { id: string; username?: string | null; @@ -378,6 +438,20 @@ export interface PageInfo { endCursor?: string | null; } // ============ Entity Relation Types ============ +export interface PrincipalRelations { + owner?: User | null; + user?: User | null; + principalEntities?: ConnectionResult; + principalScopeOverrides?: ConnectionResult; +} +export interface PrincipalEntityRelations { + entity?: User | null; + owner?: User | null; + principal?: Principal | null; +} +export interface PrincipalScopeOverrideRelations { + principal?: Principal | null; +} export interface EmailRelations { owner?: User | null; } @@ -396,8 +470,12 @@ export interface AuditLogAuthRelations { export interface IdentityProviderRelations {} export interface RoleTypeRelations {} export interface UserConnectedAccountRelations {} +export interface OrgApiKeyListRelations {} export interface UserRelations { roleType?: RoleType | null; + ownedPrincipals?: ConnectionResult; + principals?: ConnectionResult; + principalEntitiesByEntityId?: ConnectionResult; ownedEmails?: ConnectionResult; ownedPhoneNumbers?: ConnectionResult; ownedCryptoAddresses?: ConnectionResult; @@ -405,6 +483,10 @@ export interface UserRelations { auditLogAuthsByActorId?: ConnectionResult; } // ============ Entity Types With Relations ============ +export type PrincipalWithRelations = Principal & PrincipalRelations; +export type PrincipalEntityWithRelations = PrincipalEntity & PrincipalEntityRelations; +export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & + PrincipalScopeOverrideRelations; export type EmailWithRelations = Email & EmailRelations; export type PhoneNumberWithRelations = PhoneNumber & PhoneNumberRelations; export type CryptoAddressWithRelations = CryptoAddress & CryptoAddressRelations; @@ -414,8 +496,68 @@ export type IdentityProviderWithRelations = IdentityProvider & IdentityProviderR export type RoleTypeWithRelations = RoleType & RoleTypeRelations; export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConnectedAccountRelations; +export type OrgApiKeyListWithRelations = OrgApiKeyList & OrgApiKeyListRelations; export type UserWithRelations = User & UserRelations; // ============ Entity Select Types ============ +export type PrincipalSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + ownerId?: boolean; + userId?: boolean; + name?: boolean; + allowedMask?: boolean; + isReadOnly?: boolean; + bypassStepUp?: boolean; + owner?: { + select: UserSelect; + }; + user?: { + select: UserSelect; + }; + principalEntities?: { + select: PrincipalEntitySelect; + first?: number; + filter?: PrincipalEntityFilter; + orderBy?: PrincipalEntityOrderBy[]; + }; + principalScopeOverrides?: { + select: PrincipalScopeOverrideSelect; + first?: number; + filter?: PrincipalScopeOverrideFilter; + orderBy?: PrincipalScopeOverrideOrderBy[]; + }; +}; +export type PrincipalEntitySelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + principalId?: boolean; + entityId?: boolean; + ownerId?: boolean; + entity?: { + select: UserSelect; + }; + owner?: { + select: UserSelect; + }; + principal?: { + select: PrincipalSelect; + }; +}; +export type PrincipalScopeOverrideSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + principalId?: boolean; + membershipType?: boolean; + allowedMask?: boolean; + isAdmin?: boolean; + isReadOnly?: boolean; + principal?: { + select: PrincipalSelect; + }; +}; export type EmailSelect = { id?: boolean; ownerId?: boolean; @@ -509,6 +651,20 @@ export type UserConnectedAccountSelect = { createdAt?: boolean; updatedAt?: boolean; }; +export type OrgApiKeyListSelect = { + id?: boolean; + keyId?: boolean; + name?: boolean; + principalId?: boolean; + orgId?: boolean; + expiresAt?: boolean; + revokedAt?: boolean; + lastUsedAt?: boolean; + mfaLevel?: boolean; + accessLevel?: boolean; + createdAt?: boolean; + updatedAt?: boolean; +}; export type UserSelect = { id?: boolean; username?: boolean; @@ -524,6 +680,24 @@ export type UserSelect = { roleType?: { select: RoleTypeSelect; }; + ownedPrincipals?: { + select: PrincipalSelect; + first?: number; + filter?: PrincipalFilter; + orderBy?: PrincipalOrderBy[]; + }; + principals?: { + select: PrincipalSelect; + first?: number; + filter?: PrincipalFilter; + orderBy?: PrincipalOrderBy[]; + }; + principalEntitiesByEntityId?: { + select: PrincipalEntitySelect; + first?: number; + filter?: PrincipalEntityFilter; + orderBy?: PrincipalEntityOrderBy[]; + }; ownedEmails?: { select: EmailSelect; first?: number; @@ -556,6 +730,96 @@ export type UserSelect = { }; }; // ============ Table Filter Types ============ +export interface PrincipalFilter { + /** 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 `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `userId` field. */ + userId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Filter by the object’s `bypassStepUp` field. */ + bypassStepUp?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalFilter[]; + /** Negates the expression. */ + not?: PrincipalFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `user` relation. */ + user?: UserFilter; + /** Filter by the object’s `principalEntities` relation. */ + principalEntities?: PrincipalToManyPrincipalEntityFilter; + /** `principalEntities` exist. */ + principalEntitiesExist?: boolean; + /** Filter by the object’s `principalScopeOverrides` relation. */ + principalScopeOverrides?: PrincipalToManyPrincipalScopeOverrideFilter; + /** `principalScopeOverrides` exist. */ + principalScopeOverridesExist?: boolean; +} +export interface PrincipalEntityFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalEntityFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalEntityFilter[]; + /** Negates the expression. */ + not?: PrincipalEntityFilter; + /** Filter by the object’s `entity` relation. */ + entity?: UserFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +export interface PrincipalScopeOverrideFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `membershipType` field. */ + membershipType?: IntFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isAdmin` field. */ + isAdmin?: BooleanFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalScopeOverrideFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalScopeOverrideFilter[]; + /** Negates the expression. */ + not?: PrincipalScopeOverrideFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} export interface EmailFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -756,6 +1020,38 @@ export interface UserConnectedAccountFilter { /** Negates the expression. */ not?: UserConnectedAccountFilter; } +export interface OrgApiKeyListFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `keyId` field. */ + keyId?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `orgId` field. */ + orgId?: UUIDFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Filter by the object’s `revokedAt` field. */ + revokedAt?: DatetimeFilter; + /** Filter by the object’s `lastUsedAt` field. */ + lastUsedAt?: DatetimeFilter; + /** Filter by the object’s `mfaLevel` field. */ + mfaLevel?: StringFilter; + /** Filter by the object’s `accessLevel` field. */ + accessLevel?: StringFilter; + /** 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?: OrgApiKeyListFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgApiKeyListFilter[]; + /** Negates the expression. */ + not?: OrgApiKeyListFilter; +} export interface UserFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -781,6 +1077,18 @@ export interface UserFilter { not?: UserFilter; /** Filter by the object’s `roleType` relation. */ roleType?: RoleTypeFilter; + /** Filter by the object’s `ownedPrincipals` relation. */ + ownedPrincipals?: UserToManyPrincipalFilter; + /** `ownedPrincipals` exist. */ + ownedPrincipalsExist?: boolean; + /** Filter by the object’s `principals` relation. */ + principals?: UserToManyPrincipalFilter; + /** `principals` exist. */ + principalsExist?: boolean; + /** Filter by the object’s `principalEntitiesByEntityId` relation. */ + principalEntitiesByEntityId?: UserToManyPrincipalEntityFilter; + /** `principalEntitiesByEntityId` exist. */ + principalEntitiesByEntityIdExist?: boolean; /** Filter by the object’s `ownedEmails` relation. */ ownedEmails?: UserToManyEmailFilter; /** `ownedEmails` exist. */ @@ -815,6 +1123,64 @@ export interface UserFilter { unifiedSearch?: string; } // ============ OrderBy Types ============ +export type PrincipalOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC'; +export type PrincipalEntityOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC'; +export type PrincipalScopeOverrideOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC'; export type EmailOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -967,6 +1333,32 @@ export type UserConnectedAccountOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; +export type OrgApiKeyListOrderBy = + | 'NATURAL' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; export type UserOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -994,6 +1386,82 @@ export type UserOrderBy = | 'SEARCH_SCORE_ASC' | 'SEARCH_SCORE_DESC'; // ============ CRUD Input Types ============ +export interface CreatePrincipalInput { + clientMutationId?: string; + principal: { + ownerId: string; + userId: string; + name?: string; + allowedMask?: string; + isReadOnly?: boolean; + bypassStepUp?: boolean; + }; +} +export interface PrincipalPatch { + ownerId?: string | null; + userId?: string | null; + name?: string | null; + allowedMask?: string | null; + isReadOnly?: boolean | null; + bypassStepUp?: boolean | null; +} +export interface UpdatePrincipalInput { + clientMutationId?: string; + principalId: string; + principalPatch: PrincipalPatch; +} +export interface DeletePrincipalInput { + clientMutationId?: string; + principalId: string; +} +export interface CreatePrincipalEntityInput { + clientMutationId?: string; + principalEntity: { + principalId: string; + entityId: string; + ownerId: string; + }; +} +export interface PrincipalEntityPatch { + principalId?: string | null; + entityId?: string | null; + ownerId?: string | null; +} +export interface UpdatePrincipalEntityInput { + clientMutationId?: string; + id: string; + principalEntityPatch: PrincipalEntityPatch; +} +export interface DeletePrincipalEntityInput { + clientMutationId?: string; + id: string; +} +export interface CreatePrincipalScopeOverrideInput { + clientMutationId?: string; + principalScopeOverride: { + principalId: string; + membershipType?: number; + allowedMask?: string; + isAdmin?: boolean; + isReadOnly?: boolean; + }; +} +export interface PrincipalScopeOverridePatch { + principalId?: string | null; + membershipType?: number | null; + allowedMask?: string | null; + isAdmin?: boolean | null; + isReadOnly?: boolean | null; +} +export interface UpdatePrincipalScopeOverrideInput { + clientMutationId?: string; + id: string; + principalScopeOverridePatch: PrincipalScopeOverridePatch; +} +export interface DeletePrincipalScopeOverrideInput { + clientMutationId?: string; + id: string; +} export interface CreateEmailInput { clientMutationId?: string; email: { @@ -1210,6 +1678,40 @@ export interface DeleteUserConnectedAccountInput { clientMutationId?: string; id: string; } +export interface CreateOrgApiKeyListInput { + clientMutationId?: string; + orgApiKeyList: { + keyId?: string; + name?: string; + principalId?: string; + orgId?: string; + expiresAt?: string; + revokedAt?: string; + lastUsedAt?: string; + mfaLevel?: string; + accessLevel?: string; + }; +} +export interface OrgApiKeyListPatch { + keyId?: string | null; + name?: string | null; + principalId?: string | null; + orgId?: string | null; + expiresAt?: string | null; + revokedAt?: string | null; + lastUsedAt?: string | null; + mfaLevel?: string | null; + accessLevel?: string | null; +} +export interface UpdateOrgApiKeyListInput { + clientMutationId?: string; + id: string; + orgApiKeyListPatch: OrgApiKeyListPatch; +} +export interface DeleteOrgApiKeyListInput { + clientMutationId?: string; + id: string; +} export interface CreateUserInput { clientMutationId?: string; user: { @@ -1237,7 +1739,14 @@ export interface DeleteUserInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { + Principal: { + principalEntities: 'PrincipalEntity', + principalScopeOverrides: 'PrincipalScopeOverride', + }, User: { + ownedPrincipals: 'Principal', + principals: 'Principal', + principalEntitiesByEntityId: 'PrincipalEntity', ownedEmails: 'Email', ownedPhoneNumbers: 'PhoneNumber', ownedCryptoAddresses: 'CryptoAddress', @@ -1256,6 +1765,10 @@ export interface CheckPasswordInput { clientMutationId?: string; password?: string; } +export interface DeleteOrgPrincipalInput { + clientMutationId?: string; + principalId?: string; +} export interface DisconnectAccountInput { clientMutationId?: string; accountId: string; @@ -1281,6 +1794,11 @@ export interface ConfirmDeleteAccountInput { userId?: string; token?: string; } +export interface RevokeOrgApiKeyInput { + clientMutationId?: string; + keyId: string; + orgId: string; +} export interface SetPasswordInput { clientMutationId?: string; currentPassword?: string; @@ -1347,16 +1865,34 @@ export interface LinkIdentityInput { identifier: string; details?: Record; } +export interface CreateOrgPrincipalInput { + clientMutationId?: string; + name?: string; + orgId?: string; + allowedMask?: string; + isReadOnly?: boolean; + bypassStepUp?: boolean; +} export interface ExtendTokenExpiresInput { clientMutationId?: string; amount?: IntervalInput; } +export interface CreateOrgApiKeyInput { + clientMutationId?: string; + orgId?: string; + principalId?: string; + keyName?: string; + accessLevel?: string; + mfaLevel?: string; + expiresIn?: IntervalInput; +} export interface CreateApiKeyInput { clientMutationId?: string; keyName?: string; accessLevel?: string; mfaLevel?: string; expiresIn?: IntervalInput; + principalId?: string; } export interface RequestCrossOriginTokenInput { clientMutationId?: string; @@ -1382,6 +1918,24 @@ export interface ProvisionBucketInput { */ ownerId?: string; } +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} +/** A filter to be used against many `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalScopeOverrideFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalScopeOverrideFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalScopeOverrideFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalScopeOverrideFilter; +} /** A filter to be used against ConstructiveInternalTypeEmail fields. All fields are combined with a logical ‘and.’ */ export interface ConstructiveInternalTypeEmailFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -1669,6 +2223,24 @@ export interface ConstructiveInternalTypeImageFilter { /** Contained by the specified JSON. */ containedBy?: ConstructiveInternalTypeImage; } +/** A filter to be used against many `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalFilter; +} +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} /** A filter to be used against many `Email` object types. All fields are combined with a logical ‘and.’ */ export interface UserToManyEmailFilter { /** Filters to entities where at least one related entity matches. */ @@ -1721,6 +2293,18 @@ export interface TrgmSearchInput { /** Minimum similarity threshold (0.0 to 1.0). Higher = stricter matching. Default is 0.3. */ threshold?: number; } +/** An input for mutations affecting `PrincipalEntity` */ +export interface PrincipalEntityInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** The principal this scoping row belongs to */ + principalId: string; + /** The organization this principal is scoped to */ + entityId: string; + /** Denormalized owner_id from principals table for RLS */ + ownerId: string; +} /** An input for mutations affecting `Email` */ export interface EmailInput { id?: string; @@ -1837,7 +2421,22 @@ export interface UserConnectedAccountInput { createdAt?: string; updatedAt?: string; } -/** An input for mutations affecting `User` */ +/** An input for mutations affecting `OrgApiKeyList` */ +export interface OrgApiKeyListInput { + id?: string; + keyId?: string; + name?: string; + principalId?: string; + orgId?: string; + expiresAt?: string; + revokedAt?: string; + lastUsedAt?: string; + mfaLevel?: string; + accessLevel?: string; + createdAt?: string; + updatedAt?: string; +} +/** An input for mutations affecting `User` */ export interface UserInput { id?: string; username?: string; @@ -1866,6 +2465,99 @@ export interface IntervalInput { /** A quantity of years. */ years?: number; } +/** A filter to be used against `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalEntityFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalEntityFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalEntityFilter[]; + /** Negates the expression. */ + not?: PrincipalEntityFilter; + /** Filter by the object’s `entity` relation. */ + entity?: UserFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +/** A filter to be used against `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalScopeOverrideFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `membershipType` field. */ + membershipType?: IntFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isAdmin` field. */ + isAdmin?: BooleanFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalScopeOverrideFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalScopeOverrideFilter[]; + /** Negates the expression. */ + not?: PrincipalScopeOverrideFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +/** A filter to be used against `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalFilter { + /** 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 `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `userId` field. */ + userId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Filter by the object’s `bypassStepUp` field. */ + bypassStepUp?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalFilter[]; + /** Negates the expression. */ + not?: PrincipalFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `user` relation. */ + user?: UserFilter; + /** Filter by the object’s `principalEntities` relation. */ + principalEntities?: PrincipalToManyPrincipalEntityFilter; + /** `principalEntities` exist. */ + principalEntitiesExist?: boolean; + /** Filter by the object’s `principalScopeOverrides` relation. */ + principalScopeOverrides?: PrincipalToManyPrincipalScopeOverrideFilter; + /** `principalScopeOverrides` exist. */ + principalScopeOverridesExist?: boolean; +} /** A filter to be used against `Email` object types. All fields are combined with a logical ‘and.’ */ export interface EmailFilter { /** Filter by the object’s `id` field. */ @@ -2042,6 +2734,152 @@ export interface UUIDFilter { /** Greater than or equal to the specified value. */ greaterThanOrEqualTo?: string; } +/** 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 `User` object types. All fields are combined with a logical ‘and.’ */ +export interface UserFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `username` field. */ + username?: StringTrgmFilter; + /** Filter by the object’s `displayName` field. */ + displayName?: StringTrgmFilter; + /** Filter by the object’s `profilePicture` field. */ + profilePicture?: ConstructiveInternalTypeImageFilter; + /** Filter by the object’s `searchTsv` field. */ + searchTsv?: FullTextFilter; + /** Filter by the object’s `type` field. */ + type?: IntFilter; + /** 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?: UserFilter[]; + /** Checks for any expressions in this list. */ + or?: UserFilter[]; + /** Negates the expression. */ + not?: UserFilter; + /** Filter by the object’s `roleType` relation. */ + roleType?: RoleTypeFilter; + /** Filter by the object’s `ownedPrincipals` relation. */ + ownedPrincipals?: UserToManyPrincipalFilter; + /** `ownedPrincipals` exist. */ + ownedPrincipalsExist?: boolean; + /** Filter by the object’s `principals` relation. */ + principals?: UserToManyPrincipalFilter; + /** `principals` exist. */ + principalsExist?: boolean; + /** Filter by the object’s `principalEntitiesByEntityId` relation. */ + principalEntitiesByEntityId?: UserToManyPrincipalEntityFilter; + /** `principalEntitiesByEntityId` exist. */ + principalEntitiesByEntityIdExist?: boolean; + /** Filter by the object’s `ownedEmails` relation. */ + ownedEmails?: UserToManyEmailFilter; + /** `ownedEmails` exist. */ + ownedEmailsExist?: boolean; + /** Filter by the object’s `ownedPhoneNumbers` relation. */ + ownedPhoneNumbers?: UserToManyPhoneNumberFilter; + /** `ownedPhoneNumbers` exist. */ + ownedPhoneNumbersExist?: boolean; + /** Filter by the object’s `ownedCryptoAddresses` relation. */ + ownedCryptoAddresses?: UserToManyCryptoAddressFilter; + /** `ownedCryptoAddresses` exist. */ + ownedCryptoAddressesExist?: boolean; + /** Filter by the object’s `ownedWebauthnCredentials` relation. */ + ownedWebauthnCredentials?: UserToManyWebauthnCredentialFilter; + /** `ownedWebauthnCredentials` exist. */ + ownedWebauthnCredentialsExist?: boolean; + /** Filter by the object’s `auditLogAuthsByActorId` relation. */ + auditLogAuthsByActorId?: UserToManyAuditLogAuthFilter; + /** `auditLogAuthsByActorId` exist. */ + auditLogAuthsByActorIdExist?: boolean; + /** TSV search on the `search_tsv` column. */ + tsvSearchTsv?: string; + /** TRGM search on the `display_name` column. */ + trgmDisplayName?: TrgmSearchInput; + /** + * Composite unified search. Provide a search string and it will be dispatched to + * all text-compatible search algorithms (tsvector, BM25, pg_trgm) + * 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; +} +/** 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 BitString fields. All fields are combined with a logical ‘and.’ */ +export interface BitStringFilter { + /** 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 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). */ @@ -2144,90 +2982,6 @@ export interface StringFilter { /** Greater than or equal to the specified value (case-insensitive). */ greaterThanOrEqualToInsensitive?: string; } -/** 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 `User` object types. All fields are combined with a logical ‘and.’ */ -export interface UserFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `username` field. */ - username?: StringTrgmFilter; - /** Filter by the object’s `displayName` field. */ - displayName?: StringTrgmFilter; - /** Filter by the object’s `profilePicture` field. */ - profilePicture?: ConstructiveInternalTypeImageFilter; - /** Filter by the object’s `searchTsv` field. */ - searchTsv?: FullTextFilter; - /** Filter by the object’s `type` field. */ - type?: IntFilter; - /** 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?: UserFilter[]; - /** Checks for any expressions in this list. */ - or?: UserFilter[]; - /** Negates the expression. */ - not?: UserFilter; - /** Filter by the object’s `roleType` relation. */ - roleType?: RoleTypeFilter; - /** Filter by the object’s `ownedEmails` relation. */ - ownedEmails?: UserToManyEmailFilter; - /** `ownedEmails` exist. */ - ownedEmailsExist?: boolean; - /** Filter by the object’s `ownedPhoneNumbers` relation. */ - ownedPhoneNumbers?: UserToManyPhoneNumberFilter; - /** `ownedPhoneNumbers` exist. */ - ownedPhoneNumbersExist?: boolean; - /** Filter by the object’s `ownedCryptoAddresses` relation. */ - ownedCryptoAddresses?: UserToManyCryptoAddressFilter; - /** `ownedCryptoAddresses` exist. */ - ownedCryptoAddressesExist?: boolean; - /** Filter by the object’s `ownedWebauthnCredentials` relation. */ - ownedWebauthnCredentials?: UserToManyWebauthnCredentialFilter; - /** `ownedWebauthnCredentials` exist. */ - ownedWebauthnCredentialsExist?: boolean; - /** Filter by the object’s `auditLogAuthsByActorId` relation. */ - auditLogAuthsByActorId?: UserToManyAuditLogAuthFilter; - /** `auditLogAuthsByActorId` exist. */ - auditLogAuthsByActorIdExist?: boolean; - /** TSV search on the `search_tsv` column. */ - tsvSearchTsv?: string; - /** TRGM search on the `display_name` column. */ - trgmDisplayName?: TrgmSearchInput; - /** - * Composite unified search. Provide a search string and it will be dispatched to - * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * 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; -} /** A filter to be used against BigInt fields. All fields are combined with a logical ‘and.’ */ export interface BigIntFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -2346,31 +3100,6 @@ export interface FullTextFilter { /** Performs a full text search on the field. */ matches?: 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 `RoleType` object types. All fields are combined with a logical ‘and.’ */ export interface RoleTypeFilter { /** Filter by the object’s `id` field. */ @@ -2405,6 +3134,14 @@ export interface CheckPasswordPayload { export type CheckPasswordPayloadSelect = { clientMutationId?: boolean; }; +export interface DeleteOrgPrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type DeleteOrgPrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface DisconnectAccountPayload { clientMutationId?: string | null; result?: boolean | null; @@ -2453,6 +3190,14 @@ export type ConfirmDeleteAccountPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; +export interface RevokeOrgApiKeyPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type RevokeOrgApiKeyPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface SetPasswordPayload { clientMutationId?: string | null; result?: boolean | null; @@ -2543,6 +3288,14 @@ export type LinkIdentityPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; +export interface CreateOrgPrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreateOrgPrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface ExtendTokenExpiresPayload { clientMutationId?: string | null; result?: ExtendTokenExpiresRecord[] | null; @@ -2553,6 +3306,16 @@ export type ExtendTokenExpiresPayloadSelect = { select: ExtendTokenExpiresRecordSelect; }; }; +export interface CreateOrgApiKeyPayload { + clientMutationId?: string | null; + result?: CreateOrgApiKeyRecord | null; +} +export type CreateOrgApiKeyPayloadSelect = { + clientMutationId?: boolean; + result?: { + select: CreateOrgApiKeyRecordSelect; + }; +}; export interface CreateApiKeyPayload { clientMutationId?: string | null; result?: CreateApiKeyRecord | null; @@ -2607,6 +3370,67 @@ export type ProvisionBucketPayloadSelect = { endpoint?: boolean; error?: boolean; }; +export interface CreatePrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreatePrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface DeletePrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type DeletePrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface CreatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was created by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type CreatePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; +export interface UpdatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was updated by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type UpdatePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; +export interface DeletePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was deleted by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type DeletePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; export interface CreateEmailPayload { clientMutationId?: string | null; /** The `Email` that was created by this mutation. */ @@ -2899,6 +3723,17 @@ export type CreateUserConnectedAccountPayloadSelect = { select: UserConnectedAccountSelect; }; }; +export interface CreateOrgApiKeyListPayload { + clientMutationId?: string | null; + /** The `OrgApiKeyList` that was created by this mutation. */ + orgApiKeyList?: OrgApiKeyList | null; +} +export type CreateOrgApiKeyListPayloadSelect = { + clientMutationId?: boolean; + orgApiKeyList?: { + select: OrgApiKeyListSelect; + }; +}; export interface CreateUserPayload { clientMutationId?: string | null; /** The `User` that was created by this mutation. */ @@ -3026,6 +3861,16 @@ export type ExtendTokenExpiresRecordSelect = { sessionId?: boolean; expiresAt?: boolean; }; +export interface CreateOrgApiKeyRecord { + apiKey?: string | null; + keyId?: string | null; + expiresAt?: string | null; +} +export type CreateOrgApiKeyRecordSelect = { + apiKey?: boolean; + keyId?: boolean; + expiresAt?: boolean; +}; export interface CreateApiKeyRecord { apiKey?: string | null; keyId?: string | null; @@ -3036,6 +3881,18 @@ export type CreateApiKeyRecordSelect = { keyId?: boolean; expiresAt?: boolean; }; +/** A `PrincipalEntity` edge in the connection. */ +export interface PrincipalEntityEdge { + cursor?: string | null; + /** The `PrincipalEntity` at the end of the edge. */ + node?: PrincipalEntity | null; +} +export type PrincipalEntityEdgeSelect = { + cursor?: boolean; + node?: { + select: PrincipalEntitySelect; + }; +}; /** A `Email` edge in the connection. */ export interface EmailEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/auth/orm/models/index.ts b/sdk/constructive-react/src/auth/orm/models/index.ts index f0ecad3b71..d041785e90 100644 --- a/sdk/constructive-react/src/auth/orm/models/index.ts +++ b/sdk/constructive-react/src/auth/orm/models/index.ts @@ -3,6 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ +export { PrincipalModel } from './principal'; +export { PrincipalEntityModel } from './principalEntity'; +export { PrincipalScopeOverrideModel } from './principalScopeOverride'; export { EmailModel } from './email'; export { PhoneNumberModel } from './phoneNumber'; export { CryptoAddressModel } from './cryptoAddress'; @@ -11,4 +14,5 @@ export { AuditLogAuthModel } from './auditLogAuth'; export { IdentityProviderModel } from './identityProvider'; export { RoleTypeModel } from './roleType'; export { UserConnectedAccountModel } from './userConnectedAccount'; +export { OrgApiKeyListModel } from './orgApiKeyList'; export { UserModel } from './user'; diff --git a/sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts b/sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts new file mode 100644 index 0000000000..fe7120ee8a --- /dev/null +++ b/sdk/constructive-react/src/auth/orm/models/orgApiKeyList.ts @@ -0,0 +1,174 @@ +/** + * OrgApiKeyList 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 { + OrgApiKeyList, + OrgApiKeyListWithRelations, + OrgApiKeyListSelect, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy, + CreateOrgApiKeyListInput, + UpdateOrgApiKeyListInput, + OrgApiKeyListPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgApiKeyListModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyLists: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + 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, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyLists', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyList: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', + document, + variables, + transform: (data: { + orgApiKeyLists?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyList: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', + document, + variables, + transform: (data: { + orgApiKeyLists?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgApiKeyList: { + orgApiKeyList: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgApiKeyList', + 'createOrgApiKeyList', + 'orgApiKeyList', + args.select, + args.data, + 'CreateOrgApiKeyListInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgApiKeyList', + fieldName: 'createOrgApiKeyList', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/auth/orm/models/principal.ts b/sdk/constructive-react/src/auth/orm/models/principal.ts new file mode 100644 index 0000000000..66c9d2ff40 --- /dev/null +++ b/sdk/constructive-react/src/auth/orm/models/principal.ts @@ -0,0 +1,208 @@ +/** + * Principal 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 { + Principal, + PrincipalWithRelations, + PrincipalSelect, + PrincipalFilter, + PrincipalOrderBy, + CreatePrincipalInput, + UpdatePrincipalInput, + PrincipalPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principals: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + 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, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principals', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principal: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'Principal', + 'principals', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', + document, + variables, + transform: (data: { + principals?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principal: data.principals?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + principalId: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principal: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + args.select, + { + where: { + principalId: { + equalTo: args.principalId, + }, + }, + first: 1, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', + document, + variables, + transform: (data: { + principals?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principal: data.principals?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipal: { + principal: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'Principal', + 'createPrincipal', + 'principal', + args.select, + args.data, + 'CreatePrincipalInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'Principal', + fieldName: 'createPrincipal', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + principalId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipal: { + principal: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'Principal', + 'deletePrincipal', + 'principal', + { + principalId: args.where.principalId, + }, + 'DeletePrincipalInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'Principal', + fieldName: 'deletePrincipal', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/auth/orm/models/principalEntity.ts b/sdk/constructive-react/src/auth/orm/models/principalEntity.ts new file mode 100644 index 0000000000..0c265501f5 --- /dev/null +++ b/sdk/constructive-react/src/auth/orm/models/principalEntity.ts @@ -0,0 +1,245 @@ +/** + * PrincipalEntity 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 { + PrincipalEntity, + PrincipalEntityWithRelations, + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy, + CreatePrincipalEntityInput, + UpdatePrincipalEntityInput, + PrincipalEntityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalEntityModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntities: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + 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, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntities', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntity: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', + document, + variables, + transform: (data: { + principalEntities?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntity: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', + document, + variables, + transform: (data: { + principalEntities?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalEntity', + 'createPrincipalEntity', + 'principalEntity', + args.select, + args.data, + 'CreatePrincipalEntityInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'createPrincipalEntity', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrincipalEntityPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PrincipalEntity', + 'updatePrincipalEntity', + 'principalEntity', + args.select, + args.where.id, + args.data, + 'UpdatePrincipalEntityInput', + 'id', + 'principalEntityPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'updatePrincipalEntity', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PrincipalEntity', + 'deletePrincipalEntity', + 'principalEntity', + { + id: args.where.id, + }, + 'DeletePrincipalEntityInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'deletePrincipalEntity', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts b/sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts new file mode 100644 index 0000000000..3d3e7bedd3 --- /dev/null +++ b/sdk/constructive-react/src/auth/orm/models/principalScopeOverride.ts @@ -0,0 +1,176 @@ +/** + * PrincipalScopeOverride 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 { + PrincipalScopeOverride, + PrincipalScopeOverrideWithRelations, + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy, + CreatePrincipalScopeOverrideInput, + UpdatePrincipalScopeOverrideInput, + PrincipalScopeOverridePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalScopeOverrideModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverrides: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + 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, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverrides', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverride: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', + document, + variables, + transform: (data: { + principalScopeOverrides?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverride: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', + document, + variables, + transform: (data: { + principalScopeOverrides?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalScopeOverride: { + principalScopeOverride: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalScopeOverride', + 'createPrincipalScopeOverride', + 'principalScopeOverride', + args.select, + args.data, + 'CreatePrincipalScopeOverrideInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalScopeOverride', + fieldName: 'createPrincipalScopeOverride', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/auth/orm/mutation/index.ts b/sdk/constructive-react/src/auth/orm/mutation/index.ts index d8864374dd..de98ebe402 100644 --- a/sdk/constructive-react/src/auth/orm/mutation/index.ts +++ b/sdk/constructive-react/src/auth/orm/mutation/index.ts @@ -10,12 +10,14 @@ import type { SignOutInput, SendAccountDeletionEmailInput, CheckPasswordInput, + DeleteOrgPrincipalInput, DisconnectAccountInput, RevokeApiKeyInput, RevokeSessionInput, VerifyPasswordInput, VerifyTotpInput, ConfirmDeleteAccountInput, + RevokeOrgApiKeyInput, SetPasswordInput, VerifyEmailInput, ProvisionNewUserInput, @@ -26,7 +28,9 @@ import type { SignUpInput, SignInInput, LinkIdentityInput, + CreateOrgPrincipalInput, ExtendTokenExpiresInput, + CreateOrgApiKeyInput, CreateApiKeyInput, RequestCrossOriginTokenInput, ForgotPasswordInput, @@ -35,12 +39,14 @@ import type { SignOutPayload, SendAccountDeletionEmailPayload, CheckPasswordPayload, + DeleteOrgPrincipalPayload, DisconnectAccountPayload, RevokeApiKeyPayload, RevokeSessionPayload, VerifyPasswordPayload, VerifyTotpPayload, ConfirmDeleteAccountPayload, + RevokeOrgApiKeyPayload, SetPasswordPayload, VerifyEmailPayload, ProvisionNewUserPayload, @@ -51,7 +57,9 @@ import type { SignUpPayload, SignInPayload, LinkIdentityPayload, + CreateOrgPrincipalPayload, ExtendTokenExpiresPayload, + CreateOrgApiKeyPayload, CreateApiKeyPayload, RequestCrossOriginTokenPayload, ForgotPasswordPayload, @@ -60,12 +68,14 @@ import type { SignOutPayloadSelect, SendAccountDeletionEmailPayloadSelect, CheckPasswordPayloadSelect, + DeleteOrgPrincipalPayloadSelect, DisconnectAccountPayloadSelect, RevokeApiKeyPayloadSelect, RevokeSessionPayloadSelect, VerifyPasswordPayloadSelect, VerifyTotpPayloadSelect, ConfirmDeleteAccountPayloadSelect, + RevokeOrgApiKeyPayloadSelect, SetPasswordPayloadSelect, VerifyEmailPayloadSelect, ProvisionNewUserPayloadSelect, @@ -76,7 +86,9 @@ import type { SignUpPayloadSelect, SignInPayloadSelect, LinkIdentityPayloadSelect, + CreateOrgPrincipalPayloadSelect, ExtendTokenExpiresPayloadSelect, + CreateOrgApiKeyPayloadSelect, CreateApiKeyPayloadSelect, RequestCrossOriginTokenPayloadSelect, ForgotPasswordPayloadSelect, @@ -93,6 +105,9 @@ export interface SendAccountDeletionEmailVariables { export interface CheckPasswordVariables { input: CheckPasswordInput; } +export interface DeleteOrgPrincipalVariables { + input: DeleteOrgPrincipalInput; +} export interface DisconnectAccountVariables { input: DisconnectAccountInput; } @@ -111,6 +126,9 @@ export interface VerifyTotpVariables { export interface ConfirmDeleteAccountVariables { input: ConfirmDeleteAccountInput; } +export interface RevokeOrgApiKeyVariables { + input: RevokeOrgApiKeyInput; +} export interface SetPasswordVariables { input: SetPasswordInput; } @@ -141,9 +159,15 @@ export interface SignInVariables { export interface LinkIdentityVariables { input: LinkIdentityInput; } +export interface CreateOrgPrincipalVariables { + input: CreateOrgPrincipalInput; +} export interface ExtendTokenExpiresVariables { input: ExtendTokenExpiresInput; } +export interface CreateOrgApiKeyVariables { + input: CreateOrgApiKeyInput; +} export interface CreateApiKeyVariables { input: CreateApiKeyInput; } @@ -255,6 +279,35 @@ export function createMutationOperations(client: OrmClient) { 'CheckPasswordPayload' ), }), + deleteOrgPrincipal: ( + args: DeleteOrgPrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + deleteOrgPrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DeleteOrgPrincipal', + fieldName: 'deleteOrgPrincipal', + ...buildCustomDocument( + 'mutation', + 'DeleteOrgPrincipal', + 'deleteOrgPrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'DeleteOrgPrincipalInput!', + }, + ], + connectionFieldsMap, + 'DeleteOrgPrincipalPayload' + ), + }), disconnectAccount: ( args: DisconnectAccountVariables, options: { @@ -429,6 +482,35 @@ export function createMutationOperations(client: OrmClient) { 'ConfirmDeleteAccountPayload' ), }), + revokeOrgApiKey: ( + args: RevokeOrgApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeOrgApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeOrgApiKey', + fieldName: 'revokeOrgApiKey', + ...buildCustomDocument( + 'mutation', + 'RevokeOrgApiKey', + 'revokeOrgApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeOrgApiKeyInput!', + }, + ], + connectionFieldsMap, + 'RevokeOrgApiKeyPayload' + ), + }), setPassword: ( args: SetPasswordVariables, options: { @@ -719,6 +801,35 @@ export function createMutationOperations(client: OrmClient) { 'LinkIdentityPayload' ), }), + createOrgPrincipal: ( + args: CreateOrgPrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createOrgPrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateOrgPrincipal', + fieldName: 'createOrgPrincipal', + ...buildCustomDocument( + 'mutation', + 'CreateOrgPrincipal', + 'createOrgPrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'CreateOrgPrincipalInput!', + }, + ], + connectionFieldsMap, + 'CreateOrgPrincipalPayload' + ), + }), extendTokenExpires: ( args: ExtendTokenExpiresVariables, options: { @@ -748,6 +859,35 @@ export function createMutationOperations(client: OrmClient) { 'ExtendTokenExpiresPayload' ), }), + createOrgApiKey: ( + args: CreateOrgApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createOrgApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateOrgApiKey', + fieldName: 'createOrgApiKey', + ...buildCustomDocument( + 'mutation', + 'CreateOrgApiKey', + 'createOrgApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'CreateOrgApiKeyInput!', + }, + ], + connectionFieldsMap, + 'CreateOrgApiKeyPayload' + ), + }), createApiKey: ( args: CreateApiKeyVariables, options: { diff --git a/sdk/constructive-react/src/auth/orm/query/index.ts b/sdk/constructive-react/src/auth/orm/query/index.ts index 408632294d..c91b14032e 100644 --- a/sdk/constructive-react/src/auth/orm/query/index.ts +++ b/sdk/constructive-react/src/auth/orm/query/index.ts @@ -32,18 +32,18 @@ export function createQueryOperations(client: OrmClient) { undefined ), }), - currentIpAddress: (options?: { select?: Record }) => + currentUserId: (options?: { select?: Record }) => new QueryBuilder<{ - currentIpAddress: string | null; + currentUserId: string | null; }>({ client, operation: 'query', - operationName: 'CurrentIpAddress', - fieldName: 'currentIpAddress', + operationName: 'CurrentUserId', + fieldName: 'currentUserId', ...buildCustomDocument( 'query', - 'CurrentIpAddress', - 'currentIpAddress', + 'CurrentUserId', + 'currentUserId', options?.select, undefined, [], @@ -51,18 +51,18 @@ export function createQueryOperations(client: OrmClient) { undefined ), }), - currentUserId: (options?: { select?: Record }) => + currentIpAddress: (options?: { select?: Record }) => new QueryBuilder<{ - currentUserId: string | null; + currentIpAddress: string | null; }>({ client, operation: 'query', - operationName: 'CurrentUserId', - fieldName: 'currentUserId', + operationName: 'CurrentIpAddress', + fieldName: 'currentIpAddress', ...buildCustomDocument( 'query', - 'CurrentUserId', - 'currentUserId', + 'CurrentIpAddress', + 'currentIpAddress', options?.select, undefined, [], diff --git a/sdk/constructive-react/src/auth/schema-types.ts b/sdk/constructive-react/src/auth/schema-types.ts index 681113df49..a32ffeb46e 100644 --- a/sdk/constructive-react/src/auth/schema-types.ts +++ b/sdk/constructive-react/src/auth/schema-types.ts @@ -9,7 +9,11 @@ import type { CryptoAddress, Email, IdentityProvider, + OrgApiKeyList, PhoneNumber, + Principal, + PrincipalEntity, + PrincipalScopeOverride, RoleType, User, UserConnectedAccount, @@ -36,6 +40,67 @@ export type Base64EncodedBinary = unknown; export type ConstructiveInternalTypeEmail = unknown; export type ConstructiveInternalTypeImage = unknown; export type ConstructiveInternalTypeOrigin = unknown; +/** Methods to use when ordering `PrincipalEntity`. */ +export type PrincipalEntityOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC'; +/** Methods to use when ordering `PrincipalScopeOverride`. */ +export type PrincipalScopeOverrideOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC'; +/** Methods to use when ordering `Principal`. */ +export type PrincipalOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC'; /** Methods to use when ordering `Email`. */ export type EmailOrderBy = | 'NATURAL' @@ -196,6 +261,33 @@ export type UserConnectedAccountOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; +/** Methods to use when ordering `OrgApiKeyList`. */ +export type OrgApiKeyListOrderBy = + | 'NATURAL' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; /** Methods to use when ordering `User`. */ export type UserOrderBy = | 'NATURAL' @@ -223,109 +315,32 @@ export type UserOrderBy = | 'DISPLAY_NAME_TRGM_SIMILARITY_DESC' | 'SEARCH_SCORE_ASC' | 'SEARCH_SCORE_DESC'; -/** A filter to be used against `Email` object types. All fields are combined with a logical ‘and.’ */ -export interface EmailFilter { +/** A filter to be used against `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalEntityFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; - /** Filter by the object’s `ownerId` field. */ - ownerId?: UUIDFilter; - /** Filter by the object’s `email` field. */ - email?: ConstructiveInternalTypeEmailFilter; - /** Filter by the object’s `isVerified` field. */ - isVerified?: BooleanFilter; - /** Filter by the object’s `isPrimary` field. */ - isPrimary?: BooleanFilter; - /** Filter by the object’s `name` field. */ - name?: StringFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Filter by the object’s `updatedAt` field. */ updatedAt?: DatetimeFilter; + /** Filter by the object’s `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; /** Checks for all expressions in this list. */ - and?: EmailFilter[]; + and?: PrincipalEntityFilter[]; /** Checks for any expressions in this list. */ - or?: EmailFilter[]; + or?: PrincipalEntityFilter[]; /** Negates the expression. */ - not?: EmailFilter; + not?: PrincipalEntityFilter; + /** Filter by the object’s `entity` relation. */ + entity?: UserFilter; /** Filter by the object’s `owner` relation. */ owner?: UserFilter; -} -/** A filter to be used against ConstructiveInternalTypeEmail fields. All fields are combined with a logical ‘and.’ */ -export interface ConstructiveInternalTypeEmailFilter { - /** 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?: ConstructiveInternalTypeEmail; - /** Does not contain the specified string (case-insensitive). */ - notIncludesInsensitive?: ConstructiveInternalTypeEmail; - /** 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?: ConstructiveInternalTypeEmail; - /** Does not start with the specified string (case-insensitive). */ - notStartsWithInsensitive?: ConstructiveInternalTypeEmail; - /** 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?: ConstructiveInternalTypeEmail; - /** Does not end with the specified string (case-insensitive). */ - notEndsWithInsensitive?: ConstructiveInternalTypeEmail; - /** 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?: ConstructiveInternalTypeEmail; - /** 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?: ConstructiveInternalTypeEmail; - /** Equal to the specified value (case-insensitive). */ - equalToInsensitive?: ConstructiveInternalTypeEmail; - /** Not equal to the specified value (case-insensitive). */ - notEqualToInsensitive?: ConstructiveInternalTypeEmail; - /** Not equal to the specified value, treating null like an ordinary value (case-insensitive). */ - distinctFromInsensitive?: ConstructiveInternalTypeEmail; - /** Equal to the specified value, treating null like an ordinary value (case-insensitive). */ - notDistinctFromInsensitive?: ConstructiveInternalTypeEmail; - /** Included in the specified list (case-insensitive). */ - inInsensitive?: ConstructiveInternalTypeEmail[]; - /** Not included in the specified list (case-insensitive). */ - notInInsensitive?: ConstructiveInternalTypeEmail[]; - /** Less than the specified value (case-insensitive). */ - lessThanInsensitive?: ConstructiveInternalTypeEmail; - /** Less than or equal to the specified value (case-insensitive). */ - lessThanOrEqualToInsensitive?: ConstructiveInternalTypeEmail; - /** Greater than the specified value (case-insensitive). */ - greaterThanInsensitive?: ConstructiveInternalTypeEmail; - /** Greater than or equal to the specified value (case-insensitive). */ - greaterThanOrEqualToInsensitive?: ConstructiveInternalTypeEmail; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; } /** A filter to be used against `User` object types. All fields are combined with a logical ‘and.’ */ export interface UserFilter { @@ -353,6 +368,18 @@ export interface UserFilter { not?: UserFilter; /** Filter by the object’s `roleType` relation. */ roleType?: RoleTypeFilter; + /** Filter by the object’s `ownedPrincipals` relation. */ + ownedPrincipals?: UserToManyPrincipalFilter; + /** `ownedPrincipals` exist. */ + ownedPrincipalsExist?: boolean; + /** Filter by the object’s `principals` relation. */ + principals?: UserToManyPrincipalFilter; + /** `principals` exist. */ + principalsExist?: boolean; + /** Filter by the object’s `principalEntitiesByEntityId` relation. */ + principalEntitiesByEntityId?: UserToManyPrincipalEntityFilter; + /** `principalEntitiesByEntityId` exist. */ + principalEntitiesByEntityIdExist?: boolean; /** Filter by the object’s `ownedEmails` relation. */ ownedEmails?: UserToManyEmailFilter; /** `ownedEmails` exist. */ @@ -522,6 +549,108 @@ export interface RoleTypeFilter { /** Negates the expression. */ not?: RoleTypeFilter; } +/** A filter to be used against many `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalFilter; +} +/** A filter to be used against `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalFilter { + /** 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 `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `userId` field. */ + userId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Filter by the object’s `bypassStepUp` field. */ + bypassStepUp?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalFilter[]; + /** Negates the expression. */ + not?: PrincipalFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `user` relation. */ + user?: UserFilter; + /** Filter by the object’s `principalEntities` relation. */ + principalEntities?: PrincipalToManyPrincipalEntityFilter; + /** `principalEntities` exist. */ + principalEntitiesExist?: boolean; + /** Filter by the object’s `principalScopeOverrides` relation. */ + principalScopeOverrides?: PrincipalToManyPrincipalScopeOverrideFilter; + /** `principalScopeOverrides` exist. */ + principalScopeOverridesExist?: boolean; +} +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} +/** A filter to be used against many `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalScopeOverrideFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalScopeOverrideFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalScopeOverrideFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalScopeOverrideFilter; +} +/** A filter to be used against `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalScopeOverrideFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `membershipType` field. */ + membershipType?: IntFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isAdmin` field. */ + isAdmin?: BooleanFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalScopeOverrideFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalScopeOverrideFilter[]; + /** Negates the expression. */ + not?: PrincipalScopeOverrideFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} /** A filter to be used against many `Email` object types. All fields are combined with a logical ‘and.’ */ export interface UserToManyEmailFilter { /** Filters to entities where at least one related entity matches. */ @@ -531,6 +660,110 @@ export interface UserToManyEmailFilter { /** Filters to entities where no related entity matches. */ none?: EmailFilter; } +/** A filter to be used against `Email` object types. All fields are combined with a logical ‘and.’ */ +export interface EmailFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `email` field. */ + email?: ConstructiveInternalTypeEmailFilter; + /** Filter by the object’s `isVerified` field. */ + isVerified?: BooleanFilter; + /** Filter by the object’s `isPrimary` field. */ + isPrimary?: BooleanFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** 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?: EmailFilter[]; + /** Checks for any expressions in this list. */ + or?: EmailFilter[]; + /** Negates the expression. */ + not?: EmailFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; +} +/** A filter to be used against ConstructiveInternalTypeEmail fields. All fields are combined with a logical ‘and.’ */ +export interface ConstructiveInternalTypeEmailFilter { + /** 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?: ConstructiveInternalTypeEmail; + /** Does not contain the specified string (case-insensitive). */ + notIncludesInsensitive?: ConstructiveInternalTypeEmail; + /** 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?: ConstructiveInternalTypeEmail; + /** Does not start with the specified string (case-insensitive). */ + notStartsWithInsensitive?: ConstructiveInternalTypeEmail; + /** 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?: ConstructiveInternalTypeEmail; + /** Does not end with the specified string (case-insensitive). */ + notEndsWithInsensitive?: ConstructiveInternalTypeEmail; + /** 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?: ConstructiveInternalTypeEmail; + /** 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?: ConstructiveInternalTypeEmail; + /** Equal to the specified value (case-insensitive). */ + equalToInsensitive?: ConstructiveInternalTypeEmail; + /** Not equal to the specified value (case-insensitive). */ + notEqualToInsensitive?: ConstructiveInternalTypeEmail; + /** Not equal to the specified value, treating null like an ordinary value (case-insensitive). */ + distinctFromInsensitive?: ConstructiveInternalTypeEmail; + /** Equal to the specified value, treating null like an ordinary value (case-insensitive). */ + notDistinctFromInsensitive?: ConstructiveInternalTypeEmail; + /** Included in the specified list (case-insensitive). */ + inInsensitive?: ConstructiveInternalTypeEmail[]; + /** Not included in the specified list (case-insensitive). */ + notInInsensitive?: ConstructiveInternalTypeEmail[]; + /** Less than the specified value (case-insensitive). */ + lessThanInsensitive?: ConstructiveInternalTypeEmail; + /** Less than or equal to the specified value (case-insensitive). */ + lessThanOrEqualToInsensitive?: ConstructiveInternalTypeEmail; + /** Greater than the specified value (case-insensitive). */ + greaterThanInsensitive?: ConstructiveInternalTypeEmail; + /** Greater than or equal to the specified value (case-insensitive). */ + greaterThanOrEqualToInsensitive?: ConstructiveInternalTypeEmail; +} /** A filter to be used against many `PhoneNumber` object types. All fields are combined with a logical ‘and.’ */ export interface UserToManyPhoneNumberFilter { /** Filters to entities where at least one related entity matches. */ @@ -829,6 +1062,39 @@ export interface UserConnectedAccountFilter { /** Negates the expression. */ not?: UserConnectedAccountFilter; } +/** A filter to be used against `OrgApiKeyList` object types. All fields are combined with a logical ‘and.’ */ +export interface OrgApiKeyListFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `keyId` field. */ + keyId?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `orgId` field. */ + orgId?: UUIDFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Filter by the object’s `revokedAt` field. */ + revokedAt?: DatetimeFilter; + /** Filter by the object’s `lastUsedAt` field. */ + lastUsedAt?: DatetimeFilter; + /** Filter by the object’s `mfaLevel` field. */ + mfaLevel?: StringFilter; + /** Filter by the object’s `accessLevel` field. */ + accessLevel?: StringFilter; + /** 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?: OrgApiKeyListFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgApiKeyListFilter[]; + /** Negates the expression. */ + not?: OrgApiKeyListFilter; +} export interface SignOutInput { clientMutationId?: string; } @@ -839,6 +1105,14 @@ export interface CheckPasswordInput { clientMutationId?: string; password?: string; } +export interface DeleteOrgPrincipalInput { + clientMutationId?: string; + principalId?: string; +} +export interface DeletePrincipalInput { + clientMutationId?: string; + principalId?: string; +} export interface DisconnectAccountInput { clientMutationId?: string; accountId: string; @@ -864,6 +1138,11 @@ export interface ConfirmDeleteAccountInput { userId?: string; token?: string; } +export interface RevokeOrgApiKeyInput { + clientMutationId?: string; + keyId: string; + orgId: string; +} export interface SetPasswordInput { clientMutationId?: string; currentPassword?: string; @@ -930,6 +1209,14 @@ export interface LinkIdentityInput { identifier: string; details?: unknown; } +export interface CreateOrgPrincipalInput { + clientMutationId?: string; + name?: string; + orgId?: string; + allowedMask?: string; + isReadOnly?: boolean; + bypassStepUp?: boolean; +} export interface ExtendTokenExpiresInput { clientMutationId?: string; amount?: IntervalInput; @@ -953,12 +1240,22 @@ export interface IntervalInput { /** A quantity of years. */ years?: number; } +export interface CreateOrgApiKeyInput { + clientMutationId?: string; + orgId?: string; + principalId?: string; + keyName?: string; + accessLevel?: string; + mfaLevel?: string; + expiresIn?: IntervalInput; +} export interface CreateApiKeyInput { clientMutationId?: string; keyName?: string; accessLevel?: string; mfaLevel?: string; expiresIn?: IntervalInput; + principalId?: string; } export interface RequestCrossOriginTokenInput { clientMutationId?: string; @@ -967,6 +1264,14 @@ export interface RequestCrossOriginTokenInput { origin?: ConstructiveInternalTypeOrigin; rememberMe?: boolean; } +export interface CreatePrincipalInput { + clientMutationId?: string; + name?: string; + allowedMask?: string; + entityIds?: string[]; + isReadOnly?: boolean; + bypassStepUp?: boolean; +} export interface ForgotPasswordInput { clientMutationId?: string; email?: ConstructiveInternalTypeEmail; @@ -998,6 +1303,23 @@ export interface RoleTypeInput { id: number; name: string; } +export interface CreatePrincipalEntityInput { + clientMutationId?: string; + /** The `PrincipalEntity` to be created by this mutation. */ + principalEntity: PrincipalEntityInput; +} +/** An input for mutations affecting `PrincipalEntity` */ +export interface PrincipalEntityInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** The principal this scoping row belongs to */ + principalId: string; + /** The organization this principal is scoped to */ + entityId: string; + /** Denormalized owner_id from principals table for RLS */ + ownerId: string; +} export interface CreateUserConnectedAccountInput { clientMutationId?: string; /** The `UserConnectedAccount` to be created by this mutation. */ @@ -1079,6 +1401,26 @@ export interface AuditLogAuthInput { /** Whether the authentication attempt succeeded */ success: boolean; } +export interface CreateOrgApiKeyListInput { + clientMutationId?: string; + /** The `OrgApiKeyList` to be created by this mutation. */ + orgApiKeyList: OrgApiKeyListInput; +} +/** An input for mutations affecting `OrgApiKeyList` */ +export interface OrgApiKeyListInput { + id?: string; + keyId?: string; + name?: string; + principalId?: string; + orgId?: string; + expiresAt?: string; + revokedAt?: string; + lastUsedAt?: string; + mfaLevel?: string; + accessLevel?: string; + createdAt?: string; + updatedAt?: string; +} export interface CreateEmailInput { clientMutationId?: string; /** The `Email` to be created by this mutation. */ @@ -1157,6 +1499,24 @@ export interface RoleTypePatch { id?: number; name?: string; } +export interface UpdatePrincipalEntityInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `PrincipalEntity` being updated. */ + principalEntityPatch: PrincipalEntityPatch; +} +/** Represents an update to a `PrincipalEntity`. Fields that are set will be updated. */ +export interface PrincipalEntityPatch { + id?: string; + createdAt?: string; + updatedAt?: string; + /** The principal this scoping row belongs to */ + principalId?: string; + /** The organization this principal is scoped to */ + entityId?: string; + /** Denormalized owner_id from principals table for RLS */ + ownerId?: string; +} export interface UpdateCryptoAddressInput { clientMutationId?: string; id: string; @@ -1303,6 +1663,10 @@ export interface DeleteRoleTypeInput { clientMutationId?: string; id: number; } +export interface DeletePrincipalEntityInput { + clientMutationId?: string; + id: string; +} export interface DeleteCryptoAddressInput { clientMutationId?: string; id: string; @@ -1352,6 +1716,13 @@ export interface RoleTypeConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `PrincipalEntity` values. */ +export interface PrincipalEntityConnection { + nodes: PrincipalEntity[]; + edges: PrincipalEntityEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `UserConnectedAccount` values. */ export interface UserConnectedAccountConnection { nodes: UserConnectedAccount[]; @@ -1366,6 +1737,13 @@ export interface CryptoAddressConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `Principal` values. */ +export interface PrincipalConnection { + nodes: Principal[]; + edges: PrincipalEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `PhoneNumber` values. */ export interface PhoneNumberConnection { nodes: PhoneNumber[]; @@ -1380,6 +1758,20 @@ export interface AuditLogAuthConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `PrincipalScopeOverride` values. */ +export interface PrincipalScopeOverrideConnection { + nodes: PrincipalScopeOverride[]; + edges: PrincipalScopeOverrideEdge[]; + pageInfo: PageInfo; + totalCount: number; +} +/** A connection to a list of `OrgApiKeyList` values. */ +export interface OrgApiKeyListConnection { + nodes: OrgApiKeyList[]; + edges: OrgApiKeyListEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `Email` values. */ export interface EmailConnection { nodes: Email[]; @@ -1415,6 +1807,14 @@ export interface SendAccountDeletionEmailPayload { export interface CheckPasswordPayload { clientMutationId?: string | null; } +export interface DeleteOrgPrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export interface DeletePrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} export interface DisconnectAccountPayload { clientMutationId?: string | null; result?: boolean | null; @@ -1439,6 +1839,10 @@ export interface ConfirmDeleteAccountPayload { clientMutationId?: string | null; result?: boolean | null; } +export interface RevokeOrgApiKeyPayload { + clientMutationId?: string | null; + result?: boolean | null; +} export interface SetPasswordPayload { clientMutationId?: string | null; result?: boolean | null; @@ -1479,10 +1883,18 @@ export interface LinkIdentityPayload { clientMutationId?: string | null; result?: boolean | null; } +export interface CreateOrgPrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} export interface ExtendTokenExpiresPayload { clientMutationId?: string | null; result?: ExtendTokenExpiresRecord[] | null; } +export interface CreateOrgApiKeyPayload { + clientMutationId?: string | null; + result?: CreateOrgApiKeyRecord | null; +} export interface CreateApiKeyPayload { clientMutationId?: string | null; result?: CreateApiKeyRecord | null; @@ -1491,6 +1903,10 @@ export interface RequestCrossOriginTokenPayload { clientMutationId?: string | null; result?: string | null; } +export interface CreatePrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} export interface ForgotPasswordPayload { clientMutationId?: string | null; } @@ -1509,6 +1925,12 @@ export interface CreateRoleTypePayload { roleType?: RoleType | null; roleTypeEdge?: RoleTypeEdge | null; } +export interface CreatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was created by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} export interface CreateUserConnectedAccountPayload { clientMutationId?: string | null; /** The `UserConnectedAccount` that was created by this mutation. */ @@ -1532,6 +1954,11 @@ export interface CreateAuditLogAuthPayload { auditLogAuth?: AuditLogAuth | null; auditLogAuthEdge?: AuditLogAuthEdge | null; } +export interface CreateOrgApiKeyListPayload { + clientMutationId?: string | null; + /** The `OrgApiKeyList` that was created by this mutation. */ + orgApiKeyList?: OrgApiKeyList | null; +} export interface CreateEmailPayload { clientMutationId?: string | null; /** The `Email` that was created by this mutation. */ @@ -1556,6 +1983,12 @@ export interface UpdateRoleTypePayload { roleType?: RoleType | null; roleTypeEdge?: RoleTypeEdge | null; } +export interface UpdatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was updated by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} export interface UpdateCryptoAddressPayload { clientMutationId?: string | null; /** The `CryptoAddress` that was updated by this mutation. */ @@ -1598,6 +2031,12 @@ export interface DeleteRoleTypePayload { roleType?: RoleType | null; roleTypeEdge?: RoleTypeEdge | null; } +export interface DeletePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was deleted by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} export interface DeleteCryptoAddressPayload { clientMutationId?: string | null; /** The `CryptoAddress` that was deleted by this mutation. */ @@ -1671,6 +2110,12 @@ export interface RoleTypeEdge { /** The `RoleType` at the end of the edge. */ node?: RoleType | null; } +/** A `PrincipalEntity` edge in the connection. */ +export interface PrincipalEntityEdge { + cursor?: string | null; + /** The `PrincipalEntity` at the end of the edge. */ + node?: PrincipalEntity | null; +} /** A `UserConnectedAccount` edge in the connection. */ export interface UserConnectedAccountEdge { cursor?: string | null; @@ -1683,6 +2128,12 @@ export interface CryptoAddressEdge { /** The `CryptoAddress` at the end of the edge. */ node?: CryptoAddress | null; } +/** A `Principal` edge in the connection. */ +export interface PrincipalEdge { + cursor?: string | null; + /** The `Principal` at the end of the edge. */ + node?: Principal | null; +} /** A `PhoneNumber` edge in the connection. */ export interface PhoneNumberEdge { cursor?: string | null; @@ -1695,6 +2146,18 @@ export interface AuditLogAuthEdge { /** The `AuditLogAuth` at the end of the edge. */ node?: AuditLogAuth | null; } +/** A `PrincipalScopeOverride` edge in the connection. */ +export interface PrincipalScopeOverrideEdge { + cursor?: string | null; + /** The `PrincipalScopeOverride` at the end of the edge. */ + node?: PrincipalScopeOverride | null; +} +/** A `OrgApiKeyList` edge in the connection. */ +export interface OrgApiKeyListEdge { + cursor?: string | null; + /** The `OrgApiKeyList` at the end of the edge. */ + node?: OrgApiKeyList | null; +} /** A `Email` edge in the connection. */ export interface EmailEdge { cursor?: string | null; @@ -1776,6 +2239,11 @@ export interface ExtendTokenExpiresRecord { sessionId?: string | null; expiresAt?: string | null; } +export interface CreateOrgApiKeyRecord { + apiKey?: string | null; + keyId?: string | null; + expiresAt?: string | null; +} export interface CreateApiKeyRecord { apiKey?: string | null; keyId?: string | null; diff --git a/sdk/constructive-react/src/auth/types.ts b/sdk/constructive-react/src/auth/types.ts index 7edfa4a332..cadd1889c5 100644 --- a/sdk/constructive-react/src/auth/types.ts +++ b/sdk/constructive-react/src/auth/types.ts @@ -7,6 +7,35 @@ export type Base64EncodedBinary = unknown; export type ConstructiveInternalTypeEmail = unknown; export type ConstructiveInternalTypeImage = unknown; export type ConstructiveInternalTypeOrigin = unknown; +export interface Principal { + id: string | null; + createdAt: string | null; + updatedAt: string | null; + ownerId: string | null; + userId: string | null; + name: string | null; + allowedMask: string | null; + isReadOnly: boolean | null; + bypassStepUp: boolean | null; +} +export interface PrincipalEntity { + id: string | null; + createdAt: string | null; + updatedAt: string | null; + principalId: string | null; + entityId: string | null; + ownerId: string | null; +} +export interface PrincipalScopeOverride { + id: string | null; + createdAt: string | null; + updatedAt: string | null; + principalId: string | null; + membershipType: number | null; + allowedMask: string | null; + isAdmin: boolean | null; + isReadOnly: boolean | null; +} export interface Email { id: string | null; ownerId: string | null; @@ -85,6 +114,20 @@ export interface UserConnectedAccount { createdAt: string | null; updatedAt: string | null; } +export interface OrgApiKeyList { + id: string | null; + keyId: string | null; + name: string | null; + principalId: string | null; + orgId: string | null; + expiresAt: string | null; + revokedAt: string | null; + lastUsedAt: string | null; + mfaLevel: string | null; + accessLevel: string | null; + createdAt: string | null; + updatedAt: string | null; +} export interface User { id: string | null; username: string | null; diff --git a/sdk/constructive-react/src/compute/hooks/README.md b/sdk/constructive-react/src/compute/hooks/README.md index 1b13045117..63d193fd96 100644 --- a/sdk/constructive-react/src/compute/hooks/README.md +++ b/sdk/constructive-react/src/compute/hooks/README.md @@ -89,16 +89,16 @@ function App() { | `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 | +| `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 | | `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. | @@ -128,9 +128,9 @@ function App() { | `useSaveGraphMutation` | Mutation | saveGraph | | `useAddEdgeAndSaveMutation` | Mutation | addEdgeAndSave | | `useAddNodeAndSaveMutation` | Mutation | addNodeAndSave | +| `useImportGraphJsonMutation` | Mutation | importGraphJson | | `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. @@ -386,46 +386,46 @@ const { mutate: create } = useCreateFunctionExecutionLogMutation({ create({ invocationId: '', taskIdentifier: '', logLevel: '', message: '', metadata: '', actorId: '', databaseId: '' }); ``` -### FunctionGraphExecutionNodeState +### FunctionGraph ```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 } }, +// List all functionGraphs +const { data, isLoading } = useFunctionGraphsQuery({ + selection: { fields: { id: true, databaseId: true, storeId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }, }); -// Get one functionGraphExecutionNodeState -const { data: item } = useFunctionGraphExecutionNodeStateQuery({ +// Get one functionGraph +const { data: item } = useFunctionGraphQuery({ 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 } }, + selection: { fields: { id: true, databaseId: true, storeId: true, context: true, name: true, description: true, definitionsCommitId: true, isValid: true, validationErrors: true, createdBy: true, createdAt: true, updatedAt: true } }, }); -// Create a functionGraphExecutionNodeState -const { mutate: create } = useCreateFunctionGraphExecutionNodeStateMutation({ +// Create a functionGraph +const { mutate: create } = useCreateFunctionGraphMutation({ selection: { fields: { id: true } }, }); -create({ executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }); +create({ databaseId: '', storeId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }); ``` -### FunctionGraph +### FunctionGraphExecutionNodeState ```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 } }, +// 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 functionGraph -const { data: item } = useFunctionGraphQuery({ +// Get one functionGraphExecutionNodeState +const { data: item } = useFunctionGraphExecutionNodeStateQuery({ 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 } }, + 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 functionGraph -const { mutate: create } = useCreateFunctionGraphMutation({ +// Create a functionGraphExecutionNodeState +const { mutate: create } = useCreateFunctionGraphExecutionNodeStateMutation({ selection: { fields: { id: true } }, }); -create({ databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }); +create({ executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }); ``` ### OrgFunctionInvocation @@ -475,20 +475,20 @@ create({ actorId: '', databaseId: '', taskIdentifier: '', pa ```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 } }, + selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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 } }, + selection: { fields: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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: '' }); +create({ startedAt: '', graphId: '', invocationId: '', databaseId: '', outputNode: '', outputPort: '', status: '', inputPayload: '', outputPayload: '', nodeOutputs: '', executionPlan: '', currentWave: '', parentExecutionId: '', parentNodeName: '', definitionsCommitId: '', tickCount: '', completedAt: '', maxTicks: '', maxPendingJobs: '', timeoutAt: '', errorCode: '', errorMessage: '' }); ``` ### FunctionDefinition @@ -613,38 +613,38 @@ addNodeAndSave |----------|------| | `input` | AddNodeAndSaveInput (required) | -### `useAddEdgeMutation` +### `useImportGraphJsonMutation` -addEdge +importGraphJson - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddEdgeInput (required) | + | `input` | ImportGraphJsonInput (required) | -### `useAddNodeMutation` +### `useAddEdgeMutation` -addNode +addEdge - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddNodeInput (required) | + | `input` | AddEdgeInput (required) | -### `useImportGraphJsonMutation` +### `useAddNodeMutation` -importGraphJson +addNode - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | ImportGraphJsonInput (required) | + | `input` | AddNodeInput (required) | ### `useInsertNodeAtPathMutation` diff --git a/sdk/constructive-react/src/compute/hooks/index.ts b/sdk/constructive-react/src/compute/hooks/index.ts index 599bf53945..288266ba6a 100644 --- a/sdk/constructive-react/src/compute/hooks/index.ts +++ b/sdk/constructive-react/src/compute/hooks/index.ts @@ -2,7 +2,7 @@ * 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 + * Tables: GetAllRecord, FunctionApiBinding, FunctionDeployment, FunctionGraphRef, FunctionGraphStore, FunctionGraphObject, FunctionDeploymentEvent, OrgFunctionExecutionLog, FunctionGraphExecutionOutput, FunctionGraphCommit, SecretDefinition, FunctionExecutionLog, FunctionGraph, FunctionGraphExecutionNodeState, OrgFunctionInvocation, FunctionInvocation, FunctionGraphExecution, FunctionDefinition * * Usage: * diff --git a/sdk/constructive-react/src/compute/hooks/invalidation.ts b/sdk/constructive-react/src/compute/hooks/invalidation.ts index 4ec68a28ac..4b75c94596 100644 --- a/sdk/constructive-react/src/compute/hooks/invalidation.ts +++ b/sdk/constructive-react/src/compute/hooks/invalidation.ts @@ -27,8 +27,8 @@ import { functionGraphCommitKeys, secretDefinitionKeys, functionExecutionLogKeys, - functionGraphExecutionNodeStateKeys, functionGraphKeys, + functionGraphExecutionNodeStateKeys, orgFunctionInvocationKeys, functionInvocationKeys, functionGraphExecutionKeys, @@ -258,40 +258,40 @@ export const invalidate = { queryKey: functionExecutionLogKeys.detail(id), }), }, - /** Invalidate functionGraphExecutionNodeState queries */ functionGraphExecutionNodeState: { - /** Invalidate all functionGraphExecutionNodeState queries */ all: (queryClient: QueryClient) => + /** Invalidate functionGraph queries */ functionGraph: { + /** Invalidate all functionGraph queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.all, + queryKey: functionGraphKeys.all, }), - /** Invalidate functionGraphExecutionNodeState list queries */ lists: ( - queryClient: QueryClient - ) => + /** Invalidate functionGraph list queries */ lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.lists(), + queryKey: functionGraphKeys.lists(), }), - /** Invalidate a specific functionGraphExecutionNodeState */ detail: ( + /** Invalidate a specific functionGraph */ detail: ( queryClient: QueryClient, id: string | number ) => queryClient.invalidateQueries({ - queryKey: functionGraphExecutionNodeStateKeys.detail(id), + queryKey: functionGraphKeys.detail(id), }), }, - /** Invalidate functionGraph queries */ functionGraph: { - /** Invalidate all functionGraph queries */ all: (queryClient: QueryClient) => + /** Invalidate functionGraphExecutionNodeState queries */ functionGraphExecutionNodeState: { + /** Invalidate all functionGraphExecutionNodeState queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: functionGraphKeys.all, + queryKey: functionGraphExecutionNodeStateKeys.all, }), - /** Invalidate functionGraph list queries */ lists: (queryClient: QueryClient) => + /** Invalidate functionGraphExecutionNodeState list queries */ lists: ( + queryClient: QueryClient + ) => queryClient.invalidateQueries({ - queryKey: functionGraphKeys.lists(), + queryKey: functionGraphExecutionNodeStateKeys.lists(), }), - /** Invalidate a specific functionGraph */ detail: ( + /** Invalidate a specific functionGraphExecutionNodeState */ detail: ( queryClient: QueryClient, id: string | number ) => queryClient.invalidateQueries({ - queryKey: functionGraphKeys.detail(id), + queryKey: functionGraphExecutionNodeStateKeys.detail(id), }), }, /** Invalidate orgFunctionInvocation queries */ orgFunctionInvocation: { @@ -471,20 +471,20 @@ export const remove = { queryKey: functionExecutionLogKeys.detail(id), }); }, - /** Remove functionGraphExecutionNodeState from cache */ functionGraphExecutionNodeState: ( + /** Remove functionGraph from cache */ functionGraph: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: functionGraphExecutionNodeStateKeys.detail(id), + queryKey: functionGraphKeys.detail(id), }); }, - /** Remove functionGraph from cache */ functionGraph: ( + /** Remove functionGraphExecutionNodeState from cache */ functionGraphExecutionNodeState: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: functionGraphKeys.detail(id), + queryKey: functionGraphExecutionNodeStateKeys.detail(id), }); }, /** Remove orgFunctionInvocation from cache */ orgFunctionInvocation: ( diff --git a/sdk/constructive-react/src/compute/hooks/mutation-keys.ts b/sdk/constructive-react/src/compute/hooks/mutation-keys.ts index f0f7bed160..1fd9301b18 100644 --- a/sdk/constructive-react/src/compute/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/compute/hooks/mutation-keys.ts @@ -135,6 +135,15 @@ export const functionExecutionLogMutationKeys = { /** Delete functionExecutionLog mutation key */ delete: (id: string | number) => ['mutation', 'functionexecutionlog', '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 functionGraphExecutionNodeStateMutationKeys = { /** All functionGraphExecutionNodeState mutation keys */ all: [ 'mutation', @@ -147,15 +156,6 @@ export const functionGraphExecutionNodeStateMutationKeys = { /** 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', @@ -236,6 +236,10 @@ export const customMutationKeys = { identifier ? (['mutation', 'addNodeAndSave', identifier] as const) : (['mutation', 'addNodeAndSave'] as const), + /** Mutation key for importGraphJson */ importGraphJson: (identifier?: string) => + identifier + ? (['mutation', 'importGraphJson', identifier] as const) + : (['mutation', 'importGraphJson'] as const), /** Mutation key for addEdge */ addEdge: (identifier?: string) => identifier ? (['mutation', 'addEdge', identifier] as const) @@ -244,10 +248,6 @@ export const customMutationKeys = { 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) @@ -296,8 +296,8 @@ export const mutationKeys = { functionGraphCommit: functionGraphCommitMutationKeys, secretDefinition: secretDefinitionMutationKeys, functionExecutionLog: functionExecutionLogMutationKeys, - functionGraphExecutionNodeState: functionGraphExecutionNodeStateMutationKeys, functionGraph: functionGraphMutationKeys, + functionGraphExecutionNodeState: functionGraphExecutionNodeStateMutationKeys, orgFunctionInvocation: orgFunctionInvocationMutationKeys, functionInvocation: functionInvocationMutationKeys, functionGraphExecution: functionGraphExecutionMutationKeys, diff --git a/sdk/constructive-react/src/compute/hooks/mutations/index.ts b/sdk/constructive-react/src/compute/hooks/mutations/index.ts index 579248665b..30af438f1f 100644 --- a/sdk/constructive-react/src/compute/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/compute/hooks/mutations/index.ts @@ -37,12 +37,12 @@ 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 './useCreateFunctionGraphExecutionNodeStateMutation'; +export * from './useUpdateFunctionGraphExecutionNodeStateMutation'; +export * from './useDeleteFunctionGraphExecutionNodeStateMutation'; export * from './useCreateOrgFunctionInvocationMutation'; export * from './useUpdateOrgFunctionInvocationMutation'; export * from './useDeleteOrgFunctionInvocationMutation'; @@ -63,9 +63,9 @@ export * from './useCopyGraphMutation'; export * from './useSaveGraphMutation'; export * from './useAddEdgeAndSaveMutation'; export * from './useAddNodeAndSaveMutation'; +export * from './useImportGraphJsonMutation'; 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/queries/index.ts b/sdk/constructive-react/src/compute/hooks/queries/index.ts index b4221dda67..25dd54c869 100644 --- a/sdk/constructive-react/src/compute/hooks/queries/index.ts +++ b/sdk/constructive-react/src/compute/hooks/queries/index.ts @@ -26,10 +26,10 @@ 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 './useFunctionGraphExecutionNodeStatesQuery'; +export * from './useFunctionGraphExecutionNodeStateQuery'; export * from './useOrgFunctionInvocationsQuery'; export * from './useOrgFunctionInvocationQuery'; export * from './useFunctionInvocationsQuery'; diff --git a/sdk/constructive-react/src/compute/hooks/query-keys.ts b/sdk/constructive-react/src/compute/hooks/query-keys.ts index 840d3786cd..1a6bc64ac2 100644 --- a/sdk/constructive-react/src/compute/hooks/query-keys.ts +++ b/sdk/constructive-react/src/compute/hooks/query-keys.ts @@ -128,6 +128,15 @@ export const functionExecutionLogKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...functionExecutionLogKeys.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 functionGraphExecutionNodeStateKeys = { /** All functionGraphExecutionNodeState queries */ all: [ 'functiongraphexecutionnodestate', @@ -140,15 +149,6 @@ export const functionGraphExecutionNodeStateKeys = { /** 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, @@ -229,8 +229,8 @@ export const queryKeys = { functionGraphCommit: functionGraphCommitKeys, secretDefinition: secretDefinitionKeys, functionExecutionLog: functionExecutionLogKeys, - functionGraphExecutionNodeState: functionGraphExecutionNodeStateKeys, functionGraph: functionGraphKeys, + functionGraphExecutionNodeState: functionGraphExecutionNodeStateKeys, orgFunctionInvocation: orgFunctionInvocationKeys, functionInvocation: functionInvocationKeys, functionGraphExecution: functionGraphExecutionKeys, diff --git a/sdk/constructive-react/src/compute/orm/README.md b/sdk/constructive-react/src/compute/orm/README.md index c266bdfcb7..37af8ed014 100644 --- a/sdk/constructive-react/src/compute/orm/README.md +++ b/sdk/constructive-react/src/compute/orm/README.md @@ -33,8 +33,8 @@ const db = createClient({ | `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 | +| `functionGraphExecutionNodeState` | findMany, findOne, create, update, delete | | `orgFunctionInvocation` | findMany, findOne, create, update, delete | | `functionInvocation` | findMany, findOne, create, update, delete | | `functionGraphExecution` | findMany, findOne, create, update, delete | @@ -470,85 +470,84 @@ const updated = await db.functionExecutionLog.update({ where: { id: '' }, const deleted = await db.functionExecutionLog.delete({ where: { id: '' } }).execute(); ``` -### `db.functionGraphExecutionNodeState` +### `db.functionGraph` -CRUD operations for FunctionGraphExecutionNodeState records. +CRUD operations for FunctionGraph 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 | +| `storeId` | 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 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(); +// List all functionGraph records +const items = await db.functionGraph.findMany({ select: { id: true, databaseId: true, storeId: 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.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(); +const item = await db.functionGraph.findOne({ id: '', select: { id: true, databaseId: true, storeId: 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.functionGraphExecutionNodeState.create({ data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, select: { id: true } }).execute(); +const created = await db.functionGraph.create({ data: { databaseId: '', storeId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); // Update -const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); +const updated = await db.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); +const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); ``` -### `db.functionGraph` +### `db.functionGraphExecutionNodeState` -CRUD operations for FunctionGraph records. +CRUD operations for FunctionGraphExecutionNodeState records. **Fields:** | Field | Type | Editable | |-------|------|----------| +| `createdAt` | Datetime | No | | `id` | UUID | No | +| `executionId` | UUID | Yes | | `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 | +| `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 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(); +// 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.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(); +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.functionGraph.create({ data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); +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.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); +const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); ``` ### `db.orgFunctionInvocation` @@ -649,7 +648,6 @@ CRUD operations for FunctionGraphExecution records. | `graphId` | UUID | Yes | | `invocationId` | UUID | Yes | | `databaseId` | UUID | Yes | -| `entityId` | UUID | Yes | | `outputNode` | String | Yes | | `outputPort` | String | Yes | | `status` | String | Yes | @@ -673,13 +671,13 @@ CRUD operations for FunctionGraphExecution records. ```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(); +const items = await db.functionGraphExecution.findMany({ select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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(); +const item = await db.functionGraphExecution.findOne({ id: '', select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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(); +const created = await db.functionGraphExecution.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', 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(); @@ -882,49 +880,49 @@ addNodeAndSave const result = await db.mutation.addNodeAndSave({ input: '' }).execute(); ``` -### `db.mutation.addEdge` +### `db.mutation.importGraphJson` -addEdge +importGraphJson - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddEdgeInput (required) | + | `input` | ImportGraphJsonInput (required) | ```typescript -const result = await db.mutation.addEdge({ input: '' }).execute(); +const result = await db.mutation.importGraphJson({ input: '' }).execute(); ``` -### `db.mutation.addNode` +### `db.mutation.addEdge` -addNode +addEdge - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddNodeInput (required) | + | `input` | AddEdgeInput (required) | ```typescript -const result = await db.mutation.addNode({ input: '' }).execute(); +const result = await db.mutation.addEdge({ input: '' }).execute(); ``` -### `db.mutation.importGraphJson` +### `db.mutation.addNode` -importGraphJson +addNode - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | ImportGraphJsonInput (required) | + | `input` | AddNodeInput (required) | ```typescript -const result = await db.mutation.importGraphJson({ input: '' }).execute(); +const result = await db.mutation.addNode({ input: '' }).execute(); ``` ### `db.mutation.insertNodeAtPath` diff --git a/sdk/constructive-react/src/compute/orm/index.ts b/sdk/constructive-react/src/compute/orm/index.ts index 99193c1d28..818e6503db 100644 --- a/sdk/constructive-react/src/compute/orm/index.ts +++ b/sdk/constructive-react/src/compute/orm/index.ts @@ -17,8 +17,8 @@ import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecuti 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 { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; import { OrgFunctionInvocationModel } from './models/orgFunctionInvocation'; import { FunctionInvocationModel } from './models/functionInvocation'; import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; @@ -70,8 +70,8 @@ export function createClient(config: OrmClientConfig) { functionGraphCommit: new FunctionGraphCommitModel(client), secretDefinition: new SecretDefinitionModel(client), functionExecutionLog: new FunctionExecutionLogModel(client), - functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), functionGraph: new FunctionGraphModel(client), + functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), orgFunctionInvocation: new OrgFunctionInvocationModel(client), functionInvocation: new FunctionInvocationModel(client), functionGraphExecution: new FunctionGraphExecutionModel(client), diff --git a/sdk/constructive-react/src/compute/orm/input-types.ts b/sdk/constructive-react/src/compute/orm/input-types.ts index f88c3e77d1..2426122692 100644 --- a/sdk/constructive-react/src/compute/orm/input-types.ts +++ b/sdk/constructive-react/src/compute/orm/input-types.ts @@ -444,33 +444,6 @@ export interface FunctionExecutionLog { /** 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 */ @@ -479,8 +452,6 @@ export interface FunctionGraph { 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) */ @@ -500,6 +471,33 @@ export interface FunctionGraph { /** Timestamp of last modification */ updatedAt?: 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; +} /** 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) */ @@ -576,8 +574,6 @@ export interface FunctionGraphExecution { 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) */ @@ -702,8 +698,8 @@ export interface FunctionGraphExecutionOutputRelations {} export interface FunctionGraphCommitRelations {} export interface SecretDefinitionRelations {} export interface FunctionExecutionLogRelations {} -export interface FunctionGraphExecutionNodeStateRelations {} export interface FunctionGraphRelations {} +export interface FunctionGraphExecutionNodeStateRelations {} export interface OrgFunctionInvocationRelations {} export interface FunctionInvocationRelations {} export interface FunctionGraphExecutionRelations { @@ -730,9 +726,9 @@ export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGra export type SecretDefinitionWithRelations = SecretDefinition & SecretDefinitionRelations; export type FunctionExecutionLogWithRelations = FunctionExecutionLog & FunctionExecutionLogRelations; +export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & FunctionGraphExecutionNodeStateRelations; -export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; export type OrgFunctionInvocationWithRelations = OrgFunctionInvocation & OrgFunctionInvocationRelations; export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; @@ -862,25 +858,10 @@ export type FunctionExecutionLogSelect = { 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; @@ -891,6 +872,20 @@ export type FunctionGraphSelect = { createdAt?: boolean; updatedAt?: 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 OrgFunctionInvocationSelect = { createdAt?: boolean; id?: boolean; @@ -930,7 +925,6 @@ export type FunctionGraphExecutionSelect = { graphId?: boolean; invocationId?: boolean; databaseId?: boolean; - entityId?: boolean; outputNode?: boolean; outputPort?: boolean; status?: boolean; @@ -1276,38 +1270,6 @@ export interface 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; @@ -1315,8 +1277,6 @@ export interface FunctionGraphFilter { 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. */ @@ -1342,6 +1302,38 @@ export interface FunctionGraphFilter { /** Negates the expression. */ not?: FunctionGraphFilter; } +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 OrgFunctionInvocationFilter { /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; @@ -1427,8 +1419,6 @@ export interface FunctionGraphExecutionFilter { 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. */ @@ -1777,34 +1767,6 @@ export type FunctionExecutionLogOrderBy = | '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' @@ -1815,8 +1777,6 @@ export type FunctionGraphOrderBy = | 'DATABASE_ID_DESC' | 'STORE_ID_ASC' | 'STORE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'CONTEXT_ASC' | 'CONTEXT_DESC' | 'NAME_ASC' @@ -1835,6 +1795,34 @@ export type FunctionGraphOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_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 OrgFunctionInvocationOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -1915,8 +1903,6 @@ export type FunctionGraphExecutionOrderBy = | 'INVOCATION_ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'OUTPUT_NODE_ASC' | 'OUTPUT_NODE_DESC' | 'OUTPUT_PORT_ASC' @@ -2350,6 +2336,40 @@ export interface DeleteFunctionExecutionLogInput { clientMutationId?: string; id: string; } +export interface CreateFunctionGraphInput { + clientMutationId?: string; + functionGraph: { + databaseId: string; + storeId: string; + context?: string; + name?: string; + description?: string; + definitionsCommitId: string; + isValid?: boolean; + validationErrors?: Record; + createdBy?: string; + }; +} +export interface FunctionGraphPatch { + databaseId?: string | null; + storeId?: 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 CreateFunctionGraphExecutionNodeStateInput { clientMutationId?: string; functionGraphExecutionNodeState: { @@ -2386,42 +2406,6 @@ 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: { @@ -2511,7 +2495,6 @@ export interface CreateFunctionGraphExecutionInput { graphId: string; invocationId?: string; databaseId: string; - entityId?: string; outputNode: string; outputPort?: string; status?: string; @@ -2537,7 +2520,6 @@ export interface FunctionGraphExecutionPatch { graphId?: string | null; invocationId?: string | null; databaseId?: string | null; - entityId?: string | null; outputNode?: string | null; outputPort?: string | null; status?: string | null; @@ -2695,6 +2677,16 @@ export interface AddNodeAndSaveInput { meta?: Record; message?: string; } +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: Record; + context?: string; + description?: string; + createdBy?: string; + definitionsCommitId?: string; +} export interface AddEdgeInput { clientMutationId?: string; databaseId?: string; @@ -2717,17 +2709,6 @@ export interface AddNodeInput { 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; @@ -3102,8 +3083,6 @@ export interface FunctionGraphExecutionInput { 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) */ @@ -3680,27 +3659,27 @@ export type AddNodeAndSavePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface AddEdgePayload { +export interface ImportGraphJsonPayload { clientMutationId?: string | null; result?: string | null; } -export type AddEdgePayloadSelect = { +export type ImportGraphJsonPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface AddNodePayload { +export interface AddEdgePayload { clientMutationId?: string | null; result?: string | null; } -export type AddNodePayloadSelect = { +export type AddEdgePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface ImportGraphJsonPayload { +export interface AddNodePayload { clientMutationId?: string | null; result?: string | null; } -export type ImportGraphJsonPayloadSelect = { +export type AddNodePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; @@ -4237,6 +4216,44 @@ export type DeleteFunctionExecutionLogPayloadSelect = { select: FunctionExecutionLogEdgeSelect; }; }; +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 CreateFunctionGraphExecutionNodeStatePayload { clientMutationId?: string | null; /** The `FunctionGraphExecutionNodeState` that was created by this mutation. */ @@ -4282,44 +4299,6 @@ export type DeleteFunctionGraphExecutionNodeStatePayloadSelect = { 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. */ @@ -4632,18 +4611,6 @@ export type FunctionExecutionLogEdgeSelect = { 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; @@ -4656,6 +4623,18 @@ export type FunctionGraphEdgeSelect = { select: FunctionGraphSelect; }; }; +/** 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 `OrgFunctionInvocation` edge in the connection. */ export interface OrgFunctionInvocationEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/compute/orm/models/index.ts b/sdk/constructive-react/src/compute/orm/models/index.ts index 51e9b9f05d..2d012df7c9 100644 --- a/sdk/constructive-react/src/compute/orm/models/index.ts +++ b/sdk/constructive-react/src/compute/orm/models/index.ts @@ -15,8 +15,8 @@ export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutpu export { FunctionGraphCommitModel } from './functionGraphCommit'; export { SecretDefinitionModel } from './secretDefinition'; export { FunctionExecutionLogModel } from './functionExecutionLog'; -export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; export { FunctionGraphModel } from './functionGraph'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; export { OrgFunctionInvocationModel } from './orgFunctionInvocation'; export { FunctionInvocationModel } from './functionInvocation'; export { FunctionGraphExecutionModel } from './functionGraphExecution'; diff --git a/sdk/constructive-react/src/compute/orm/mutation/index.ts b/sdk/constructive-react/src/compute/orm/mutation/index.ts index b4abf9132b..932f75c399 100644 --- a/sdk/constructive-react/src/compute/orm/mutation/index.ts +++ b/sdk/constructive-react/src/compute/orm/mutation/index.ts @@ -15,9 +15,9 @@ import type { SaveGraphInput, AddEdgeAndSaveInput, AddNodeAndSaveInput, + ImportGraphJsonInput, AddEdgeInput, AddNodeInput, - ImportGraphJsonInput, InsertNodeAtPathInput, StartExecutionInput, ProvisionBucketInput, @@ -29,9 +29,9 @@ import type { SaveGraphPayload, AddEdgeAndSavePayload, AddNodeAndSavePayload, + ImportGraphJsonPayload, AddEdgePayload, AddNodePayload, - ImportGraphJsonPayload, InsertNodeAtPathPayload, StartExecutionPayload, ProvisionBucketPayload, @@ -43,9 +43,9 @@ import type { SaveGraphPayloadSelect, AddEdgeAndSavePayloadSelect, AddNodeAndSavePayloadSelect, + ImportGraphJsonPayloadSelect, AddEdgePayloadSelect, AddNodePayloadSelect, - ImportGraphJsonPayloadSelect, InsertNodeAtPathPayloadSelect, StartExecutionPayloadSelect, ProvisionBucketPayloadSelect, @@ -75,15 +75,15 @@ export interface AddEdgeAndSaveVariables { export interface AddNodeAndSaveVariables { input: AddNodeAndSaveInput; } +export interface ImportGraphJsonVariables { + input: ImportGraphJsonInput; +} export interface AddEdgeVariables { input: AddEdgeInput; } export interface AddNodeVariables { input: AddNodeInput; } -export interface ImportGraphJsonVariables { - input: ImportGraphJsonInput; -} export interface InsertNodeAtPathVariables { input: InsertNodeAtPathInput; } @@ -334,6 +334,35 @@ export function createMutationOperations(client: OrmClient) { 'AddNodeAndSavePayload' ), }), + 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' + ), + }), addEdge: ( args: AddEdgeVariables, options: { @@ -392,35 +421,6 @@ export function createMutationOperations(client: OrmClient) { '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: { diff --git a/sdk/constructive-react/src/compute/schema-types.ts b/sdk/constructive-react/src/compute/schema-types.ts index d200e93ff1..a85919a44a 100644 --- a/sdk/constructive-react/src/compute/schema-types.ts +++ b/sdk/constructive-react/src/compute/schema-types.ts @@ -277,35 +277,6 @@ export type FunctionExecutionLogOrderBy = | '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' @@ -317,8 +288,6 @@ export type FunctionGraphOrderBy = | 'DATABASE_ID_DESC' | 'STORE_ID_ASC' | 'STORE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'CONTEXT_ASC' | 'CONTEXT_DESC' | 'NAME_ASC' @@ -337,6 +306,35 @@ export type FunctionGraphOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_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 `OrgFunctionInvocation`. */ export type OrgFunctionInvocationOrderBy = | 'NATURAL' @@ -420,8 +418,6 @@ export type FunctionGraphExecutionOrderBy = | 'INVOCATION_ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'OUTPUT_NODE_ASC' | 'OUTPUT_NODE_DESC' | 'OUTPUT_PORT_ASC' @@ -910,39 +906,6 @@ export interface 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. */ @@ -951,8 +914,6 @@ export interface FunctionGraphFilter { 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. */ @@ -978,6 +939,39 @@ export interface FunctionGraphFilter { /** Negates the expression. */ not?: FunctionGraphFilter; } +/** 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 `OrgFunctionInvocation` object types. All fields are combined with a logical ‘and.’ */ export interface OrgFunctionInvocationFilter { /** Filter by the object’s `createdAt` field. */ @@ -1066,8 +1060,6 @@ export interface FunctionGraphExecutionFilter { 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. */ @@ -1172,7 +1164,16 @@ export interface CreateFunctionGraphInput { name?: string; context?: string; description?: string; - entityId?: string; + createdBy?: string; + definitionsCommitId?: string; +} +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: unknown; + context?: string; + description?: string; createdBy?: string; definitionsCommitId?: string; } @@ -1198,17 +1199,6 @@ export interface AddNodeInput { 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; @@ -1633,8 +1623,6 @@ export interface FunctionGraphExecutionInput { 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) */ @@ -1986,6 +1974,40 @@ export interface FunctionExecutionLogPatch { /** Database that owns this resource (database-scoped isolation) */ databaseId?: 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; + /** 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 UpdateFunctionGraphExecutionNodeStateInput { clientMutationId?: string; /** Timestamp of node state creation (partition key) */ @@ -2022,42 +2044,6 @@ export interface FunctionGraphExecutionNodeStatePatch { /** 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) */ @@ -2209,8 +2195,6 @@ export interface FunctionGraphExecutionPatch { 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) */ @@ -2374,6 +2358,11 @@ export interface DeleteFunctionExecutionLogInput { /** Unique log entry identifier */ id: string; } +export interface DeleteFunctionGraphInput { + clientMutationId?: string; + /** Unique graph identifier */ + id: string; +} export interface DeleteFunctionGraphExecutionNodeStateInput { clientMutationId?: string; /** Timestamp of node state creation (partition key) */ @@ -2381,11 +2370,6 @@ export interface DeleteFunctionGraphExecutionNodeStateInput { /** 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) */ @@ -2501,13 +2485,6 @@ export interface FunctionExecutionLogConnection { 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[]; @@ -2515,6 +2492,13 @@ export interface FunctionGraphConnection { 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 `OrgFunctionInvocation` values. */ export interface OrgFunctionInvocationConnection { nodes: OrgFunctionInvocation[]; @@ -2588,15 +2572,15 @@ export interface CreateFunctionGraphPayload { clientMutationId?: string | null; result?: string | null; } -export interface AddEdgePayload { +export interface ImportGraphJsonPayload { clientMutationId?: string | null; result?: string | null; } -export interface AddNodePayload { +export interface AddEdgePayload { clientMutationId?: string | null; result?: string | null; } -export interface ImportGraphJsonPayload { +export interface AddNodePayload { clientMutationId?: string | null; result?: string | null; } @@ -2764,18 +2748,18 @@ export interface UpdateFunctionExecutionLogPayload { 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 UpdateFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was updated by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} export interface UpdateOrgFunctionInvocationPayload { clientMutationId?: string | null; /** The `OrgFunctionInvocation` that was updated by this mutation. */ @@ -2866,18 +2850,18 @@ export interface DeleteFunctionExecutionLogPayload { 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 DeleteFunctionGraphExecutionNodeStatePayload { + clientMutationId?: string | null; + /** The `FunctionGraphExecutionNodeState` that was deleted by this mutation. */ + functionGraphExecutionNodeState?: FunctionGraphExecutionNodeState | null; + functionGraphExecutionNodeStateEdge?: FunctionGraphExecutionNodeStateEdge | null; +} export interface DeleteOrgFunctionInvocationPayload { clientMutationId?: string | null; /** The `OrgFunctionInvocation` that was deleted by this mutation. */ @@ -2999,18 +2983,18 @@ export interface FunctionExecutionLogEdge { /** 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 `FunctionGraphExecutionNodeState` edge in the connection. */ +export interface FunctionGraphExecutionNodeStateEdge { + cursor?: string | null; + /** The `FunctionGraphExecutionNodeState` at the end of the edge. */ + node?: FunctionGraphExecutionNodeState | null; +} /** A `OrgFunctionInvocation` edge in the connection. */ export interface OrgFunctionInvocationEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/compute/types.ts b/sdk/constructive-react/src/compute/types.ts index ba56afb0fd..b7306242cb 100644 --- a/sdk/constructive-react/src/compute/types.ts +++ b/sdk/constructive-react/src/compute/types.ts @@ -121,25 +121,10 @@ export interface FunctionExecutionLog { 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; @@ -150,6 +135,20 @@ export interface FunctionGraph { createdAt: string | null; updatedAt: 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 OrgFunctionInvocation { createdAt: string | null; id: string | null; @@ -189,7 +188,6 @@ export interface FunctionGraphExecution { graphId: string | null; invocationId: string | null; databaseId: string | null; - entityId: string | null; outputNode: string | null; outputPort: string | null; status: string | null; diff --git a/sdk/constructive-react/src/modules/README.md b/sdk/constructive-react/src/modules/README.md index ae5832ff41..64c92c8280 100644 --- a/sdk/constructive-react/src/modules/README.md +++ b/sdk/constructive-react/src/modules/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 59 +- **Tables:** 60 - **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 e6d1d52b26..b29d2bf861 100644 --- a/sdk/constructive-react/src/modules/hooks/README.md +++ b/sdk/constructive-react/src/modules/hooks/README.md @@ -217,16 +217,6 @@ function App() { | `useCreateSecureTableProvisionMutation` | Mutation | Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grants[] array (supporting per-role privilege targeting), (3) create RLS policies via policies[] array (supporting multiple Authz* policies per row). Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent. | | `useUpdateSecureTableProvisionMutation` | Mutation | Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grants[] array (supporting per-role privilege targeting), (3) create RLS policies via policies[] array (supporting multiple Authz* policies per row). Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent. | | `useDeleteSecureTableProvisionMutation` | Mutation | Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grants[] array (supporting per-role privilege targeting), (3) create RLS policies via policies[] array (supporting multiple Authz* policies per row). Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent. | -| `useMerkleStoreModulesQuery` | Query | List all merkleStoreModules | -| `useMerkleStoreModuleQuery` | Query | Get one merkleStoreModule | -| `useCreateMerkleStoreModuleMutation` | Mutation | Create a merkleStoreModule | -| `useUpdateMerkleStoreModuleMutation` | Mutation | Update a merkleStoreModule | -| `useDeleteMerkleStoreModuleMutation` | Mutation | Delete a merkleStoreModule | -| `useGraphModulesQuery` | Query | List all graphModules | -| `useGraphModuleQuery` | Query | Get one graphModule | -| `useCreateGraphModuleMutation` | Mutation | Create a graphModule | -| `useUpdateGraphModuleMutation` | Mutation | Update a graphModule | -| `useDeleteGraphModuleMutation` | Mutation | Delete a graphModule | | `useDatabaseProvisionModulesQuery` | Query | Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. | | `useDatabaseProvisionModuleQuery` | Query | Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. | | `useCreateDatabaseProvisionModuleMutation` | Mutation | Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. | @@ -247,6 +237,16 @@ function App() { | `useDeleteConfigSecretsModuleMutation` | Mutation | Entity-aware PGP-encrypted key-value config/secrets module. Supports app-level (admin-only) and org-scoped (per-org secrets with manage_secrets permission) via the scope column. User-scoped bcrypt credentials are handled by user_credentials_module. | +| `useGraphModulesQuery` | Query | List all graphModules | +| `useGraphModuleQuery` | Query | Get one graphModule | +| `useCreateGraphModuleMutation` | Mutation | Create a graphModule | +| `useUpdateGraphModuleMutation` | Mutation | Update a graphModule | +| `useDeleteGraphModuleMutation` | Mutation | Delete a graphModule | +| `useMerkleStoreModulesQuery` | Query | List all merkleStoreModules | +| `useMerkleStoreModuleQuery` | Query | Get one merkleStoreModule | +| `useCreateMerkleStoreModuleMutation` | Mutation | Create a merkleStoreModule | +| `useUpdateMerkleStoreModuleMutation` | Mutation | Update a merkleStoreModule | +| `useDeleteMerkleStoreModuleMutation` | Mutation | Delete a merkleStoreModule | | `useRateLimitMetersModulesQuery` | Query | List all rateLimitMetersModules | | `useRateLimitMetersModuleQuery` | Query | Get one rateLimitMetersModule | | `useCreateRateLimitMetersModuleMutation` | Mutation | Create a rateLimitMetersModule | @@ -277,6 +277,11 @@ function App() { | `useCreateInvitesModuleMutation` | Mutation | Create a invitesModule | | `useUpdateInvitesModuleMutation` | Mutation | Update a invitesModule | | `useDeleteInvitesModuleMutation` | Mutation | Delete a invitesModule | +| `usePrincipalAuthModulesQuery` | Query | Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. | +| `usePrincipalAuthModuleQuery` | Query | Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. | +| `useCreatePrincipalAuthModuleMutation` | Mutation | Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. | +| `useUpdatePrincipalAuthModuleMutation` | Mutation | Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. | +| `useDeletePrincipalAuthModuleMutation` | Mutation | Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. | | `useComputeLogModulesQuery` | Query | List all computeLogModules | | `useComputeLogModuleQuery` | Query | Get one computeLogModule | | `useCreateComputeLogModuleMutation` | Mutation | Create a computeLogModule | @@ -1026,88 +1031,88 @@ const { mutate: create } = useCreateSecureTableProvisionMutation({ create({ databaseId: '', schemaId: '', tableId: '', tableName: '', nodes: '', useRls: '', fields: '', grants: '', policies: '', outFields: '' }); ``` -### MerkleStoreModule +### DatabaseProvisionModule ```typescript -// List all merkleStoreModules -const { data, isLoading } = useMerkleStoreModulesQuery({ - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }, +// List all databaseProvisionModules +const { data, isLoading } = useDatabaseProvisionModulesQuery({ + selection: { fields: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }, }); -// Get one merkleStoreModule -const { data: item } = useMerkleStoreModuleQuery({ +// Get one databaseProvisionModule +const { data: item } = useDatabaseProvisionModuleQuery({ id: '', - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }, + selection: { fields: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }, }); -// Create a merkleStoreModule -const { mutate: create } = useCreateMerkleStoreModuleMutation({ +// Create a databaseProvisionModule +const { mutate: create } = useCreateDatabaseProvisionModuleMutation({ selection: { fields: { id: true } }, }); -create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '' }); +create({ databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }); ``` -### GraphModule +### ConfigSecretsModule ```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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, +// List all configSecretsModules +const { data, isLoading } = useConfigSecretsModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }, }); -// Get one graphModule -const { data: item } = useGraphModuleQuery({ +// Get one configSecretsModule +const { data: item } = useConfigSecretsModuleQuery({ 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 } }, + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }, }); -// Create a graphModule -const { mutate: create } = useCreateGraphModuleMutation({ +// Create a configSecretsModule +const { mutate: create } = useCreateConfigSecretsModuleMutation({ selection: { fields: { id: true } }, }); -create({ databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); +create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }); ``` -### DatabaseProvisionModule +### GraphModule ```typescript -// List all databaseProvisionModules -const { data, isLoading } = useDatabaseProvisionModulesQuery({ - selection: { fields: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }, +// 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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }, }); -// Get one databaseProvisionModule -const { data: item } = useDatabaseProvisionModuleQuery({ +// Get one graphModule +const { data: item } = useGraphModuleQuery({ id: '', - selection: { fields: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: 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 databaseProvisionModule -const { mutate: create } = useCreateDatabaseProvisionModuleMutation({ +// Create a graphModule +const { mutate: create } = useCreateGraphModuleMutation({ selection: { fields: { id: true } }, }); -create({ databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }); +create({ databaseId: '', publicSchemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', scope: '', prefix: '', merkleStoreModuleId: '', graphsTableId: '', apiName: '', privateApiName: '', entityTableId: '', policies: '', provisions: '', defaultPermissions: '' }); ``` -### ConfigSecretsModule +### MerkleStoreModule ```typescript -// List all configSecretsModules -const { data, isLoading } = useConfigSecretsModulesQuery({ - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }, +// List all merkleStoreModules +const { data, isLoading } = useMerkleStoreModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }, }); -// Get one configSecretsModule -const { data: item } = useConfigSecretsModuleQuery({ +// Get one merkleStoreModule +const { data: item } = useMerkleStoreModuleQuery({ id: '', - selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }, + selection: { fields: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }, }); -// Create a configSecretsModule -const { mutate: create } = useCreateConfigSecretsModuleMutation({ +// Create a merkleStoreModule +const { mutate: create } = useCreateMerkleStoreModuleMutation({ selection: { fields: { id: true } }, }); -create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }); +create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '', permissionKey: '' }); ``` ### RateLimitMetersModule @@ -1236,6 +1241,27 @@ const { mutate: create } = useCreateInvitesModuleMutation({ create({ databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', emailsTableId: '', usersTableId: '', invitesTableId: '', claimedInvitesTableId: '', invitesTableName: '', claimedInvitesTableName: '', submitInviteCodeFunction: '', scope: '', prefix: '', entityTableId: '', apiName: '', privateApiName: '' }); ``` +### PrincipalAuthModule + +```typescript +// List all principalAuthModules +const { data, isLoading } = usePrincipalAuthModulesQuery({ + selection: { fields: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }, +}); + +// Get one principalAuthModule +const { data: item } = usePrincipalAuthModuleQuery({ + id: '', + selection: { fields: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }, +}); + +// Create a principalAuthModule +const { mutate: create } = useCreatePrincipalAuthModuleMutation({ + selection: { fields: { id: true } }, +}); +create({ databaseId: '', schemaId: '', principalsTableId: '', principalEntitiesTableId: '', principalScopeOverridesTableId: '', usersTableId: '', sessionsTableId: '', sessionCredentialsTableId: '', auditsTableId: '', principalsTableName: '', createPrincipalFunction: '', deletePrincipalFunction: '', createOrgPrincipalFunction: '', deleteOrgPrincipalFunction: '', createOrgApiKeyFunction: '', revokeOrgApiKeyFunction: '', apiName: '' }); +``` + ### ComputeLogModule ```typescript diff --git a/sdk/constructive-react/src/modules/hooks/index.ts b/sdk/constructive-react/src/modules/hooks/index.ts index 3de92c18ee..09668c1fe7 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, ComputeLogModule, InferenceLogModule, NamespaceModule, StorageLogModule, TransferLogModule, FunctionDeploymentModule, PlansModule, BillingProviderModule, DbUsageModule, GraphExecutionModule, 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, DatabaseProvisionModule, ConfigSecretsModule, GraphModule, MerkleStoreModule, RateLimitMetersModule, RealtimeModule, WebauthnAuthModule, FunctionInvocationModule, FunctionModule, InvitesModule, PrincipalAuthModule, 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 b971252a18..764805d372 100644 --- a/sdk/constructive-react/src/modules/hooks/invalidation.ts +++ b/sdk/constructive-react/src/modules/hooks/invalidation.ts @@ -41,16 +41,17 @@ import { cryptoAuthModuleKeys, sessionsModuleKeys, secureTableProvisionKeys, - merkleStoreModuleKeys, - graphModuleKeys, databaseProvisionModuleKeys, configSecretsModuleKeys, + graphModuleKeys, + merkleStoreModuleKeys, rateLimitMetersModuleKeys, realtimeModuleKeys, webauthnAuthModuleKeys, functionInvocationModuleKeys, functionModuleKeys, invitesModuleKeys, + principalAuthModuleKeys, computeLogModuleKeys, inferenceLogModuleKeys, namespaceModuleKeys, @@ -537,72 +538,72 @@ export const invalidate = { queryKey: secureTableProvisionKeys.detail(id), }), }, - /** Invalidate merkleStoreModule queries */ merkleStoreModule: { - /** Invalidate all merkleStoreModule queries */ all: (queryClient: QueryClient) => + /** Invalidate databaseProvisionModule queries */ databaseProvisionModule: { + /** Invalidate all databaseProvisionModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.all, + queryKey: databaseProvisionModuleKeys.all, }), - /** Invalidate merkleStoreModule list queries */ lists: (queryClient: QueryClient) => + /** Invalidate databaseProvisionModule list queries */ lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.lists(), + queryKey: databaseProvisionModuleKeys.lists(), }), - /** Invalidate a specific merkleStoreModule */ detail: ( + /** Invalidate a specific databaseProvisionModule */ detail: ( queryClient: QueryClient, id: string | number ) => queryClient.invalidateQueries({ - queryKey: merkleStoreModuleKeys.detail(id), + queryKey: databaseProvisionModuleKeys.detail(id), }), }, - /** Invalidate graphModule queries */ graphModule: { - /** Invalidate all graphModule queries */ all: (queryClient: QueryClient) => + /** Invalidate configSecretsModule queries */ configSecretsModule: { + /** Invalidate all configSecretsModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: graphModuleKeys.all, + queryKey: configSecretsModuleKeys.all, }), - /** Invalidate graphModule list queries */ lists: (queryClient: QueryClient) => + /** Invalidate configSecretsModule list queries */ lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: graphModuleKeys.lists(), + queryKey: configSecretsModuleKeys.lists(), }), - /** Invalidate a specific graphModule */ detail: ( + /** Invalidate a specific configSecretsModule */ detail: ( queryClient: QueryClient, id: string | number ) => queryClient.invalidateQueries({ - queryKey: graphModuleKeys.detail(id), + queryKey: configSecretsModuleKeys.detail(id), }), }, - /** Invalidate databaseProvisionModule queries */ databaseProvisionModule: { - /** Invalidate all databaseProvisionModule queries */ all: (queryClient: QueryClient) => + /** Invalidate graphModule queries */ graphModule: { + /** Invalidate all graphModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.all, + queryKey: graphModuleKeys.all, }), - /** Invalidate databaseProvisionModule list queries */ lists: (queryClient: QueryClient) => + /** Invalidate graphModule list queries */ lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.lists(), + queryKey: graphModuleKeys.lists(), }), - /** Invalidate a specific databaseProvisionModule */ detail: ( + /** Invalidate a specific graphModule */ detail: ( queryClient: QueryClient, id: string | number ) => queryClient.invalidateQueries({ - queryKey: databaseProvisionModuleKeys.detail(id), + queryKey: graphModuleKeys.detail(id), }), }, - /** Invalidate configSecretsModule queries */ configSecretsModule: { - /** Invalidate all configSecretsModule queries */ all: (queryClient: QueryClient) => + /** Invalidate merkleStoreModule queries */ merkleStoreModule: { + /** Invalidate all merkleStoreModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: configSecretsModuleKeys.all, + queryKey: merkleStoreModuleKeys.all, }), - /** Invalidate configSecretsModule list queries */ lists: (queryClient: QueryClient) => + /** Invalidate merkleStoreModule list queries */ lists: (queryClient: QueryClient) => queryClient.invalidateQueries({ - queryKey: configSecretsModuleKeys.lists(), + queryKey: merkleStoreModuleKeys.lists(), }), - /** Invalidate a specific configSecretsModule */ detail: ( + /** Invalidate a specific merkleStoreModule */ detail: ( queryClient: QueryClient, id: string | number ) => queryClient.invalidateQueries({ - queryKey: configSecretsModuleKeys.detail(id), + queryKey: merkleStoreModuleKeys.detail(id), }), }, /** Invalidate rateLimitMetersModule queries */ rateLimitMetersModule: { @@ -707,6 +708,23 @@ export const invalidate = { queryKey: invitesModuleKeys.detail(id), }), }, + /** Invalidate principalAuthModule queries */ principalAuthModule: { + /** Invalidate all principalAuthModule queries */ all: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalAuthModuleKeys.all, + }), + /** Invalidate principalAuthModule list queries */ lists: (queryClient: QueryClient) => + queryClient.invalidateQueries({ + queryKey: principalAuthModuleKeys.lists(), + }), + /** Invalidate a specific principalAuthModule */ detail: ( + queryClient: QueryClient, + id: string | number + ) => + queryClient.invalidateQueries({ + queryKey: principalAuthModuleKeys.detail(id), + }), + }, /** Invalidate computeLogModule queries */ computeLogModule: { /** Invalidate all computeLogModule queries */ all: (queryClient: QueryClient) => queryClient.invalidateQueries({ @@ -1313,36 +1331,36 @@ export const remove = { queryKey: secureTableProvisionKeys.detail(id), }); }, - /** Remove merkleStoreModule from cache */ merkleStoreModule: ( + /** Remove databaseProvisionModule from cache */ databaseProvisionModule: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: merkleStoreModuleKeys.detail(id), + queryKey: databaseProvisionModuleKeys.detail(id), }); }, - /** Remove graphModule from cache */ graphModule: ( + /** Remove configSecretsModule from cache */ configSecretsModule: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: graphModuleKeys.detail(id), + queryKey: configSecretsModuleKeys.detail(id), }); }, - /** Remove databaseProvisionModule from cache */ databaseProvisionModule: ( + /** Remove graphModule from cache */ graphModule: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: databaseProvisionModuleKeys.detail(id), + queryKey: graphModuleKeys.detail(id), }); }, - /** Remove configSecretsModule from cache */ configSecretsModule: ( + /** Remove merkleStoreModule from cache */ merkleStoreModule: ( queryClient: QueryClient, id: string | number ) => { queryClient.removeQueries({ - queryKey: configSecretsModuleKeys.detail(id), + queryKey: merkleStoreModuleKeys.detail(id), }); }, /** Remove rateLimitMetersModule from cache */ rateLimitMetersModule: ( @@ -1393,6 +1411,14 @@ export const remove = { queryKey: invitesModuleKeys.detail(id), }); }, + /** Remove principalAuthModule from cache */ principalAuthModule: ( + queryClient: QueryClient, + id: string | number + ) => { + queryClient.removeQueries({ + queryKey: principalAuthModuleKeys.detail(id), + }); + }, /** Remove computeLogModule from cache */ computeLogModule: ( 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 35bd3233b4..e46a070513 100644 --- a/sdk/constructive-react/src/modules/hooks/mutation-keys.ts +++ b/sdk/constructive-react/src/modules/hooks/mutation-keys.ts @@ -279,24 +279,6 @@ export const secureTableProvisionMutationKeys = { /** Delete secureTableProvision mutation key */ delete: (id: string | number) => ['mutation', 'securetableprovision', 'delete', id] as const, } as const; -export const merkleStoreModuleMutationKeys = { - /** All merkleStoreModule mutation keys */ all: ['mutation', 'merklestoremodule'] as const, - /** Create merkleStoreModule mutation key */ create: () => - ['mutation', 'merklestoremodule', 'create'] as const, - /** Update merkleStoreModule mutation key */ update: (id: string | number) => - ['mutation', 'merklestoremodule', 'update', id] as const, - /** Delete merkleStoreModule mutation key */ delete: (id: string | number) => - ['mutation', 'merklestoremodule', 'delete', id] as const, -} as const; -export const graphModuleMutationKeys = { - /** All graphModule mutation keys */ all: ['mutation', 'graphmodule'] as const, - /** Create graphModule mutation key */ create: () => - ['mutation', 'graphmodule', 'create'] as const, - /** Update graphModule mutation key */ update: (id: string | number) => - ['mutation', 'graphmodule', 'update', id] as const, - /** Delete graphModule mutation key */ delete: (id: string | number) => - ['mutation', 'graphmodule', 'delete', id] as const, -} as const; export const databaseProvisionModuleMutationKeys = { /** All databaseProvisionModule mutation keys */ all: [ 'mutation', @@ -318,6 +300,24 @@ export const configSecretsModuleMutationKeys = { /** Delete configSecretsModule mutation key */ delete: (id: string | number) => ['mutation', 'configsecretsmodule', 'delete', id] as const, } as const; +export const graphModuleMutationKeys = { + /** All graphModule mutation keys */ all: ['mutation', 'graphmodule'] as const, + /** Create graphModule mutation key */ create: () => + ['mutation', 'graphmodule', 'create'] as const, + /** Update graphModule mutation key */ update: (id: string | number) => + ['mutation', 'graphmodule', 'update', id] as const, + /** Delete graphModule mutation key */ delete: (id: string | number) => + ['mutation', 'graphmodule', 'delete', id] as const, +} as const; +export const merkleStoreModuleMutationKeys = { + /** All merkleStoreModule mutation keys */ all: ['mutation', 'merklestoremodule'] as const, + /** Create merkleStoreModule mutation key */ create: () => + ['mutation', 'merklestoremodule', 'create'] as const, + /** Update merkleStoreModule mutation key */ update: (id: string | number) => + ['mutation', 'merklestoremodule', 'update', id] as const, + /** Delete merkleStoreModule mutation key */ delete: (id: string | number) => + ['mutation', 'merklestoremodule', 'delete', id] as const, +} as const; export const rateLimitMetersModuleMutationKeys = { /** All rateLimitMetersModule mutation keys */ all: [ 'mutation', @@ -378,6 +378,15 @@ export const invitesModuleMutationKeys = { /** Delete invitesModule mutation key */ delete: (id: string | number) => ['mutation', 'invitesmodule', 'delete', id] as const, } as const; +export const principalAuthModuleMutationKeys = { + /** All principalAuthModule mutation keys */ all: ['mutation', 'principalauthmodule'] as const, + /** Create principalAuthModule mutation key */ create: () => + ['mutation', 'principalauthmodule', 'create'] as const, + /** Update principalAuthModule mutation key */ update: (id: string | number) => + ['mutation', 'principalauthmodule', 'update', id] as const, + /** Delete principalAuthModule mutation key */ delete: (id: string | number) => + ['mutation', 'principalauthmodule', 'delete', id] as const, +} as const; export const computeLogModuleMutationKeys = { /** All computeLogModule mutation keys */ all: ['mutation', 'computelogmodule'] as const, /** Create computeLogModule mutation key */ create: () => @@ -693,16 +702,17 @@ export const mutationKeys = { cryptoAuthModule: cryptoAuthModuleMutationKeys, sessionsModule: sessionsModuleMutationKeys, secureTableProvision: secureTableProvisionMutationKeys, - merkleStoreModule: merkleStoreModuleMutationKeys, - graphModule: graphModuleMutationKeys, databaseProvisionModule: databaseProvisionModuleMutationKeys, configSecretsModule: configSecretsModuleMutationKeys, + graphModule: graphModuleMutationKeys, + merkleStoreModule: merkleStoreModuleMutationKeys, rateLimitMetersModule: rateLimitMetersModuleMutationKeys, realtimeModule: realtimeModuleMutationKeys, webauthnAuthModule: webauthnAuthModuleMutationKeys, functionInvocationModule: functionInvocationModuleMutationKeys, functionModule: functionModuleMutationKeys, invitesModule: invitesModuleMutationKeys, + principalAuthModule: principalAuthModuleMutationKeys, computeLogModule: computeLogModuleMutationKeys, inferenceLogModule: inferenceLogModuleMutationKeys, namespaceModule: namespaceModuleMutationKeys, diff --git a/sdk/constructive-react/src/modules/hooks/mutations/index.ts b/sdk/constructive-react/src/modules/hooks/mutations/index.ts index edeff4af8f..4246370014 100644 --- a/sdk/constructive-react/src/modules/hooks/mutations/index.ts +++ b/sdk/constructive-react/src/modules/hooks/mutations/index.ts @@ -81,18 +81,18 @@ export * from './useDeleteSessionsModuleMutation'; export * from './useCreateSecureTableProvisionMutation'; export * from './useUpdateSecureTableProvisionMutation'; export * from './useDeleteSecureTableProvisionMutation'; -export * from './useCreateMerkleStoreModuleMutation'; -export * from './useUpdateMerkleStoreModuleMutation'; -export * from './useDeleteMerkleStoreModuleMutation'; -export * from './useCreateGraphModuleMutation'; -export * from './useUpdateGraphModuleMutation'; -export * from './useDeleteGraphModuleMutation'; export * from './useCreateDatabaseProvisionModuleMutation'; export * from './useUpdateDatabaseProvisionModuleMutation'; export * from './useDeleteDatabaseProvisionModuleMutation'; export * from './useCreateConfigSecretsModuleMutation'; export * from './useUpdateConfigSecretsModuleMutation'; export * from './useDeleteConfigSecretsModuleMutation'; +export * from './useCreateGraphModuleMutation'; +export * from './useUpdateGraphModuleMutation'; +export * from './useDeleteGraphModuleMutation'; +export * from './useCreateMerkleStoreModuleMutation'; +export * from './useUpdateMerkleStoreModuleMutation'; +export * from './useDeleteMerkleStoreModuleMutation'; export * from './useCreateRateLimitMetersModuleMutation'; export * from './useUpdateRateLimitMetersModuleMutation'; export * from './useDeleteRateLimitMetersModuleMutation'; @@ -111,6 +111,9 @@ export * from './useDeleteFunctionModuleMutation'; export * from './useCreateInvitesModuleMutation'; export * from './useUpdateInvitesModuleMutation'; export * from './useDeleteInvitesModuleMutation'; +export * from './useCreatePrincipalAuthModuleMutation'; +export * from './useUpdatePrincipalAuthModuleMutation'; +export * from './useDeletePrincipalAuthModuleMutation'; export * from './useCreateComputeLogModuleMutation'; export * from './useUpdateComputeLogModuleMutation'; export * from './useDeleteComputeLogModuleMutation'; diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts new file mode 100644 index 0000000000..1734cac615 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.ts @@ -0,0 +1,91 @@ +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * @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 { principalAuthModuleKeys } from '../query-keys'; +import { principalAuthModuleMutationKeys } from '../mutation-keys'; +import type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, + CreatePrincipalAuthModuleInput, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, + CreatePrincipalAuthModuleInput, +} from '../../orm/input-types'; +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```tsx + * const { mutate, isPending } = useCreatePrincipalAuthModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ name: 'New item' }); + * ``` + */ +export function useCreatePrincipalAuthModuleMutation( + params: { + selection: { + fields: S & PrincipalAuthModuleSelect; + } & HookStrictSelect, PrincipalAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + createPrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }, + Error, + CreatePrincipalAuthModuleInput['principalAuthModule'] + >, + 'mutationFn' + > +): UseMutationResult< + { + createPrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }, + Error, + CreatePrincipalAuthModuleInput['principalAuthModule'] +>; +export function useCreatePrincipalAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: principalAuthModuleMutationKeys.create(), + mutationFn: (data: CreatePrincipalAuthModuleInput['principalAuthModule']) => + getClient() + .principalAuthModule.create({ + data, + select: args.select, + }) + .unwrap(), + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: principalAuthModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts new file mode 100644 index 0000000000..b0d095c2a0 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.ts @@ -0,0 +1,104 @@ +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * @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 { principalAuthModuleKeys } from '../query-keys'; +import { principalAuthModuleMutationKeys } from '../mutation-keys'; +import type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, +} from '../../orm/input-types'; +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```tsx + * const { mutate, isPending } = useDeletePrincipalAuthModuleMutation({ + * selection: { fields: { id: true } }, + * }); + * + * mutate({ id: 'value-to-delete' }); + * ``` + */ +export function useDeletePrincipalAuthModuleMutation( + params: { + selection: { + fields: S & PrincipalAuthModuleSelect; + } & HookStrictSelect, PrincipalAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + deletePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + deletePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + } +>; +export function useDeletePrincipalAuthModuleMutation( + 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: principalAuthModuleMutationKeys.all, + mutationFn: ({ id }: { id: string }) => + getClient() + .principalAuthModule.delete({ + where: { + id, + }, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.removeQueries({ + queryKey: principalAuthModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: principalAuthModuleKeys.lists(), + }); + }, + ...mutationOptions, + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts new file mode 100644 index 0000000000..025bbf0a2d --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.ts @@ -0,0 +1,116 @@ +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * @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 { principalAuthModuleKeys } from '../query-keys'; +import { principalAuthModuleMutationKeys } from '../mutation-keys'; +import type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, + PrincipalAuthModulePatch, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, + PrincipalAuthModulePatch, +} from '../../orm/input-types'; +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```tsx + * const { mutate, isPending } = useUpdatePrincipalAuthModuleMutation({ + * selection: { fields: { id: true, name: true } }, + * }); + * + * mutate({ id: 'value-here', principalAuthModulePatch: { name: 'Updated' } }); + * ``` + */ +export function useUpdatePrincipalAuthModuleMutation( + params: { + selection: { + fields: S & PrincipalAuthModuleSelect; + } & HookStrictSelect, PrincipalAuthModuleSelect>; + } & Omit< + UseMutationOptions< + { + updatePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + principalAuthModulePatch: PrincipalAuthModulePatch; + } + >, + 'mutationFn' + > +): UseMutationResult< + { + updatePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }, + Error, + { + id: string; + principalAuthModulePatch: PrincipalAuthModulePatch; + } +>; +export function useUpdatePrincipalAuthModuleMutation( + params: { + selection: SelectionConfig; + } & Omit< + UseMutationOptions< + any, + Error, + { + id: string; + principalAuthModulePatch: PrincipalAuthModulePatch; + } + >, + 'mutationFn' + > +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...mutationOptions } = params ?? {}; + void _selection; + const queryClient = useQueryClient(); + return useMutation({ + mutationKey: principalAuthModuleMutationKeys.all, + mutationFn: ({ + id, + principalAuthModulePatch, + }: { + id: string; + principalAuthModulePatch: PrincipalAuthModulePatch; + }) => + getClient() + .principalAuthModule.update({ + where: { + id, + }, + data: principalAuthModulePatch, + select: args.select, + }) + .unwrap(), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ + queryKey: principalAuthModuleKeys.detail(variables.id), + }); + queryClient.invalidateQueries({ + queryKey: principalAuthModuleKeys.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 b3cd4d97da..8fd3a68e3c 100644 --- a/sdk/constructive-react/src/modules/hooks/queries/index.ts +++ b/sdk/constructive-react/src/modules/hooks/queries/index.ts @@ -55,14 +55,14 @@ export * from './useSessionsModulesQuery'; export * from './useSessionsModuleQuery'; export * from './useSecureTableProvisionsQuery'; export * from './useSecureTableProvisionQuery'; -export * from './useMerkleStoreModulesQuery'; -export * from './useMerkleStoreModuleQuery'; -export * from './useGraphModulesQuery'; -export * from './useGraphModuleQuery'; export * from './useDatabaseProvisionModulesQuery'; export * from './useDatabaseProvisionModuleQuery'; export * from './useConfigSecretsModulesQuery'; export * from './useConfigSecretsModuleQuery'; +export * from './useGraphModulesQuery'; +export * from './useGraphModuleQuery'; +export * from './useMerkleStoreModulesQuery'; +export * from './useMerkleStoreModuleQuery'; export * from './useRateLimitMetersModulesQuery'; export * from './useRateLimitMetersModuleQuery'; export * from './useRealtimeModulesQuery'; @@ -75,6 +75,8 @@ export * from './useFunctionModulesQuery'; export * from './useFunctionModuleQuery'; export * from './useInvitesModulesQuery'; export * from './useInvitesModuleQuery'; +export * from './usePrincipalAuthModulesQuery'; +export * from './usePrincipalAuthModuleQuery'; export * from './useComputeLogModulesQuery'; export * from './useComputeLogModuleQuery'; export * from './useInferenceLogModulesQuery'; diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts new file mode 100644 index 0000000000..d91f4a3ad2 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModuleQuery.ts @@ -0,0 +1,144 @@ +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * @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 { principalAuthModuleKeys } from '../query-keys'; +import type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, +} from '../../orm/input-types'; +import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types'; +export type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalAuthModuleQueryKey = principalAuthModuleKeys.detail; +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalAuthModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true, name: true } }, + * }); + * ``` + */ +export function usePrincipalAuthModuleQuery< + S extends PrincipalAuthModuleSelect, + TData = { + principalAuthModule: InferSelectResult | null; + }, +>( + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + principalAuthModule: InferSelectResult | null; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalAuthModuleQuery( + params: { + id: string; + selection: SelectionConfig; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildSelectionArgs(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalAuthModuleKeys.detail(params.id), + queryFn: () => + getClient() + .principalAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + ...queryOptions, + }); +} +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```ts + * const data = await fetchPrincipalAuthModuleQuery({ + * id: 'some-id', + * selection: { fields: { id: true } }, + * }); + * ``` + */ +export async function fetchPrincipalAuthModuleQuery(params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalAuthModuleSelect>; +}): Promise<{ + principalAuthModule: InferSelectResult | null; +}>; +export async function fetchPrincipalAuthModuleQuery(params: { + id: string; + selection: SelectionConfig; +}): Promise { + const args = buildSelectionArgs(params.selection); + return getClient() + .principalAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(); +} +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```ts + * await prefetchPrincipalAuthModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } }); + * ``` + */ +export async function prefetchPrincipalAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: { + fields: S; + } & HookStrictSelect, PrincipalAuthModuleSelect>; + } +): Promise; +export async function prefetchPrincipalAuthModuleQuery( + queryClient: QueryClient, + params: { + id: string; + selection: SelectionConfig; + } +): Promise { + const args = buildSelectionArgs(params.selection); + await queryClient.prefetchQuery({ + queryKey: principalAuthModuleKeys.detail(params.id), + queryFn: () => + getClient() + .principalAuthModule.findOne({ + id: params.id, + select: args.select, + }) + .unwrap(), + }); +} diff --git a/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModulesQuery.ts b/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModulesQuery.ts new file mode 100644 index 0000000000..bacae75203 --- /dev/null +++ b/sdk/constructive-react/src/modules/hooks/queries/usePrincipalAuthModulesQuery.ts @@ -0,0 +1,174 @@ +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * @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 { principalAuthModuleKeys } from '../query-keys'; +import type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy, +} from '../../orm/input-types'; +import type { + FindManyArgs, + InferSelectResult, + ConnectionResult, + HookStrictSelect, +} from '../../orm/select-types'; +export type { + PrincipalAuthModuleSelect, + PrincipalAuthModuleWithRelations, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy, +} from '../../orm/input-types'; +/** Query key factory - re-exported from query-keys.ts */ +export const principalAuthModulesQueryKey = principalAuthModuleKeys.list; +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```tsx + * const { data, isLoading } = usePrincipalAuthModulesQuery({ + * selection: { + * fields: { id: true, name: true }, + * where: { name: { equalTo: "example" } }, + * orderBy: ['CREATED_AT_DESC'], + * first: 10, + * }, + * }); + * ``` + */ +export function usePrincipalAuthModulesQuery< + S extends PrincipalAuthModuleSelect, + TData = { + principalAuthModules: ConnectionResult>; + }, +>( + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalAuthModuleSelect>; + } & Omit< + UseQueryOptions< + { + principalAuthModules: ConnectionResult< + InferSelectResult + >; + }, + Error, + TData + >, + 'queryKey' | 'queryFn' + > +): UseQueryResult; +export function usePrincipalAuthModulesQuery( + params: { + selection: ListSelectionConfig< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + >; + } & Omit, 'queryKey' | 'queryFn'> +) { + const args = buildListSelectionArgs< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + >(params.selection); + const { selection: _selection, ...queryOptions } = params ?? {}; + void _selection; + return useQuery({ + queryKey: principalAuthModuleKeys.list(args), + queryFn: () => getClient().principalAuthModule.findMany(args).unwrap(), + ...queryOptions, + }); +} +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```ts + * const data = await fetchPrincipalAuthModulesQuery({ + * selection: { + * fields: { id: true }, + * first: 10, + * }, + * }); + * ``` + */ +export async function fetchPrincipalAuthModulesQuery(params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalAuthModuleSelect>; +}): Promise<{ + principalAuthModules: ConnectionResult>; +}>; +export async function fetchPrincipalAuthModulesQuery(params: { + selection: ListSelectionConfig< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + >; +}) { + const args = buildListSelectionArgs< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + >(params.selection); + return getClient().principalAuthModule.findMany(args).unwrap(); +} +/** + * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. + * + * @example + * ```ts + * await prefetchPrincipalAuthModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); + * ``` + */ +export async function prefetchPrincipalAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: { + fields: S; + } & Omit< + ListSelectionConfig, + 'fields' + > & + HookStrictSelect, PrincipalAuthModuleSelect>; + } +): Promise; +export async function prefetchPrincipalAuthModulesQuery( + queryClient: QueryClient, + params: { + selection: ListSelectionConfig< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + >; + } +): Promise { + const args = buildListSelectionArgs< + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy + >(params.selection); + await queryClient.prefetchQuery({ + queryKey: principalAuthModuleKeys.list(args), + queryFn: () => getClient().principalAuthModule.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 a0a26278e1..6cf9f4f4ba 100644 --- a/sdk/constructive-react/src/modules/hooks/query-keys.ts +++ b/sdk/constructive-react/src/modules/hooks/query-keys.ts @@ -253,24 +253,6 @@ export const secureTableProvisionKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...secureTableProvisionKeys.details(), id] as const, } as const; -export const merkleStoreModuleKeys = { - /** All merkleStoreModule queries */ all: ['merklestoremodule'] as const, - /** List query keys */ lists: () => [...merkleStoreModuleKeys.all, 'list'] as const, - /** List query key with variables */ list: (variables?: object) => - [...merkleStoreModuleKeys.lists(), variables] as const, - /** Detail query keys */ details: () => [...merkleStoreModuleKeys.all, 'detail'] as const, - /** Detail query key for specific item */ detail: (id: string | number) => - [...merkleStoreModuleKeys.details(), id] as const, -} as const; -export const graphModuleKeys = { - /** All graphModule queries */ all: ['graphmodule'] as const, - /** List query keys */ lists: () => [...graphModuleKeys.all, 'list'] as const, - /** List query key with variables */ list: (variables?: object) => - [...graphModuleKeys.lists(), variables] as const, - /** Detail query keys */ details: () => [...graphModuleKeys.all, 'detail'] as const, - /** Detail query key for specific item */ detail: (id: string | number) => - [...graphModuleKeys.details(), id] as const, -} as const; export const databaseProvisionModuleKeys = { /** All databaseProvisionModule queries */ all: ['databaseprovisionmodule'] as const, /** List query keys */ lists: () => [...databaseProvisionModuleKeys.all, 'list'] as const, @@ -289,6 +271,24 @@ export const configSecretsModuleKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...configSecretsModuleKeys.details(), id] as const, } as const; +export const graphModuleKeys = { + /** All graphModule queries */ all: ['graphmodule'] as const, + /** List query keys */ lists: () => [...graphModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...graphModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...graphModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...graphModuleKeys.details(), id] as const, +} as const; +export const merkleStoreModuleKeys = { + /** All merkleStoreModule queries */ all: ['merklestoremodule'] as const, + /** List query keys */ lists: () => [...merkleStoreModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...merkleStoreModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...merkleStoreModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...merkleStoreModuleKeys.details(), id] as const, +} as const; export const rateLimitMetersModuleKeys = { /** All rateLimitMetersModule queries */ all: ['ratelimitmetersmodule'] as const, /** List query keys */ lists: () => [...rateLimitMetersModuleKeys.all, 'list'] as const, @@ -343,6 +343,15 @@ export const invitesModuleKeys = { /** Detail query key for specific item */ detail: (id: string | number) => [...invitesModuleKeys.details(), id] as const, } as const; +export const principalAuthModuleKeys = { + /** All principalAuthModule queries */ all: ['principalauthmodule'] as const, + /** List query keys */ lists: () => [...principalAuthModuleKeys.all, 'list'] as const, + /** List query key with variables */ list: (variables?: object) => + [...principalAuthModuleKeys.lists(), variables] as const, + /** Detail query keys */ details: () => [...principalAuthModuleKeys.all, 'detail'] as const, + /** Detail query key for specific item */ detail: (id: string | number) => + [...principalAuthModuleKeys.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, @@ -610,16 +619,17 @@ export const queryKeys = { cryptoAuthModule: cryptoAuthModuleKeys, sessionsModule: sessionsModuleKeys, secureTableProvision: secureTableProvisionKeys, - merkleStoreModule: merkleStoreModuleKeys, - graphModule: graphModuleKeys, databaseProvisionModule: databaseProvisionModuleKeys, configSecretsModule: configSecretsModuleKeys, + graphModule: graphModuleKeys, + merkleStoreModule: merkleStoreModuleKeys, rateLimitMetersModule: rateLimitMetersModuleKeys, realtimeModule: realtimeModuleKeys, webauthnAuthModule: webauthnAuthModuleKeys, functionInvocationModule: functionInvocationModuleKeys, functionModule: functionModuleKeys, invitesModule: invitesModuleKeys, + principalAuthModule: principalAuthModuleKeys, computeLogModule: computeLogModuleKeys, inferenceLogModule: inferenceLogModuleKeys, namespaceModule: namespaceModuleKeys, diff --git a/sdk/constructive-react/src/modules/orm/README.md b/sdk/constructive-react/src/modules/orm/README.md index 495d56755f..91f09623c3 100644 --- a/sdk/constructive-react/src/modules/orm/README.md +++ b/sdk/constructive-react/src/modules/orm/README.md @@ -47,16 +47,17 @@ const db = createClient({ | `cryptoAuthModule` | findMany, findOne, create, update, delete | | `sessionsModule` | findMany, findOne, create, update, delete | | `secureTableProvision` | findMany, findOne, create, update, delete | -| `merkleStoreModule` | findMany, findOne, create, update, delete | -| `graphModule` | findMany, findOne, create, update, delete | | `databaseProvisionModule` | findMany, findOne, create, update, delete | | `configSecretsModule` | findMany, findOne, create, update, delete | +| `graphModule` | findMany, findOne, create, update, delete | +| `merkleStoreModule` | findMany, findOne, create, update, delete | | `rateLimitMetersModule` | findMany, findOne, create, update, delete | | `realtimeModule` | findMany, findOne, create, update, delete | | `webauthnAuthModule` | findMany, findOne, create, update, delete | | `functionInvocationModule` | findMany, findOne, create, update, delete | | `functionModule` | findMany, findOne, create, update, delete | | `invitesModule` | findMany, findOne, create, update, delete | +| `principalAuthModule` | findMany, findOne, create, update, delete | | `computeLogModule` | findMany, findOne, create, update, delete | | `inferenceLogModule` | findMany, findOne, create, update, delete | | `namespaceModule` | findMany, findOne, create, update, delete | @@ -1053,53 +1054,51 @@ const updated = await db.secureTableProvision.update({ where: { id: '' }, const deleted = await db.secureTableProvision.delete({ where: { id: '' } }).execute(); ``` -### `db.merkleStoreModule` +### `db.databaseProvisionModule` -CRUD operations for MerkleStoreModule records. +CRUD operations for DatabaseProvisionModule records. **Fields:** | Field | Type | Editable | |-------|------|----------| | `id` | UUID | No | +| `databaseName` | String | Yes | +| `ownerId` | UUID | Yes | +| `subdomain` | String | Yes | +| `domain` | String | Yes | +| `modules` | JSON | Yes | +| `options` | JSON | Yes | +| `bootstrapUser` | Boolean | Yes | +| `status` | String | Yes | +| `errorMessage` | String | Yes | | `databaseId` | UUID | Yes | -| `schemaId` | UUID | Yes | -| `privateSchemaId` | UUID | Yes | -| `publicSchemaName` | String | Yes | -| `privateSchemaName` | String | Yes | -| `objectTableId` | UUID | Yes | -| `storeTableId` | UUID | Yes | -| `commitTableId` | UUID | Yes | -| `refTableId` | UUID | Yes | -| `prefix` | String | Yes | -| `apiName` | String | Yes | -| `privateApiName` | String | Yes | -| `scope` | String | Yes | -| `functionPrefix` | String | Yes | | `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `completedAt` | Datetime | Yes | **Operations:** ```typescript -// List all merkleStoreModule records -const items = await db.merkleStoreModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }).execute(); +// List all databaseProvisionModule records +const items = await db.databaseProvisionModule.findMany({ select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); // Get one by id -const item = await db.merkleStoreModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }).execute(); +const item = await db.databaseProvisionModule.findOne({ id: '', select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); // Create -const created = await db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '' }, select: { id: true } }).execute(); +const created = await db.databaseProvisionModule.create({ data: { databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }, select: { id: true } }).execute(); // Update -const updated = await db.merkleStoreModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.databaseProvisionModule.update({ where: { id: '' }, data: { databaseName: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.merkleStoreModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.databaseProvisionModule.delete({ where: { id: '' } }).execute(); ``` -### `db.graphModule` +### `db.configSecretsModule` -CRUD operations for GraphModule records. +CRUD operations for ConfigSecretsModule records. **Fields:** @@ -1107,86 +1106,89 @@ CRUD operations for GraphModule records. |-------|------|----------| | `id` | UUID | No | | `databaseId` | UUID | Yes | -| `publicSchemaId` | UUID | Yes | +| `schemaId` | UUID | Yes | | `privateSchemaId` | UUID | Yes | | `publicSchemaName` | String | Yes | | `privateSchemaName` | String | Yes | -| `scope` | String | Yes | -| `prefix` | String | Yes | -| `merkleStoreModuleId` | UUID | Yes | -| `graphsTableId` | UUID | Yes | +| `tableId` | UUID | Yes | +| `configDefinitionsTableId` | UUID | Yes | +| `tableName` | 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 | -| `createdAt` | Datetime | No | +| `hasConfig` | Boolean | Yes | **Operations:** ```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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +// List all configSecretsModule records +const items = await db.configSecretsModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: 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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const item = await db.configSecretsModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); // Create -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(); +const created = await db.configSecretsModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }, select: { id: true } }).execute(); // Update -const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.configSecretsModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.graphModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.configSecretsModule.delete({ where: { id: '' } }).execute(); ``` -### `db.databaseProvisionModule` +### `db.graphModule` -CRUD operations for DatabaseProvisionModule records. +CRUD operations for GraphModule records. **Fields:** | Field | Type | Editable | |-------|------|----------| | `id` | UUID | No | -| `databaseName` | String | Yes | -| `ownerId` | UUID | Yes | -| `subdomain` | String | Yes | -| `domain` | String | Yes | -| `modules` | JSON | Yes | -| `options` | JSON | Yes | -| `bootstrapUser` | Boolean | Yes | -| `status` | String | Yes | -| `errorMessage` | String | Yes | | `databaseId` | UUID | Yes | +| `publicSchemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `merkleStoreModuleId` | UUID | Yes | +| `graphsTableId` | UUID | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `entityTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | | `createdAt` | Datetime | No | -| `updatedAt` | Datetime | No | -| `completedAt` | Datetime | Yes | **Operations:** ```typescript -// List all databaseProvisionModule records -const items = await db.databaseProvisionModule.findMany({ select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); +// 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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Get one by id -const item = await db.databaseProvisionModule.findOne({ id: '', select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: 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.databaseProvisionModule.create({ data: { databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }, 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.databaseProvisionModule.update({ where: { id: '' }, data: { databaseName: '' }, select: { id: true } }).execute(); +const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.databaseProvisionModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.graphModule.delete({ where: { id: '' } }).execute(); ``` -### `db.configSecretsModule` +### `db.merkleStoreModule` -CRUD operations for ConfigSecretsModule records. +CRUD operations for MerkleStoreModule records. **Fields:** @@ -1198,35 +1200,35 @@ CRUD operations for ConfigSecretsModule records. | `privateSchemaId` | UUID | Yes | | `publicSchemaName` | String | Yes | | `privateSchemaName` | String | Yes | -| `tableId` | UUID | Yes | -| `configDefinitionsTableId` | UUID | Yes | -| `tableName` | String | Yes | +| `objectTableId` | UUID | Yes | +| `storeTableId` | UUID | Yes | +| `commitTableId` | UUID | Yes | +| `refTableId` | UUID | Yes | +| `prefix` | String | Yes | | `apiName` | String | Yes | | `privateApiName` | String | Yes | | `scope` | String | Yes | -| `prefix` | String | Yes | -| `entityTableId` | UUID | Yes | -| `policies` | JSON | Yes | -| `provisions` | JSON | Yes | -| `hasConfig` | Boolean | Yes | +| `functionPrefix` | String | Yes | +| `permissionKey` | String | Yes | +| `createdAt` | Datetime | No | **Operations:** ```typescript -// List all configSecretsModule records -const items = await db.configSecretsModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); +// List all merkleStoreModule records +const items = await db.merkleStoreModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }).execute(); // Get one by id -const item = await db.configSecretsModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); +const item = await db.merkleStoreModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }).execute(); // Create -const created = await db.configSecretsModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }, select: { id: true } }).execute(); +const created = await db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '', permissionKey: '' }, select: { id: true } }).execute(); // Update -const updated = await db.configSecretsModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.merkleStoreModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.configSecretsModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.merkleStoreModule.delete({ where: { id: '' } }).execute(); ``` ### `db.rateLimitMetersModule` @@ -1498,6 +1500,52 @@ const updated = await db.invitesModule.update({ where: { id: '' }, data: { const deleted = await db.invitesModule.delete({ where: { id: '' } }).execute(); ``` +### `db.principalAuthModule` + +CRUD operations for PrincipalAuthModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `principalsTableId` | UUID | Yes | +| `principalEntitiesTableId` | UUID | Yes | +| `principalScopeOverridesTableId` | UUID | Yes | +| `usersTableId` | UUID | Yes | +| `sessionsTableId` | UUID | Yes | +| `sessionCredentialsTableId` | UUID | Yes | +| `auditsTableId` | UUID | Yes | +| `principalsTableName` | String | Yes | +| `createPrincipalFunction` | String | Yes | +| `deletePrincipalFunction` | String | Yes | +| `createOrgPrincipalFunction` | String | Yes | +| `deleteOrgPrincipalFunction` | String | Yes | +| `createOrgApiKeyFunction` | String | Yes | +| `revokeOrgApiKeyFunction` | String | Yes | +| `apiName` | String | Yes | + +**Operations:** + +```typescript +// List all principalAuthModule records +const items = await db.principalAuthModule.findMany({ select: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }).execute(); + +// Get one by id +const item = await db.principalAuthModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }).execute(); + +// Create +const created = await db.principalAuthModule.create({ data: { databaseId: '', schemaId: '', principalsTableId: '', principalEntitiesTableId: '', principalScopeOverridesTableId: '', usersTableId: '', sessionsTableId: '', sessionCredentialsTableId: '', auditsTableId: '', principalsTableName: '', createPrincipalFunction: '', deletePrincipalFunction: '', createOrgPrincipalFunction: '', deleteOrgPrincipalFunction: '', createOrgApiKeyFunction: '', revokeOrgApiKeyFunction: '', apiName: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalAuthModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalAuthModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.computeLogModule` CRUD operations for ComputeLogModule records. diff --git a/sdk/constructive-react/src/modules/orm/index.ts b/sdk/constructive-react/src/modules/orm/index.ts index 7c5a882c52..592de14627 100644 --- a/sdk/constructive-react/src/modules/orm/index.ts +++ b/sdk/constructive-react/src/modules/orm/index.ts @@ -31,16 +31,17 @@ import { BlueprintConstructionModel } from './models/blueprintConstruction'; import { CryptoAuthModuleModel } from './models/cryptoAuthModule'; import { SessionsModuleModel } from './models/sessionsModule'; import { SecureTableProvisionModel } from './models/secureTableProvision'; -import { MerkleStoreModuleModel } from './models/merkleStoreModule'; -import { GraphModuleModel } from './models/graphModule'; import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule'; import { ConfigSecretsModuleModel } from './models/configSecretsModule'; +import { GraphModuleModel } from './models/graphModule'; +import { MerkleStoreModuleModel } from './models/merkleStoreModule'; import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule'; import { RealtimeModuleModel } from './models/realtimeModule'; import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; import { FunctionModuleModel } from './models/functionModule'; import { InvitesModuleModel } from './models/invitesModule'; +import { PrincipalAuthModuleModel } from './models/principalAuthModule'; import { ComputeLogModuleModel } from './models/computeLogModule'; import { InferenceLogModuleModel } from './models/inferenceLogModule'; import { NamespaceModuleModel } from './models/namespaceModule'; @@ -125,16 +126,17 @@ export function createClient(config: OrmClientConfig) { cryptoAuthModule: new CryptoAuthModuleModel(client), sessionsModule: new SessionsModuleModel(client), secureTableProvision: new SecureTableProvisionModel(client), - merkleStoreModule: new MerkleStoreModuleModel(client), - graphModule: new GraphModuleModel(client), databaseProvisionModule: new DatabaseProvisionModuleModel(client), configSecretsModule: new ConfigSecretsModuleModel(client), + graphModule: new GraphModuleModel(client), + merkleStoreModule: new MerkleStoreModuleModel(client), rateLimitMetersModule: new RateLimitMetersModuleModel(client), realtimeModule: new RealtimeModuleModel(client), webauthnAuthModule: new WebauthnAuthModuleModel(client), functionInvocationModule: new FunctionInvocationModuleModel(client), functionModule: new FunctionModuleModel(client), invitesModule: new InvitesModuleModel(client), + principalAuthModule: new PrincipalAuthModuleModel(client), computeLogModule: new ComputeLogModuleModel(client), inferenceLogModule: new InferenceLogModuleModel(client), namespaceModule: new NamespaceModuleModel(client), diff --git a/sdk/constructive-react/src/modules/orm/input-types.ts b/sdk/constructive-react/src/modules/orm/input-types.ts index ddd8bf6a34..4d52180d99 100644 --- a/sdk/constructive-react/src/modules/orm/input-types.ts +++ b/sdk/constructive-react/src/modules/orm/input-types.ts @@ -606,43 +606,6 @@ export interface SecureTableProvision { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[] | null; } -export interface MerkleStoreModule { - id: string; - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - objectTableId?: string | null; - storeTableId?: string | null; - commitTableId?: string | null; - refTableId?: string | null; - prefix?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - functionPrefix?: string | null; - createdAt?: string | null; -} -export interface GraphModule { - id: string; - databaseId?: string | null; - publicSchemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - scope?: string | null; - prefix?: string | null; - merkleStoreModuleId?: string | null; - graphsTableId?: string | null; - apiName?: string | null; - privateApiName?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; - createdAt?: string | null; -} /** Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. */ export interface DatabaseProvisionModule { id: string; @@ -693,6 +656,44 @@ export interface ConfigSecretsModule { provisions?: Record | null; hasConfig?: boolean | null; } +export interface GraphModule { + id: string; + databaseId?: string | null; + publicSchemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + scope?: string | null; + prefix?: string | null; + merkleStoreModuleId?: string | null; + graphsTableId?: 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 MerkleStoreModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + objectTableId?: string | null; + storeTableId?: string | null; + commitTableId?: string | null; + refTableId?: string | null; + prefix?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + functionPrefix?: string | null; + permissionKey?: string | null; + createdAt?: string | null; +} export interface RateLimitMetersModule { id: string; databaseId?: string | null; @@ -806,6 +807,27 @@ export interface InvitesModule { apiName?: string | null; privateApiName?: string | null; } +/** Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. */ +export interface PrincipalAuthModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + principalsTableId?: string | null; + principalEntitiesTableId?: string | null; + principalScopeOverridesTableId?: string | null; + usersTableId?: string | null; + sessionsTableId?: string | null; + sessionCredentialsTableId?: string | null; + auditsTableId?: string | null; + principalsTableName?: string | null; + createPrincipalFunction?: string | null; + deletePrincipalFunction?: string | null; + createOrgPrincipalFunction?: string | null; + deleteOrgPrincipalFunction?: string | null; + createOrgApiKeyFunction?: string | null; + revokeOrgApiKeyFunction?: string | null; + apiName?: string | null; +} export interface ComputeLogModule { id: string; databaseId?: string | null; @@ -1831,20 +1853,21 @@ export interface BlueprintConstructionRelations { export interface CryptoAuthModuleRelations {} export interface SessionsModuleRelations {} export interface SecureTableProvisionRelations {} -export interface MerkleStoreModuleRelations { - graphModules?: ConnectionResult; -} +export interface DatabaseProvisionModuleRelations {} +export interface ConfigSecretsModuleRelations {} export interface GraphModuleRelations { merkleStoreModule?: MerkleStoreModule | null; } -export interface DatabaseProvisionModuleRelations {} -export interface ConfigSecretsModuleRelations {} +export interface MerkleStoreModuleRelations { + graphModules?: ConnectionResult; +} export interface RateLimitMetersModuleRelations {} export interface RealtimeModuleRelations {} export interface WebauthnAuthModuleRelations {} export interface FunctionInvocationModuleRelations {} export interface FunctionModuleRelations {} export interface InvitesModuleRelations {} +export interface PrincipalAuthModuleRelations {} export interface ComputeLogModuleRelations {} export interface InferenceLogModuleRelations {} export interface NamespaceModuleRelations {} @@ -1912,11 +1935,11 @@ export type CryptoAuthModuleWithRelations = CryptoAuthModule & CryptoAuthModuleR export type SessionsModuleWithRelations = SessionsModule & SessionsModuleRelations; export type SecureTableProvisionWithRelations = SecureTableProvision & SecureTableProvisionRelations; -export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; -export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & DatabaseProvisionModuleRelations; export type ConfigSecretsModuleWithRelations = ConfigSecretsModule & ConfigSecretsModuleRelations; +export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; +export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & RateLimitMetersModuleRelations; export type RealtimeModuleWithRelations = RealtimeModule & RealtimeModuleRelations; @@ -1925,6 +1948,7 @@ export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; +export type PrincipalAuthModuleWithRelations = PrincipalAuthModule & PrincipalAuthModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; @@ -2273,29 +2297,40 @@ export type SecureTableProvisionSelect = { policies?: boolean; outFields?: boolean; }; -export type MerkleStoreModuleSelect = { +export type DatabaseProvisionModuleSelect = { + id?: boolean; + databaseName?: boolean; + ownerId?: boolean; + subdomain?: boolean; + domain?: boolean; + modules?: boolean; + options?: boolean; + bootstrapUser?: boolean; + status?: boolean; + errorMessage?: boolean; + databaseId?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + completedAt?: boolean; +}; +export type ConfigSecretsModuleSelect = { id?: boolean; databaseId?: boolean; schemaId?: boolean; privateSchemaId?: boolean; publicSchemaName?: boolean; privateSchemaName?: boolean; - objectTableId?: boolean; - storeTableId?: boolean; - commitTableId?: boolean; - refTableId?: boolean; - prefix?: boolean; + tableId?: boolean; + configDefinitionsTableId?: boolean; + tableName?: boolean; apiName?: boolean; privateApiName?: boolean; scope?: boolean; - functionPrefix?: boolean; - createdAt?: boolean; - graphModules?: { - select: GraphModuleSelect; - first?: number; - filter?: GraphModuleFilter; - orderBy?: GraphModuleOrderBy[]; - }; + prefix?: boolean; + entityTableId?: boolean; + policies?: boolean; + provisions?: boolean; + hasConfig?: boolean; }; export type GraphModuleSelect = { id?: boolean; @@ -2319,40 +2354,30 @@ export type GraphModuleSelect = { select: MerkleStoreModuleSelect; }; }; -export type DatabaseProvisionModuleSelect = { - id?: boolean; - databaseName?: boolean; - ownerId?: boolean; - subdomain?: boolean; - domain?: boolean; - modules?: boolean; - options?: boolean; - bootstrapUser?: boolean; - status?: boolean; - errorMessage?: boolean; - databaseId?: boolean; - createdAt?: boolean; - updatedAt?: boolean; - completedAt?: boolean; -}; -export type ConfigSecretsModuleSelect = { +export type MerkleStoreModuleSelect = { id?: boolean; databaseId?: boolean; schemaId?: boolean; privateSchemaId?: boolean; publicSchemaName?: boolean; privateSchemaName?: boolean; - tableId?: boolean; - configDefinitionsTableId?: boolean; - tableName?: boolean; + objectTableId?: boolean; + storeTableId?: boolean; + commitTableId?: boolean; + refTableId?: boolean; + prefix?: boolean; apiName?: boolean; privateApiName?: boolean; scope?: boolean; - prefix?: boolean; - entityTableId?: boolean; - policies?: boolean; - provisions?: boolean; - hasConfig?: boolean; + functionPrefix?: boolean; + permissionKey?: boolean; + createdAt?: boolean; + graphModules?: { + select: GraphModuleSelect; + first?: number; + filter?: GraphModuleFilter; + orderBy?: GraphModuleOrderBy[]; + }; }; export type RateLimitMetersModuleSelect = { id?: boolean; @@ -2467,6 +2492,26 @@ export type InvitesModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type PrincipalAuthModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + principalsTableId?: boolean; + principalEntitiesTableId?: boolean; + principalScopeOverridesTableId?: boolean; + usersTableId?: boolean; + sessionsTableId?: boolean; + sessionCredentialsTableId?: boolean; + auditsTableId?: boolean; + principalsTableName?: boolean; + createPrincipalFunction?: boolean; + deletePrincipalFunction?: boolean; + createOrgPrincipalFunction?: boolean; + deleteOrgPrincipalFunction?: boolean; + createOrgApiKeyFunction?: boolean; + revokeOrgApiKeyFunction?: boolean; + apiName?: boolean; +}; export type ComputeLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -3841,7 +3886,43 @@ export interface SecureTableProvisionFilter { /** Negates the expression. */ not?: SecureTableProvisionFilter; } -export interface MerkleStoreModuleFilter { +export interface DatabaseProvisionModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseName` field. */ + databaseName?: StringFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `subdomain` field. */ + subdomain?: StringFilter; + /** Filter by the object’s `domain` field. */ + domain?: StringFilter; + /** Filter by the object’s `modules` field. */ + modules?: JSONFilter; + /** Filter by the object’s `options` field. */ + options?: JSONFilter; + /** Filter by the object’s `bootstrapUser` field. */ + bootstrapUser?: BooleanFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: DatabaseProvisionModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DatabaseProvisionModuleFilter[]; + /** Negates the expression. */ + not?: DatabaseProvisionModuleFilter; +} +export interface ConfigSecretsModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -3854,36 +3935,34 @@ export interface MerkleStoreModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `objectTableId` field. */ - objectTableId?: UUIDFilter; - /** Filter by the object’s `storeTableId` field. */ - storeTableId?: UUIDFilter; - /** Filter by the object’s `commitTableId` field. */ - commitTableId?: UUIDFilter; - /** Filter by the object’s `refTableId` field. */ - refTableId?: UUIDFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; + /** Filter by the object’s `tableId` field. */ + tableId?: UUIDFilter; + /** Filter by the object’s `configDefinitionsTableId` field. */ + configDefinitionsTableId?: UUIDFilter; + /** Filter by the object’s `tableName` field. */ + tableName?: 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 `functionPrefix` field. */ - functionPrefix?: StringFilter; - /** Filter by the object’s `createdAt` field. */ - createdAt?: DatetimeFilter; + /** 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 `hasConfig` field. */ + hasConfig?: BooleanFilter; /** Checks for all expressions in this list. */ - and?: MerkleStoreModuleFilter[]; + and?: ConfigSecretsModuleFilter[]; /** Checks for any expressions in this list. */ - or?: MerkleStoreModuleFilter[]; + or?: ConfigSecretsModuleFilter[]; /** Negates the expression. */ - not?: MerkleStoreModuleFilter; - /** Filter by the object’s `graphModules` relation. */ - graphModules?: MerkleStoreModuleToManyGraphModuleFilter; - /** `graphModules` exist. */ - graphModulesExist?: boolean; + not?: ConfigSecretsModuleFilter; } export interface GraphModuleFilter { /** Filter by the object’s `id` field. */ @@ -3929,43 +4008,7 @@ export interface GraphModuleFilter { /** Filter by the object’s `merkleStoreModule` relation. */ merkleStoreModule?: MerkleStoreModuleFilter; } -export interface DatabaseProvisionModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseName` field. */ - databaseName?: StringFilter; - /** Filter by the object’s `ownerId` field. */ - ownerId?: UUIDFilter; - /** Filter by the object’s `subdomain` field. */ - subdomain?: StringFilter; - /** Filter by the object’s `domain` field. */ - domain?: StringFilter; - /** Filter by the object’s `modules` field. */ - modules?: JSONFilter; - /** Filter by the object’s `options` field. */ - options?: JSONFilter; - /** Filter by the object’s `bootstrapUser` field. */ - bootstrapUser?: BooleanFilter; - /** Filter by the object’s `status` field. */ - status?: StringFilter; - /** Filter by the object’s `errorMessage` field. */ - errorMessage?: StringFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `createdAt` field. */ - createdAt?: DatetimeFilter; - /** Filter by the object’s `updatedAt` field. */ - updatedAt?: DatetimeFilter; - /** Filter by the object’s `completedAt` field. */ - completedAt?: DatetimeFilter; - /** Checks for all expressions in this list. */ - and?: DatabaseProvisionModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: DatabaseProvisionModuleFilter[]; - /** Negates the expression. */ - not?: DatabaseProvisionModuleFilter; -} -export interface ConfigSecretsModuleFilter { +export interface MerkleStoreModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -3978,34 +4021,38 @@ export interface ConfigSecretsModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `tableId` field. */ - tableId?: UUIDFilter; - /** Filter by the object’s `configDefinitionsTableId` field. */ - configDefinitionsTableId?: UUIDFilter; - /** Filter by the object’s `tableName` field. */ - tableName?: StringFilter; + /** Filter by the object’s `objectTableId` field. */ + objectTableId?: UUIDFilter; + /** Filter by the object’s `storeTableId` field. */ + storeTableId?: UUIDFilter; + /** Filter by the object’s `commitTableId` field. */ + commitTableId?: UUIDFilter; + /** Filter by the object’s `refTableId` field. */ + refTableId?: 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; /** 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 `hasConfig` field. */ - hasConfig?: BooleanFilter; + /** Filter by the object’s `functionPrefix` field. */ + functionPrefix?: StringFilter; + /** Filter by the object’s `permissionKey` field. */ + permissionKey?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; /** Checks for all expressions in this list. */ - and?: ConfigSecretsModuleFilter[]; + and?: MerkleStoreModuleFilter[]; /** Checks for any expressions in this list. */ - or?: ConfigSecretsModuleFilter[]; + or?: MerkleStoreModuleFilter[]; /** Negates the expression. */ - not?: ConfigSecretsModuleFilter; + not?: MerkleStoreModuleFilter; + /** Filter by the object’s `graphModules` relation. */ + graphModules?: MerkleStoreModuleToManyGraphModuleFilter; + /** `graphModules` exist. */ + graphModulesExist?: boolean; } export interface RateLimitMetersModuleFilter { /** Filter by the object’s `id` field. */ @@ -4257,6 +4304,50 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } +export interface PrincipalAuthModuleFilter { + /** 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 `principalsTableId` field. */ + principalsTableId?: UUIDFilter; + /** Filter by the object’s `principalEntitiesTableId` field. */ + principalEntitiesTableId?: UUIDFilter; + /** Filter by the object’s `principalScopeOverridesTableId` field. */ + principalScopeOverridesTableId?: UUIDFilter; + /** Filter by the object’s `usersTableId` field. */ + usersTableId?: UUIDFilter; + /** Filter by the object’s `sessionsTableId` field. */ + sessionsTableId?: UUIDFilter; + /** Filter by the object’s `sessionCredentialsTableId` field. */ + sessionCredentialsTableId?: UUIDFilter; + /** Filter by the object’s `auditsTableId` field. */ + auditsTableId?: UUIDFilter; + /** Filter by the object’s `principalsTableName` field. */ + principalsTableName?: StringFilter; + /** Filter by the object’s `createPrincipalFunction` field. */ + createPrincipalFunction?: StringFilter; + /** Filter by the object’s `deletePrincipalFunction` field. */ + deletePrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgPrincipalFunction` field. */ + createOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `deleteOrgPrincipalFunction` field. */ + deleteOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgApiKeyFunction` field. */ + createOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `revokeOrgApiKeyFunction` field. */ + revokeOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalAuthModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalAuthModuleFilter[]; + /** Negates the expression. */ + not?: PrincipalAuthModuleFilter; +} export interface ComputeLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -6248,7 +6339,39 @@ export type SecureTableProvisionOrderBy = | 'POLICIES_DESC' | 'OUT_FIELDS_ASC' | 'OUT_FIELDS_DESC'; -export type MerkleStoreModuleOrderBy = +export type DatabaseProvisionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC'; +export type ConfigSecretsModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' @@ -6264,26 +6387,28 @@ export type MerkleStoreModuleOrderBy = | 'PUBLIC_SCHEMA_NAME_DESC' | 'PRIVATE_SCHEMA_NAME_ASC' | 'PRIVATE_SCHEMA_NAME_DESC' - | 'OBJECT_TABLE_ID_ASC' - | 'OBJECT_TABLE_ID_DESC' - | 'STORE_TABLE_ID_ASC' - | 'STORE_TABLE_ID_DESC' - | 'COMMIT_TABLE_ID_ASC' - | 'COMMIT_TABLE_ID_DESC' - | 'REF_TABLE_ID_ASC' - | 'REF_TABLE_ID_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' + | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' | 'API_NAME_ASC' | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC' | 'SCOPE_ASC' | 'SCOPE_DESC' - | 'FUNCTION_PREFIX_ASC' - | 'FUNCTION_PREFIX_DESC' - | 'CREATED_AT_ASC' - | 'CREATED_AT_DESC'; + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'HAS_CONFIG_ASC' + | 'HAS_CONFIG_DESC'; export type GraphModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6322,39 +6447,7 @@ export type GraphModuleOrderBy = | 'DEFAULT_PERMISSIONS_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC'; -export type DatabaseProvisionModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_NAME_ASC' - | 'DATABASE_NAME_DESC' - | 'OWNER_ID_ASC' - | 'OWNER_ID_DESC' - | 'SUBDOMAIN_ASC' - | 'SUBDOMAIN_DESC' - | 'DOMAIN_ASC' - | 'DOMAIN_DESC' - | 'MODULES_ASC' - | 'MODULES_DESC' - | 'OPTIONS_ASC' - | 'OPTIONS_DESC' - | 'BOOTSTRAP_USER_ASC' - | 'BOOTSTRAP_USER_DESC' - | 'STATUS_ASC' - | 'STATUS_DESC' - | 'ERROR_MESSAGE_ASC' - | 'ERROR_MESSAGE_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'CREATED_AT_ASC' - | 'CREATED_AT_DESC' - | 'UPDATED_AT_ASC' - | 'UPDATED_AT_DESC' - | 'COMPLETED_AT_ASC' - | 'COMPLETED_AT_DESC'; -export type ConfigSecretsModuleOrderBy = +export type MerkleStoreModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' @@ -6370,28 +6463,28 @@ export type ConfigSecretsModuleOrderBy = | 'PUBLIC_SCHEMA_NAME_DESC' | 'PRIVATE_SCHEMA_NAME_ASC' | 'PRIVATE_SCHEMA_NAME_DESC' - | 'TABLE_ID_ASC' - | 'TABLE_ID_DESC' - | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' - | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' - | 'TABLE_NAME_ASC' - | 'TABLE_NAME_DESC' + | 'OBJECT_TABLE_ID_ASC' + | 'OBJECT_TABLE_ID_DESC' + | 'STORE_TABLE_ID_ASC' + | 'STORE_TABLE_ID_DESC' + | 'COMMIT_TABLE_ID_ASC' + | 'COMMIT_TABLE_ID_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_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' - | 'HAS_CONFIG_ASC' - | 'HAS_CONFIG_DESC'; + | 'FUNCTION_PREFIX_ASC' + | 'FUNCTION_PREFIX_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; export type RateLimitMetersModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6618,6 +6711,46 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type PrincipalAuthModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC'; export type ComputeLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -8755,47 +8888,89 @@ export interface DeleteSecureTableProvisionInput { clientMutationId?: string; id: string; } -export interface CreateMerkleStoreModuleInput { +export interface CreateDatabaseProvisionModuleInput { clientMutationId?: string; - merkleStoreModule: { - databaseId: string; - schemaId?: string; + databaseProvisionModule: { + databaseName: string; + ownerId: string; + subdomain?: string; + domain: string; + modules?: Record; + options?: Record; + bootstrapUser?: boolean; + status?: string; + errorMessage?: string; + databaseId?: string; + completedAt?: string; + }; +} +export interface DatabaseProvisionModulePatch { + databaseName?: string | null; + ownerId?: string | null; + subdomain?: string | null; + domain?: string | null; + modules?: Record | null; + options?: Record | null; + bootstrapUser?: boolean | null; + status?: string | null; + errorMessage?: string | null; + databaseId?: string | null; + completedAt?: string | null; +} +export interface UpdateDatabaseProvisionModuleInput { + clientMutationId?: string; + id: string; + databaseProvisionModulePatch: DatabaseProvisionModulePatch; +} +export interface DeleteDatabaseProvisionModuleInput { + clientMutationId?: string; + id: string; +} +export interface CreateConfigSecretsModuleInput { + clientMutationId?: string; + configSecretsModule: { + databaseId: string; + schemaId?: string; privateSchemaId?: string; publicSchemaName?: string; privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; + tableId?: string; + configDefinitionsTableId?: string; + tableName?: string; apiName?: string; privateApiName?: string; scope?: string; - functionPrefix?: string; + prefix?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + hasConfig?: boolean; }; } -export interface MerkleStoreModulePatch { +export interface ConfigSecretsModulePatch { databaseId?: string | null; schemaId?: string | null; privateSchemaId?: string | null; publicSchemaName?: string | null; privateSchemaName?: string | null; - objectTableId?: string | null; - storeTableId?: string | null; - commitTableId?: string | null; - refTableId?: string | null; - prefix?: string | null; + tableId?: string | null; + configDefinitionsTableId?: string | null; + tableName?: string | null; apiName?: string | null; privateApiName?: string | null; scope?: string | null; - functionPrefix?: string | null; + prefix?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + hasConfig?: boolean | null; } -export interface UpdateMerkleStoreModuleInput { +export interface UpdateConfigSecretsModuleInput { clientMutationId?: string; id: string; - merkleStoreModulePatch: MerkleStoreModulePatch; + configSecretsModulePatch: ConfigSecretsModulePatch; } -export interface DeleteMerkleStoreModuleInput { +export interface DeleteConfigSecretsModuleInput { clientMutationId?: string; id: string; } @@ -8845,89 +9020,49 @@ export interface DeleteGraphModuleInput { clientMutationId?: string; id: string; } -export interface CreateDatabaseProvisionModuleInput { - clientMutationId?: string; - databaseProvisionModule: { - databaseName: string; - ownerId: string; - subdomain?: string; - domain: string; - modules?: Record; - options?: Record; - bootstrapUser?: boolean; - status?: string; - errorMessage?: string; - databaseId?: string; - completedAt?: string; - }; -} -export interface DatabaseProvisionModulePatch { - databaseName?: string | null; - ownerId?: string | null; - subdomain?: string | null; - domain?: string | null; - modules?: Record | null; - options?: Record | null; - bootstrapUser?: boolean | null; - status?: string | null; - errorMessage?: string | null; - databaseId?: string | null; - completedAt?: string | null; -} -export interface UpdateDatabaseProvisionModuleInput { - clientMutationId?: string; - id: string; - databaseProvisionModulePatch: DatabaseProvisionModulePatch; -} -export interface DeleteDatabaseProvisionModuleInput { - clientMutationId?: string; - id: string; -} -export interface CreateConfigSecretsModuleInput { +export interface CreateMerkleStoreModuleInput { clientMutationId?: string; - configSecretsModule: { + merkleStoreModule: { databaseId: string; schemaId?: string; privateSchemaId?: string; publicSchemaName?: string; privateSchemaName?: string; - tableId?: string; - configDefinitionsTableId?: string; - tableName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; apiName?: string; privateApiName?: string; scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - hasConfig?: boolean; + functionPrefix?: string; + permissionKey?: string; }; } -export interface ConfigSecretsModulePatch { +export interface MerkleStoreModulePatch { databaseId?: string | null; schemaId?: string | null; privateSchemaId?: string | null; publicSchemaName?: string | null; privateSchemaName?: string | null; - tableId?: string | null; - configDefinitionsTableId?: string | null; - tableName?: string | null; + objectTableId?: string | null; + storeTableId?: string | null; + commitTableId?: string | null; + refTableId?: string | null; + prefix?: string | null; apiName?: string | null; privateApiName?: string | null; scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - hasConfig?: boolean | null; + functionPrefix?: string | null; + permissionKey?: string | null; } -export interface UpdateConfigSecretsModuleInput { +export interface UpdateMerkleStoreModuleInput { clientMutationId?: string; id: string; - configSecretsModulePatch: ConfigSecretsModulePatch; + merkleStoreModulePatch: MerkleStoreModulePatch; } -export interface DeleteConfigSecretsModuleInput { +export interface DeleteMerkleStoreModuleInput { clientMutationId?: string; id: string; } @@ -9217,6 +9352,56 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } +export interface CreatePrincipalAuthModuleInput { + clientMutationId?: string; + principalAuthModule: { + databaseId: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; + }; +} +export interface PrincipalAuthModulePatch { + databaseId?: string | null; + schemaId?: string | null; + principalsTableId?: string | null; + principalEntitiesTableId?: string | null; + principalScopeOverridesTableId?: string | null; + usersTableId?: string | null; + sessionsTableId?: string | null; + sessionCredentialsTableId?: string | null; + auditsTableId?: string | null; + principalsTableName?: string | null; + createPrincipalFunction?: string | null; + deletePrincipalFunction?: string | null; + createOrgPrincipalFunction?: string | null; + deleteOrgPrincipalFunction?: string | null; + createOrgApiKeyFunction?: string | null; + revokeOrgApiKeyFunction?: string | null; + apiName?: string | null; +} +export interface UpdatePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; + principalAuthModulePatch: PrincipalAuthModulePatch; +} +export interface DeletePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateComputeLogModuleInput { clientMutationId?: string; computeLogModule: { @@ -11348,45 +11533,6 @@ export interface SecureTableProvisionInput { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[]; } -/** An input for mutations affecting `MerkleStoreModule` */ -export interface MerkleStoreModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - functionPrefix?: string; - createdAt?: string; -} -/** 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?: Record; - provisions?: Record; - defaultPermissions?: string[]; - createdAt?: string; -} /** An input for mutations affecting `DatabaseProvisionModule` */ export interface DatabaseProvisionModuleInput { id?: string; @@ -11433,6 +11579,46 @@ export interface ConfigSecretsModuleInput { provisions?: Record; hasConfig?: boolean; } +/** 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?: Record; + provisions?: Record; + defaultPermissions?: string[]; + createdAt?: string; +} +/** An input for mutations affecting `MerkleStoreModule` */ +export interface MerkleStoreModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + functionPrefix?: string; + permissionKey?: string; + createdAt?: string; +} /** An input for mutations affecting `RateLimitMetersModule` */ export interface RateLimitMetersModuleInput { id?: string; @@ -11550,7 +11736,28 @@ export interface InvitesModuleInput { prefix?: string; entityTableId?: string; apiName?: string; - privateApiName?: string; + privateApiName?: string; +} +/** An input for mutations affecting `PrincipalAuthModule` */ +export interface PrincipalAuthModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; } /** An input for mutations affecting `ComputeLogModule` */ export interface ComputeLogModuleInput { @@ -12970,6 +13177,8 @@ export interface MerkleStoreModuleFilter { scope?: StringFilter; /** Filter by the object’s `functionPrefix` field. */ functionPrefix?: StringFilter; + /** Filter by the object’s `permissionKey` field. */ + permissionKey?: StringFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Checks for all expressions in this list. */ @@ -14248,96 +14457,6 @@ export type DeleteSecureTableProvisionPayloadSelect = { select: SecureTableProvisionEdgeSelect; }; }; -export interface CreateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was created by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type CreateMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface UpdateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was updated by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type UpdateMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface DeleteMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was deleted by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type DeleteMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface CreateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was created by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type CreateGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; -export interface UpdateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was updated by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type UpdateGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; -export interface DeleteGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was deleted by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type DeleteGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; export interface CreateDatabaseProvisionModulePayload { clientMutationId?: string | null; /** The `DatabaseProvisionModule` that was created by this mutation. */ @@ -14428,6 +14547,96 @@ export type DeleteConfigSecretsModulePayloadSelect = { select: ConfigSecretsModuleEdgeSelect; }; }; +export interface CreateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was created by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type CreateGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface UpdateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was updated by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type UpdateGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface DeleteGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was deleted by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type DeleteGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface CreateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was created by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type CreateMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; +export interface UpdateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was updated by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type UpdateMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; +export interface DeleteMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was deleted by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type DeleteMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; export interface CreateRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was created by this mutation. */ @@ -14698,6 +14907,51 @@ export type DeleteInvitesModulePayloadSelect = { select: InvitesModuleEdgeSelect; }; }; +export interface CreatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was created by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type CreatePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; +export interface UpdatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was updated by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type UpdatePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; +export interface DeletePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was deleted by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type DeletePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ @@ -16065,30 +16319,6 @@ export type SecureTableProvisionEdgeSelect = { select: SecureTableProvisionSelect; }; }; -/** A `MerkleStoreModule` edge in the connection. */ -export interface MerkleStoreModuleEdge { - cursor?: string | null; - /** The `MerkleStoreModule` at the end of the edge. */ - node?: MerkleStoreModule | null; -} -export type MerkleStoreModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: MerkleStoreModuleSelect; - }; -}; -/** A `GraphModule` edge in the connection. */ -export interface GraphModuleEdge { - cursor?: string | null; - /** The `GraphModule` at the end of the edge. */ - node?: GraphModule | null; -} -export type GraphModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: GraphModuleSelect; - }; -}; /** A `DatabaseProvisionModule` edge in the connection. */ export interface DatabaseProvisionModuleEdge { cursor?: string | null; @@ -16113,6 +16343,30 @@ export type ConfigSecretsModuleEdgeSelect = { select: ConfigSecretsModuleSelect; }; }; +/** A `GraphModule` edge in the connection. */ +export interface GraphModuleEdge { + cursor?: string | null; + /** The `GraphModule` at the end of the edge. */ + node?: GraphModule | null; +} +export type GraphModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: GraphModuleSelect; + }; +}; +/** A `MerkleStoreModule` edge in the connection. */ +export interface MerkleStoreModuleEdge { + cursor?: string | null; + /** The `MerkleStoreModule` at the end of the edge. */ + node?: MerkleStoreModule | null; +} +export type MerkleStoreModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: MerkleStoreModuleSelect; + }; +}; /** A `RateLimitMetersModule` edge in the connection. */ export interface RateLimitMetersModuleEdge { cursor?: string | null; @@ -16185,6 +16439,18 @@ export type InvitesModuleEdgeSelect = { select: InvitesModuleSelect; }; }; +/** A `PrincipalAuthModule` edge in the connection. */ +export interface PrincipalAuthModuleEdge { + cursor?: string | null; + /** The `PrincipalAuthModule` at the end of the edge. */ + node?: PrincipalAuthModule | null; +} +export type PrincipalAuthModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: PrincipalAuthModuleSelect; + }; +}; /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/modules/orm/models/index.ts b/sdk/constructive-react/src/modules/orm/models/index.ts index 2ff305f2fc..df6b328d8a 100644 --- a/sdk/constructive-react/src/modules/orm/models/index.ts +++ b/sdk/constructive-react/src/modules/orm/models/index.ts @@ -29,16 +29,17 @@ export { BlueprintConstructionModel } from './blueprintConstruction'; export { CryptoAuthModuleModel } from './cryptoAuthModule'; export { SessionsModuleModel } from './sessionsModule'; export { SecureTableProvisionModel } from './secureTableProvision'; -export { MerkleStoreModuleModel } from './merkleStoreModule'; -export { GraphModuleModel } from './graphModule'; export { DatabaseProvisionModuleModel } from './databaseProvisionModule'; export { ConfigSecretsModuleModel } from './configSecretsModule'; +export { GraphModuleModel } from './graphModule'; +export { MerkleStoreModuleModel } from './merkleStoreModule'; export { RateLimitMetersModuleModel } from './rateLimitMetersModule'; export { RealtimeModuleModel } from './realtimeModule'; export { WebauthnAuthModuleModel } from './webauthnAuthModule'; export { FunctionInvocationModuleModel } from './functionInvocationModule'; export { FunctionModuleModel } from './functionModule'; export { InvitesModuleModel } from './invitesModule'; +export { PrincipalAuthModuleModel } from './principalAuthModule'; export { ComputeLogModuleModel } from './computeLogModule'; export { InferenceLogModuleModel } from './inferenceLogModule'; export { NamespaceModuleModel } from './namespaceModule'; diff --git a/sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts b/sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts new file mode 100644 index 0000000000..c0e9d913d3 --- /dev/null +++ b/sdk/constructive-react/src/modules/orm/models/principalAuthModule.ts @@ -0,0 +1,245 @@ +/** + * PrincipalAuthModule 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 { + PrincipalAuthModule, + PrincipalAuthModuleWithRelations, + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy, + CreatePrincipalAuthModuleInput, + UpdatePrincipalAuthModuleInput, + PrincipalAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalAuthModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModules: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + 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, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', + document, + variables, + transform: (data: { + principalAuthModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', + document, + variables, + transform: (data: { + principalAuthModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalAuthModule', + 'createPrincipalAuthModule', + 'principalAuthModule', + args.select, + args.data, + 'CreatePrincipalAuthModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'createPrincipalAuthModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrincipalAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PrincipalAuthModule', + 'updatePrincipalAuthModule', + 'principalAuthModule', + args.select, + args.where.id, + args.data, + 'UpdatePrincipalAuthModuleInput', + 'id', + 'principalAuthModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'updatePrincipalAuthModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PrincipalAuthModule', + 'deletePrincipalAuthModule', + 'principalAuthModule', + { + id: args.where.id, + }, + 'DeletePrincipalAuthModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'deletePrincipalAuthModule', + document, + variables, + }); + } +} diff --git a/sdk/constructive-react/src/modules/schema-types.ts b/sdk/constructive-react/src/modules/schema-types.ts index 4750467dd8..94cdbc04a0 100644 --- a/sdk/constructive-react/src/modules/schema-types.ts +++ b/sdk/constructive-react/src/modules/schema-types.ts @@ -45,6 +45,7 @@ import type { PermissionsModule, PhoneNumbersModule, PlansModule, + PrincipalAuthModule, ProfilesModule, RateLimitMetersModule, RateLimitsModule, @@ -696,6 +697,78 @@ export type SecureTableProvisionOrderBy = | 'POLICIES_DESC' | 'OUT_FIELDS_ASC' | 'OUT_FIELDS_DESC'; +/** Methods to use when ordering `DatabaseProvisionModule`. */ +export type DatabaseProvisionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC'; +/** Methods to use when ordering `ConfigSecretsModule`. */ +export type ConfigSecretsModuleOrderBy = + | '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_ID_ASC' + | 'TABLE_ID_DESC' + | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' + | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | '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' + | 'HAS_CONFIG_ASC' + | 'HAS_CONFIG_DESC'; /** Methods to use when ordering `GraphModule`. */ export type GraphModuleOrderBy = | 'NATURAL' @@ -770,80 +843,10 @@ export type MerkleStoreModuleOrderBy = | 'SCOPE_DESC' | 'FUNCTION_PREFIX_ASC' | 'FUNCTION_PREFIX_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC'; -/** Methods to use when ordering `DatabaseProvisionModule`. */ -export type DatabaseProvisionModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_NAME_ASC' - | 'DATABASE_NAME_DESC' - | 'OWNER_ID_ASC' - | 'OWNER_ID_DESC' - | 'SUBDOMAIN_ASC' - | 'SUBDOMAIN_DESC' - | 'DOMAIN_ASC' - | 'DOMAIN_DESC' - | 'MODULES_ASC' - | 'MODULES_DESC' - | 'OPTIONS_ASC' - | 'OPTIONS_DESC' - | 'BOOTSTRAP_USER_ASC' - | 'BOOTSTRAP_USER_DESC' - | 'STATUS_ASC' - | 'STATUS_DESC' - | 'ERROR_MESSAGE_ASC' - | 'ERROR_MESSAGE_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'CREATED_AT_ASC' - | 'CREATED_AT_DESC' - | 'UPDATED_AT_ASC' - | 'UPDATED_AT_DESC' - | 'COMPLETED_AT_ASC' - | 'COMPLETED_AT_DESC'; -/** Methods to use when ordering `ConfigSecretsModule`. */ -export type ConfigSecretsModuleOrderBy = - | '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_ID_ASC' - | 'TABLE_ID_DESC' - | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' - | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' - | 'TABLE_NAME_ASC' - | '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' - | 'HAS_CONFIG_ASC' - | 'HAS_CONFIG_DESC'; /** Methods to use when ordering `RateLimitMetersModule`. */ export type RateLimitMetersModuleOrderBy = | 'NATURAL' @@ -1076,6 +1079,47 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +/** Methods to use when ordering `PrincipalAuthModule`. */ +export type PrincipalAuthModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC'; /** Methods to use when ordering `ComputeLogModule`. */ export type ComputeLogModuleOrderBy = | 'NATURAL' @@ -3249,105 +3293,6 @@ export interface JSONListFilter { /** Any array item is greater than or equal to the specified value. */ anyGreaterThanOrEqualTo?: unknown; } -/** A filter to be used against `GraphModule` object types. All fields are combined with a logical ‘and.’ */ -export interface GraphModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `publicSchemaId` field. */ - publicSchemaId?: 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 `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; - /** Filter by the object’s `merkleStoreModuleId` field. */ - merkleStoreModuleId?: UUIDFilter; - /** Filter by the object’s `graphsTableId` field. */ - graphsTableId?: UUIDFilter; - /** 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?: GraphModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: GraphModuleFilter[]; - /** Negates the expression. */ - not?: GraphModuleFilter; - /** Filter by the object’s `merkleStoreModule` relation. */ - merkleStoreModule?: MerkleStoreModuleFilter; -} -/** A filter to be used against `MerkleStoreModule` object types. All fields are combined with a logical ‘and.’ */ -export interface MerkleStoreModuleFilter { - /** 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 `objectTableId` field. */ - objectTableId?: UUIDFilter; - /** Filter by the object’s `storeTableId` field. */ - storeTableId?: UUIDFilter; - /** Filter by the object’s `commitTableId` field. */ - commitTableId?: UUIDFilter; - /** Filter by the object’s `refTableId` field. */ - refTableId?: 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; - /** Filter by the object’s `scope` field. */ - scope?: StringFilter; - /** Filter by the object’s `functionPrefix` field. */ - functionPrefix?: StringFilter; - /** Filter by the object’s `createdAt` field. */ - createdAt?: DatetimeFilter; - /** Checks for all expressions in this list. */ - and?: MerkleStoreModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: MerkleStoreModuleFilter[]; - /** Negates the expression. */ - not?: MerkleStoreModuleFilter; - /** Filter by the object’s `graphModules` relation. */ - graphModules?: MerkleStoreModuleToManyGraphModuleFilter; - /** `graphModules` exist. */ - graphModulesExist?: boolean; -} -/** A filter to be used against many `GraphModule` object types. All fields are combined with a logical ‘and.’ */ -export interface MerkleStoreModuleToManyGraphModuleFilter { - /** Filters to entities where at least one related entity matches. */ - some?: GraphModuleFilter; - /** Filters to entities where every related entity matches. */ - every?: GraphModuleFilter; - /** Filters to entities where no related entity matches. */ - none?: GraphModuleFilter; -} /** A filter to be used against `DatabaseProvisionModule` object types. All fields are combined with a logical ‘and.’ */ export interface DatabaseProvisionModuleFilter { /** Filter by the object’s `id` field. */ @@ -3422,11 +3367,112 @@ export interface ConfigSecretsModuleFilter { /** Filter by the object’s `hasConfig` field. */ hasConfig?: BooleanFilter; /** Checks for all expressions in this list. */ - and?: ConfigSecretsModuleFilter[]; + and?: ConfigSecretsModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: ConfigSecretsModuleFilter[]; + /** Negates the expression. */ + not?: ConfigSecretsModuleFilter; +} +/** A filter to be used against `GraphModule` object types. All fields are combined with a logical ‘and.’ */ +export interface GraphModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `publicSchemaId` field. */ + publicSchemaId?: 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 `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `prefix` field. */ + prefix?: StringFilter; + /** Filter by the object’s `merkleStoreModuleId` field. */ + merkleStoreModuleId?: UUIDFilter; + /** Filter by the object’s `graphsTableId` field. */ + graphsTableId?: UUIDFilter; + /** 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?: GraphModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: GraphModuleFilter[]; + /** Negates the expression. */ + not?: GraphModuleFilter; + /** Filter by the object’s `merkleStoreModule` relation. */ + merkleStoreModule?: MerkleStoreModuleFilter; +} +/** A filter to be used against `MerkleStoreModule` object types. All fields are combined with a logical ‘and.’ */ +export interface MerkleStoreModuleFilter { + /** 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 `objectTableId` field. */ + objectTableId?: UUIDFilter; + /** Filter by the object’s `storeTableId` field. */ + storeTableId?: UUIDFilter; + /** Filter by the object’s `commitTableId` field. */ + commitTableId?: UUIDFilter; + /** Filter by the object’s `refTableId` field. */ + refTableId?: 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; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `functionPrefix` field. */ + functionPrefix?: StringFilter; + /** Filter by the object’s `permissionKey` field. */ + permissionKey?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: MerkleStoreModuleFilter[]; /** Checks for any expressions in this list. */ - or?: ConfigSecretsModuleFilter[]; + or?: MerkleStoreModuleFilter[]; /** Negates the expression. */ - not?: ConfigSecretsModuleFilter; + not?: MerkleStoreModuleFilter; + /** Filter by the object’s `graphModules` relation. */ + graphModules?: MerkleStoreModuleToManyGraphModuleFilter; + /** `graphModules` exist. */ + graphModulesExist?: boolean; +} +/** A filter to be used against many `GraphModule` object types. All fields are combined with a logical ‘and.’ */ +export interface MerkleStoreModuleToManyGraphModuleFilter { + /** Filters to entities where at least one related entity matches. */ + some?: GraphModuleFilter; + /** Filters to entities where every related entity matches. */ + every?: GraphModuleFilter; + /** Filters to entities where no related entity matches. */ + none?: GraphModuleFilter; } /** A filter to be used against `RateLimitMetersModule` object types. All fields are combined with a logical ‘and.’ */ export interface RateLimitMetersModuleFilter { @@ -3684,6 +3730,51 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } +/** A filter to be used against `PrincipalAuthModule` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalAuthModuleFilter { + /** 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 `principalsTableId` field. */ + principalsTableId?: UUIDFilter; + /** Filter by the object’s `principalEntitiesTableId` field. */ + principalEntitiesTableId?: UUIDFilter; + /** Filter by the object’s `principalScopeOverridesTableId` field. */ + principalScopeOverridesTableId?: UUIDFilter; + /** Filter by the object’s `usersTableId` field. */ + usersTableId?: UUIDFilter; + /** Filter by the object’s `sessionsTableId` field. */ + sessionsTableId?: UUIDFilter; + /** Filter by the object’s `sessionCredentialsTableId` field. */ + sessionCredentialsTableId?: UUIDFilter; + /** Filter by the object’s `auditsTableId` field. */ + auditsTableId?: UUIDFilter; + /** Filter by the object’s `principalsTableName` field. */ + principalsTableName?: StringFilter; + /** Filter by the object’s `createPrincipalFunction` field. */ + createPrincipalFunction?: StringFilter; + /** Filter by the object’s `deletePrincipalFunction` field. */ + deletePrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgPrincipalFunction` field. */ + createOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `deleteOrgPrincipalFunction` field. */ + deleteOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgApiKeyFunction` field. */ + createOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `revokeOrgApiKeyFunction` field. */ + revokeOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalAuthModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalAuthModuleFilter[]; + /** Negates the expression. */ + not?: PrincipalAuthModuleFilter; +} /** 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. */ @@ -5654,30 +5745,6 @@ export interface SecureTableProvisionInput { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[]; } -export interface CreateMerkleStoreModuleInput { - clientMutationId?: string; - /** The `MerkleStoreModule` to be created by this mutation. */ - merkleStoreModule: MerkleStoreModuleInput; -} -/** An input for mutations affecting `MerkleStoreModule` */ -export interface MerkleStoreModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - functionPrefix?: string; - createdAt?: string; -} export interface CreateDatabaseProvisionModuleInput { clientMutationId?: string; /** The `DatabaseProvisionModule` to be created by this mutation. */ @@ -5759,6 +5826,31 @@ export interface GraphModuleInput { defaultPermissions?: string[]; createdAt?: string; } +export interface CreateMerkleStoreModuleInput { + clientMutationId?: string; + /** The `MerkleStoreModule` to be created by this mutation. */ + merkleStoreModule: MerkleStoreModuleInput; +} +/** An input for mutations affecting `MerkleStoreModule` */ +export interface MerkleStoreModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + functionPrefix?: string; + permissionKey?: string; + createdAt?: string; +} export interface CreateRateLimitMetersModuleInput { clientMutationId?: string; /** The `RateLimitMetersModule` to be created by this mutation. */ @@ -5908,6 +6000,32 @@ export interface InvitesModuleInput { apiName?: string; privateApiName?: string; } +export interface CreatePrincipalAuthModuleInput { + clientMutationId?: string; + /** The `PrincipalAuthModule` to be created by this mutation. */ + principalAuthModule: PrincipalAuthModuleInput; +} +/** An input for mutations affecting `PrincipalAuthModule` */ +export interface PrincipalAuthModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; +} export interface CreateComputeLogModuleInput { clientMutationId?: string; /** The `ComputeLogModule` to be created by this mutation. */ @@ -7538,31 +7656,6 @@ export interface SecureTableProvisionPatch { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[]; } -export interface UpdateMerkleStoreModuleInput { - clientMutationId?: string; - id: string; - /** An object where the defined keys will be set on the `MerkleStoreModule` being updated. */ - merkleStoreModulePatch: MerkleStoreModulePatch; -} -/** Represents an update to a `MerkleStoreModule`. Fields that are set will be updated. */ -export interface MerkleStoreModulePatch { - id?: string; - databaseId?: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - functionPrefix?: string; - createdAt?: string; -} export interface UpdateDatabaseProvisionModuleInput { clientMutationId?: string; id: string; @@ -7647,6 +7740,32 @@ export interface GraphModulePatch { defaultPermissions?: string[]; createdAt?: string; } +export interface UpdateMerkleStoreModuleInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `MerkleStoreModule` being updated. */ + merkleStoreModulePatch: MerkleStoreModulePatch; +} +/** Represents an update to a `MerkleStoreModule`. Fields that are set will be updated. */ +export interface MerkleStoreModulePatch { + id?: string; + databaseId?: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + functionPrefix?: string; + permissionKey?: string; + createdAt?: string; +} export interface UpdateRateLimitMetersModuleInput { clientMutationId?: string; id: string; @@ -7802,6 +7921,33 @@ export interface InvitesModulePatch { apiName?: string; privateApiName?: string; } +export interface UpdatePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; + /** An object where the defined keys will be set on the `PrincipalAuthModule` being updated. */ + principalAuthModulePatch: PrincipalAuthModulePatch; +} +/** Represents an update to a `PrincipalAuthModule`. Fields that are set will be updated. */ +export interface PrincipalAuthModulePatch { + id?: string; + databaseId?: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; +} export interface UpdateComputeLogModuleInput { clientMutationId?: string; id: string; @@ -9075,10 +9221,6 @@ export interface DeleteSecureTableProvisionInput { /** Unique identifier for this provision row. */ id: string; } -export interface DeleteMerkleStoreModuleInput { - clientMutationId?: string; - id: string; -} export interface DeleteDatabaseProvisionModuleInput { clientMutationId?: string; id: string; @@ -9091,6 +9233,10 @@ export interface DeleteGraphModuleInput { clientMutationId?: string; id: string; } +export interface DeleteMerkleStoreModuleInput { + clientMutationId?: string; + id: string; +} export interface DeleteRateLimitMetersModuleInput { clientMutationId?: string; id: string; @@ -9115,6 +9261,10 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } +export interface DeletePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; +} export interface DeleteComputeLogModuleInput { clientMutationId?: string; id: string; @@ -9398,13 +9548,6 @@ export interface SecureTableProvisionConnection { pageInfo: PageInfo; totalCount: number; } -/** A connection to a list of `MerkleStoreModule` values. */ -export interface MerkleStoreModuleConnection { - nodes: MerkleStoreModule[]; - edges: MerkleStoreModuleEdge[]; - pageInfo: PageInfo; - totalCount: number; -} /** A connection to a list of `DatabaseProvisionModule` values. */ export interface DatabaseProvisionModuleConnection { nodes: DatabaseProvisionModule[]; @@ -9426,6 +9569,13 @@ export interface GraphModuleConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `MerkleStoreModule` values. */ +export interface MerkleStoreModuleConnection { + nodes: MerkleStoreModule[]; + edges: MerkleStoreModuleEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `RateLimitMetersModule` values. */ export interface RateLimitMetersModuleConnection { nodes: RateLimitMetersModule[]; @@ -9468,6 +9618,13 @@ export interface InvitesModuleConnection { pageInfo: PageInfo; totalCount: number; } +/** A connection to a list of `PrincipalAuthModule` values. */ +export interface PrincipalAuthModuleConnection { + nodes: PrincipalAuthModule[]; + edges: PrincipalAuthModuleEdge[]; + pageInfo: PageInfo; + totalCount: number; +} /** A connection to a list of `ComputeLogModule` values. */ export interface ComputeLogModuleConnection { nodes: ComputeLogModule[]; @@ -9824,12 +9981,6 @@ export interface CreateSecureTableProvisionPayload { secureTableProvision?: SecureTableProvision | null; secureTableProvisionEdge?: SecureTableProvisionEdge | null; } -export interface CreateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was created by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} export interface CreateDatabaseProvisionModulePayload { clientMutationId?: string | null; /** The `DatabaseProvisionModule` that was created by this mutation. */ @@ -9848,6 +9999,12 @@ export interface CreateGraphModulePayload { graphModule?: GraphModule | null; graphModuleEdge?: GraphModuleEdge | null; } +export interface CreateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was created by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} export interface CreateRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was created by this mutation. */ @@ -9884,6 +10041,12 @@ export interface CreateInvitesModulePayload { invitesModule?: InvitesModule | null; invitesModuleEdge?: InvitesModuleEdge | null; } +export interface CreatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was created by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ @@ -10178,12 +10341,6 @@ export interface UpdateSecureTableProvisionPayload { secureTableProvision?: SecureTableProvision | null; secureTableProvisionEdge?: SecureTableProvisionEdge | null; } -export interface UpdateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was updated by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} export interface UpdateDatabaseProvisionModulePayload { clientMutationId?: string | null; /** The `DatabaseProvisionModule` that was updated by this mutation. */ @@ -10202,6 +10359,12 @@ export interface UpdateGraphModulePayload { graphModule?: GraphModule | null; graphModuleEdge?: GraphModuleEdge | null; } +export interface UpdateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was updated by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} export interface UpdateRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was updated by this mutation. */ @@ -10238,6 +10401,12 @@ export interface UpdateInvitesModulePayload { invitesModule?: InvitesModule | null; invitesModuleEdge?: InvitesModuleEdge | null; } +export interface UpdatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was updated by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} export interface UpdateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was updated by this mutation. */ @@ -10532,12 +10701,6 @@ export interface DeleteSecureTableProvisionPayload { secureTableProvision?: SecureTableProvision | null; secureTableProvisionEdge?: SecureTableProvisionEdge | null; } -export interface DeleteMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was deleted by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} export interface DeleteDatabaseProvisionModulePayload { clientMutationId?: string | null; /** The `DatabaseProvisionModule` that was deleted by this mutation. */ @@ -10556,6 +10719,12 @@ export interface DeleteGraphModulePayload { graphModule?: GraphModule | null; graphModuleEdge?: GraphModuleEdge | null; } +export interface DeleteMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was deleted by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} export interface DeleteRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was deleted by this mutation. */ @@ -10592,6 +10761,12 @@ export interface DeleteInvitesModulePayload { invitesModule?: InvitesModule | null; invitesModuleEdge?: InvitesModuleEdge | null; } +export interface DeletePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was deleted by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} export interface DeleteComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was deleted by this mutation. */ @@ -10911,12 +11086,6 @@ export interface SecureTableProvisionEdge { /** The `SecureTableProvision` at the end of the edge. */ node?: SecureTableProvision | null; } -/** A `MerkleStoreModule` edge in the connection. */ -export interface MerkleStoreModuleEdge { - cursor?: string | null; - /** The `MerkleStoreModule` at the end of the edge. */ - node?: MerkleStoreModule | null; -} /** A `DatabaseProvisionModule` edge in the connection. */ export interface DatabaseProvisionModuleEdge { cursor?: string | null; @@ -10935,6 +11104,12 @@ export interface GraphModuleEdge { /** The `GraphModule` at the end of the edge. */ node?: GraphModule | null; } +/** A `MerkleStoreModule` edge in the connection. */ +export interface MerkleStoreModuleEdge { + cursor?: string | null; + /** The `MerkleStoreModule` at the end of the edge. */ + node?: MerkleStoreModule | null; +} /** A `RateLimitMetersModule` edge in the connection. */ export interface RateLimitMetersModuleEdge { cursor?: string | null; @@ -10971,6 +11146,12 @@ export interface InvitesModuleEdge { /** The `InvitesModule` at the end of the edge. */ node?: InvitesModule | null; } +/** A `PrincipalAuthModule` edge in the connection. */ +export interface PrincipalAuthModuleEdge { + cursor?: string | null; + /** The `PrincipalAuthModule` at the end of the edge. */ + node?: PrincipalAuthModule | null; +} /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; diff --git a/sdk/constructive-react/src/modules/types.ts b/sdk/constructive-react/src/modules/types.ts index 3cdbc9e2af..836dc743a2 100644 --- a/sdk/constructive-react/src/modules/types.ts +++ b/sdk/constructive-react/src/modules/types.ts @@ -297,23 +297,40 @@ export interface SecureTableProvision { policies: unknown | null; outFields: string[] | null; } -export interface MerkleStoreModule { +export interface DatabaseProvisionModule { + id: string | null; + databaseName: string | null; + ownerId: string | null; + subdomain: string | null; + domain: string | null; + modules: unknown | null; + options: unknown | null; + bootstrapUser: boolean | null; + status: string | null; + errorMessage: string | null; + databaseId: string | null; + createdAt: string | null; + updatedAt: string | null; + completedAt: string | null; +} +export interface ConfigSecretsModule { id: string | null; databaseId: string | null; schemaId: string | null; privateSchemaId: string | null; publicSchemaName: string | null; privateSchemaName: string | null; - objectTableId: string | null; - storeTableId: string | null; - commitTableId: string | null; - refTableId: string | null; - prefix: string | null; + tableId: string | null; + configDefinitionsTableId: string | null; + tableName: string | null; apiName: string | null; privateApiName: string | null; scope: string | null; - functionPrefix: string | null; - createdAt: string | null; + prefix: string | null; + entityTableId: string | null; + policies: unknown | null; + provisions: unknown | null; + hasConfig: boolean | null; } export interface GraphModule { id: string | null; @@ -334,40 +351,24 @@ export interface GraphModule { defaultPermissions: string[] | null; createdAt: string | null; } -export interface DatabaseProvisionModule { - id: string | null; - databaseName: string | null; - ownerId: string | null; - subdomain: string | null; - domain: string | null; - modules: unknown | null; - options: unknown | null; - bootstrapUser: boolean | null; - status: string | null; - errorMessage: string | null; - databaseId: string | null; - createdAt: string | null; - updatedAt: string | null; - completedAt: string | null; -} -export interface ConfigSecretsModule { +export interface MerkleStoreModule { id: string | null; databaseId: string | null; schemaId: string | null; privateSchemaId: string | null; publicSchemaName: string | null; privateSchemaName: string | null; - tableId: string | null; - configDefinitionsTableId: string | null; - tableName: string | null; + objectTableId: string | null; + storeTableId: string | null; + commitTableId: string | null; + refTableId: string | null; + prefix: string | null; apiName: string | null; privateApiName: string | null; scope: string | null; - prefix: string | null; - entityTableId: string | null; - policies: unknown | null; - provisions: unknown | null; - hasConfig: boolean | null; + functionPrefix: string | null; + permissionKey: string | null; + createdAt: string | null; } export interface RateLimitMetersModule { id: string | null; @@ -482,6 +483,26 @@ export interface InvitesModule { apiName: string | null; privateApiName: string | null; } +export interface PrincipalAuthModule { + id: string | null; + databaseId: string | null; + schemaId: string | null; + principalsTableId: string | null; + principalEntitiesTableId: string | null; + principalScopeOverridesTableId: string | null; + usersTableId: string | null; + sessionsTableId: string | null; + sessionCredentialsTableId: string | null; + auditsTableId: string | null; + principalsTableName: string | null; + createPrincipalFunction: string | null; + deletePrincipalFunction: string | null; + createOrgPrincipalFunction: string | null; + deleteOrgPrincipalFunction: string | null; + createOrgApiKeyFunction: string | null; + revokeOrgApiKeyFunction: string | null; + apiName: string | null; +} export interface ComputeLogModule { id: string | null; databaseId: string | null; diff --git a/sdk/constructive-sdk/schemas/auth.graphql b/sdk/constructive-sdk/schemas/auth.graphql index 69d407d14e..cd74ba7cb9 100644 --- a/sdk/constructive-sdk/schemas/auth.graphql +++ b/sdk/constructive-sdk/schemas/auth.graphql @@ -1,8 +1,8 @@ """The root query type which gives access points into the data universe.""" type Query { currentUserAgent: String - currentIpAddress: InternetAddress currentUserId: UUID + currentIpAddress: InternetAddress requireStepUp(stepUpType: String): Boolean currentUser: User @@ -64,6 +64,35 @@ type Query { orderBy: [RoleTypeOrderBy!] = [PRIMARY_KEY_ASC] ): RoleTypeConnection + """Reads and enables pagination through a set of `PrincipalEntity`.""" + principalEntities( + """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: PrincipalEntityFilter + + """The method to use when ordering `PrincipalEntity`.""" + orderBy: [PrincipalEntityOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalEntityConnection + """Reads and enables pagination through a set of `UserConnectedAccount`.""" userConnectedAccounts( """Only read the first `n` values of the set.""" @@ -122,6 +151,35 @@ type Query { orderBy: [CryptoAddressOrderBy!] = [PRIMARY_KEY_ASC] ): CryptoAddressConnection + """Reads and enables pagination through a set of `Principal`.""" + principals( + """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: PrincipalFilter + + """The method to use when ordering `Principal`.""" + orderBy: [PrincipalOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalConnection + """Reads and enables pagination through a set of `PhoneNumber`.""" phoneNumbers( """Only read the first `n` values of the set.""" @@ -180,6 +238,66 @@ type Query { orderBy: [AuditLogAuthOrderBy!] = [PRIMARY_KEY_ASC] ): AuditLogAuthConnection + """ + Reads and enables pagination through a set of `PrincipalScopeOverride`. + """ + principalScopeOverrides( + """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: PrincipalScopeOverrideFilter + + """The method to use when ordering `PrincipalScopeOverride`.""" + orderBy: [PrincipalScopeOverrideOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalScopeOverrideConnection + + """Reads and enables pagination through a set of `OrgApiKeyList`.""" + orgApiKeyLists( + """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: OrgApiKeyListFilter + + """The method to use when ordering `OrgApiKeyList`.""" + orderBy: [OrgApiKeyListOrderBy!] = [NATURAL] + ): OrgApiKeyListConnection + """Reads and enables pagination through a set of `Email`.""" emails( """Only read the first `n` values of the set.""" @@ -273,14 +391,14 @@ type Query { _meta: MetaSchema } -"""An IPv4 or IPv6 host address, and optionally its subnet.""" -scalar InternetAddress - """ A universally unique identifier as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). """ scalar UUID +"""An IPv4 or IPv6 host address, and optionally its subnet.""" +scalar InternetAddress + type User { id: UUID! username: String @@ -294,6 +412,93 @@ type User { """Reads a single `RoleType` that is related to this `User`.""" roleType: RoleType + """Reads and enables pagination through a set of `Principal`.""" + ownedPrincipals( + """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: PrincipalFilter + + """The method to use when ordering `Principal`.""" + orderBy: [PrincipalOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalConnection! + + """Reads and enables pagination through a set of `Principal`.""" + principals( + """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: PrincipalFilter + + """The method to use when ordering `Principal`.""" + orderBy: [PrincipalOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalConnection! + + """Reads and enables pagination through a set of `PrincipalEntity`.""" + principalEntitiesByEntityId( + """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: PrincipalEntityFilter + + """The method to use when ordering `PrincipalEntity`.""" + orderBy: [PrincipalEntityOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalEntityConnection! + """Reads and enables pagination through a set of `Email`.""" ownedEmails( """Only read the first `n` values of the set.""" @@ -474,96 +679,198 @@ type RoleType { name: String! } -"""A connection to a list of `Email` values.""" -type EmailConnection { - """A list of `Email` objects.""" - nodes: [Email]! +"""A connection to a list of `Principal` values.""" +type PrincipalConnection { + """A list of `Principal` objects.""" + nodes: [Principal]! """ - A list of edges which contains the `Email` and cursor to aid in pagination. + A list of edges which contains the `Principal` and cursor to aid in pagination. """ - edges: [EmailEdge]! + edges: [PrincipalEdge]! """Information to aid in pagination.""" pageInfo: PageInfo! - """The count of *all* `Email` you could get from the connection.""" + """The count of *all* `Principal` you could get from the connection.""" totalCount: Int! } -"""User email addresses with verification and primary-email management""" -type Email { +"""Scoped sub-identities (API keys and agents) with precomputed SPRT""" +type Principal { id: UUID! + createdAt: Datetime + updatedAt: Datetime + + """The human user who owns and manages this principal""" ownerId: UUID! - """The email address""" - email: ConstructiveInternalTypeEmail! + """ + The user row (type=3 Principal) that represents this principal identity + """ + userId: UUID! - """Whether the email address has been verified via confirmation link""" - isVerified: Boolean! + """ + Human-readable label for this principal (e.g., billing-bot, ci-deploy-key) + """ + name: String! - """Whether this is the user's primary email address""" - isPrimary: Boolean! + """Permission bitmask subset; all-1s means inherit all parent permissions""" + allowedMask: BitString! - """Optional user-provided label for this email (e.g. "Work", "Personal").""" - name: String - createdAt: Datetime - updatedAt: Datetime + """Whether this principal is restricted to read-only operations""" + isReadOnly: Boolean! - """Reads a single `User` that is related to this `Email`.""" - owner: User -} + """Whether this principal bypasses MFA step-up requirements""" + bypassStepUp: Boolean! -scalar ConstructiveInternalTypeEmail + """Reads a single `User` that is related to this `Principal`.""" + owner: User -"""A `Email` edge in the connection.""" -type EmailEdge { - """A cursor for use in pagination.""" - cursor: Cursor + """Reads a single `User` that is related to this `Principal`.""" + user: User - """The `Email` at the end of the edge.""" - node: Email -} + """Reads and enables pagination through a set of `PrincipalEntity`.""" + principalEntities( + """Only read the first `n` values of the set.""" + first: Int -"""A location in a connection that can be used for resuming pagination.""" -scalar Cursor + """Only read the last `n` values of the set.""" + last: Int -"""Information about pagination in a connection.""" -type PageInfo { - """When paginating forwards, are there more items?""" - hasNextPage: Boolean! + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int - """When paginating backwards, are there more items?""" - hasPreviousPage: Boolean! + """Read all values in the set before (above) this cursor.""" + before: Cursor - """When paginating backwards, the cursor to continue.""" - startCursor: Cursor + """Read all values in the set after (below) this cursor.""" + after: Cursor - """When paginating forwards, the cursor to continue.""" - endCursor: Cursor -} + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: PrincipalEntityFilter -""" -A filter to be used against `Email` object types. All fields are combined with a logical ‘and.’ -""" -input EmailFilter { - """Filter by the object’s `id` field.""" - id: UUIDFilter + """The method to use when ordering `PrincipalEntity`.""" + orderBy: [PrincipalEntityOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalEntityConnection! - """Filter by the object’s `ownerId` field.""" - ownerId: UUIDFilter + """ + Reads and enables pagination through a set of `PrincipalScopeOverride`. + """ + principalScopeOverrides( + """Only read the first `n` values of the set.""" + first: Int - """Filter by the object’s `email` field.""" - email: ConstructiveInternalTypeEmailFilter + """Only read the last `n` values of the set.""" + last: Int - """Filter by the object’s `isVerified` field.""" - isVerified: BooleanFilter + """ + Skip the first `n` values from our `after` cursor, an alternative to cursor + based pagination. May not be used with `last`. + """ + offset: Int - """Filter by the object’s `isPrimary` field.""" - isPrimary: BooleanFilter + """Read all values in the set before (above) this cursor.""" + before: Cursor - """Filter by the object’s `name` field.""" - name: StringFilter + """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: PrincipalScopeOverrideFilter + + """The method to use when ordering `PrincipalScopeOverride`.""" + orderBy: [PrincipalScopeOverrideOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalScopeOverrideConnection! +} + +"""A string representing a series of binary bits""" +scalar BitString + +"""A connection to a list of `PrincipalEntity` values.""" +type PrincipalEntityConnection { + """A list of `PrincipalEntity` objects.""" + nodes: [PrincipalEntity]! + + """ + A list of edges which contains the `PrincipalEntity` and cursor to aid in pagination. + """ + edges: [PrincipalEntityEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `PrincipalEntity` you could get from the connection. + """ + totalCount: Int! +} + +"""Association table scoping principals to specific organizations""" +type PrincipalEntity { + id: UUID! + createdAt: Datetime + updatedAt: Datetime + + """The principal this scoping row belongs to""" + principalId: UUID! + + """The organization this principal is scoped to""" + entityId: UUID! + + """Denormalized owner_id from principals table for RLS""" + ownerId: UUID! + + """Reads a single `User` that is related to this `PrincipalEntity`.""" + entity: User + + """Reads a single `User` that is related to this `PrincipalEntity`.""" + owner: User + + """Reads a single `Principal` that is related to this `PrincipalEntity`.""" + principal: Principal +} + +"""A `PrincipalEntity` edge in the connection.""" +type PrincipalEntityEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `PrincipalEntity` at the end of the edge.""" + node: PrincipalEntity +} + +"""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 `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ +""" +input PrincipalEntityFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter """Filter by the object’s `createdAt` field.""" createdAt: DatetimeFilter @@ -571,17 +878,32 @@ input EmailFilter { """Filter by the object’s `updatedAt` field.""" updatedAt: DatetimeFilter + """Filter by the object’s `principalId` field.""" + principalId: UUIDFilter + + """Filter by the object’s `entityId` field.""" + entityId: UUIDFilter + + """Filter by the object’s `ownerId` field.""" + ownerId: UUIDFilter + """Checks for all expressions in this list.""" - and: [EmailFilter!] + and: [PrincipalEntityFilter!] """Checks for any expressions in this list.""" - or: [EmailFilter!] + or: [PrincipalEntityFilter!] """Negates the expression.""" - not: EmailFilter + not: PrincipalEntityFilter + + """Filter by the object’s `entity` relation.""" + entity: UserFilter """Filter by the object’s `owner` relation.""" owner: UserFilter + + """Filter by the object’s `principal` relation.""" + principal: PrincipalFilter } """ @@ -627,9 +949,155 @@ input UUIDFilter { } """ -A filter to be used against ConstructiveInternalTypeEmail fields. All fields are combined with a logical ‘and.’ +A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ """ -input ConstructiveInternalTypeEmailFilter { +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 `User` object types. All fields are combined with a logical ‘and.’ +""" +input UserFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `username` field.""" + username: StringTrgmFilter + + """Filter by the object’s `displayName` field.""" + displayName: StringTrgmFilter + + """Filter by the object’s `profilePicture` field.""" + profilePicture: ConstructiveInternalTypeImageFilter + + """Filter by the object’s `searchTsv` field.""" + searchTsv: FullTextFilter + + """Filter by the object’s `type` field.""" + type: IntFilter + + """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: [UserFilter!] + + """Checks for any expressions in this list.""" + or: [UserFilter!] + + """Negates the expression.""" + not: UserFilter + + """Filter by the object’s `roleType` relation.""" + roleType: RoleTypeFilter + + """Filter by the object’s `ownedPrincipals` relation.""" + ownedPrincipals: UserToManyPrincipalFilter + + """`ownedPrincipals` exist.""" + ownedPrincipalsExist: Boolean + + """Filter by the object’s `principals` relation.""" + principals: UserToManyPrincipalFilter + + """`principals` exist.""" + principalsExist: Boolean + + """Filter by the object’s `principalEntitiesByEntityId` relation.""" + principalEntitiesByEntityId: UserToManyPrincipalEntityFilter + + """`principalEntitiesByEntityId` exist.""" + principalEntitiesByEntityIdExist: Boolean + + """Filter by the object’s `ownedEmails` relation.""" + ownedEmails: UserToManyEmailFilter + + """`ownedEmails` exist.""" + ownedEmailsExist: Boolean + + """Filter by the object’s `ownedPhoneNumbers` relation.""" + ownedPhoneNumbers: UserToManyPhoneNumberFilter + + """`ownedPhoneNumbers` exist.""" + ownedPhoneNumbersExist: Boolean + + """Filter by the object’s `ownedCryptoAddresses` relation.""" + ownedCryptoAddresses: UserToManyCryptoAddressFilter + + """`ownedCryptoAddresses` exist.""" + ownedCryptoAddressesExist: Boolean + + """Filter by the object’s `ownedWebauthnCredentials` relation.""" + ownedWebauthnCredentials: UserToManyWebauthnCredentialFilter + + """`ownedWebauthnCredentials` exist.""" + ownedWebauthnCredentialsExist: Boolean + + """Filter by the object’s `auditLogAuthsByActorId` relation.""" + auditLogAuthsByActorId: UserToManyAuditLogAuthFilter + + """`auditLogAuthsByActorId` exist.""" + auditLogAuthsByActorIdExist: Boolean + + """TSV search on the `search_tsv` column.""" + tsvSearchTsv: String + + """TRGM search on the `display_name` column.""" + trgmDisplayName: TrgmSearchInput + + """ + Composite unified search. Provide a search string and it will be dispatched to + all text-compatible search algorithms (tsvector, BM25, pg_trgm) + 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 +} + +""" +A filter to be used against String fields with pg_trgm support. All fields are combined with a logical ‘and.’ +""" +input StringTrgmFilter { """ Is null (if `true` is specified) or is not null (if `false` is specified). """ @@ -674,10 +1142,10 @@ input ConstructiveInternalTypeEmailFilter { notIncludes: String """Contains the specified string (case-insensitive).""" - includesInsensitive: ConstructiveInternalTypeEmail + includesInsensitive: String """Does not contain the specified string (case-insensitive).""" - notIncludesInsensitive: ConstructiveInternalTypeEmail + notIncludesInsensitive: String """Starts with the specified string (case-sensitive).""" startsWith: String @@ -686,10 +1154,10 @@ input ConstructiveInternalTypeEmailFilter { notStartsWith: String """Starts with the specified string (case-insensitive).""" - startsWithInsensitive: ConstructiveInternalTypeEmail + startsWithInsensitive: String """Does not start with the specified string (case-insensitive).""" - notStartsWithInsensitive: ConstructiveInternalTypeEmail + notStartsWithInsensitive: String """Ends with the specified string (case-sensitive).""" endsWith: String @@ -698,10 +1166,10 @@ input ConstructiveInternalTypeEmailFilter { notEndsWith: String """Ends with the specified string (case-insensitive).""" - endsWithInsensitive: ConstructiveInternalTypeEmail + endsWithInsensitive: String """Does not end with the specified string (case-insensitive).""" - notEndsWithInsensitive: ConstructiveInternalTypeEmail + 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. @@ -716,88 +1184,221 @@ input ConstructiveInternalTypeEmailFilter { """ Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. """ - likeInsensitive: ConstructiveInternalTypeEmail + 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: ConstructiveInternalTypeEmail + notLikeInsensitive: String """Equal to the specified value (case-insensitive).""" - equalToInsensitive: ConstructiveInternalTypeEmail + equalToInsensitive: String """Not equal to the specified value (case-insensitive).""" - notEqualToInsensitive: ConstructiveInternalTypeEmail + notEqualToInsensitive: String """ Not equal to the specified value, treating null like an ordinary value (case-insensitive). """ - distinctFromInsensitive: ConstructiveInternalTypeEmail + distinctFromInsensitive: String """ Equal to the specified value, treating null like an ordinary value (case-insensitive). """ - notDistinctFromInsensitive: ConstructiveInternalTypeEmail + notDistinctFromInsensitive: String """Included in the specified list (case-insensitive).""" - inInsensitive: [ConstructiveInternalTypeEmail!] + inInsensitive: [String!] """Not included in the specified list (case-insensitive).""" - notInInsensitive: [ConstructiveInternalTypeEmail!] + notInInsensitive: [String!] """Less than the specified value (case-insensitive).""" - lessThanInsensitive: ConstructiveInternalTypeEmail + lessThanInsensitive: String """Less than or equal to the specified value (case-insensitive).""" - lessThanOrEqualToInsensitive: ConstructiveInternalTypeEmail + lessThanOrEqualToInsensitive: String """Greater than the specified value (case-insensitive).""" - greaterThanInsensitive: ConstructiveInternalTypeEmail + greaterThanInsensitive: String """Greater than or equal to the specified value (case-insensitive).""" - greaterThanOrEqualToInsensitive: ConstructiveInternalTypeEmail + greaterThanOrEqualToInsensitive: String + + """ + Fuzzy matches using pg_trgm trigram similarity. Tolerates typos and misspellings. + """ + similarTo: TrgmSearchInput + + """ + Fuzzy matches using pg_trgm word_similarity. Finds the best matching substring within the column value. + """ + wordSimilarTo: TrgmSearchInput } """ -A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ +Input for pg_trgm fuzzy text matching. Provide a search value and optional similarity threshold. """ -input BooleanFilter { +input TrgmSearchInput { + """The text to fuzzy-match against. Typos and misspellings are tolerated.""" + value: String! + + """ + Minimum similarity threshold (0.0 to 1.0). Higher = stricter matching. Default is 0.3. + """ + threshold: Float +} + +""" +A filter to be used against ConstructiveInternalTypeImage fields. All fields are combined with a logical ‘and.’ +""" +input ConstructiveInternalTypeImageFilter { """ Is null (if `true` is specified) or is not null (if `false` is specified). """ isNull: Boolean """Equal to the specified value.""" - equalTo: Boolean + equalTo: ConstructiveInternalTypeImage """Not equal to the specified value.""" - notEqualTo: Boolean + notEqualTo: ConstructiveInternalTypeImage """ Not equal to the specified value, treating null like an ordinary value. """ - distinctFrom: Boolean + distinctFrom: ConstructiveInternalTypeImage """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: Boolean + notDistinctFrom: ConstructiveInternalTypeImage """Included in the specified list.""" - in: [Boolean!] + in: [ConstructiveInternalTypeImage!] """Not included in the specified list.""" - notIn: [Boolean!] + notIn: [ConstructiveInternalTypeImage!] """Less than the specified value.""" - lessThan: Boolean + lessThan: ConstructiveInternalTypeImage """Less than or equal to the specified value.""" - lessThanOrEqualTo: Boolean + lessThanOrEqualTo: ConstructiveInternalTypeImage """Greater than the specified value.""" - greaterThan: Boolean + greaterThan: ConstructiveInternalTypeImage """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: Boolean + greaterThanOrEqualTo: ConstructiveInternalTypeImage + + """Contains the specified JSON.""" + contains: ConstructiveInternalTypeImage + + """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: ConstructiveInternalTypeImage +} + +""" +A filter to be used against FullText fields. All fields are combined with a logical ‘and.’ +""" +input FullTextFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean + + """Equal to the specified value.""" + equalTo: FullText + + """Not equal to the specified value.""" + notEqualTo: FullText + + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: FullText + + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: FullText + + """Included in the specified list.""" + in: [FullText!] + + """Not included in the specified list.""" + notIn: [FullText!] + + """Performs a full text search on the field.""" + matches: String +} + +""" +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 `RoleType` object types. All fields are combined with a logical ‘and.’ +""" +input RoleTypeFilter { + """Filter by the object’s `id` field.""" + id: IntFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Checks for all expressions in this list.""" + and: [RoleTypeFilter!] + + """Checks for any expressions in this list.""" + or: [RoleTypeFilter!] + + """Negates the expression.""" + not: RoleTypeFilter } """ @@ -933,137 +1534,304 @@ input StringFilter { } """ -A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ +A filter to be used against many `Principal` object types. All fields are combined with a logical ‘and.’ """ -input DatetimeFilter { +input UserToManyPrincipalFilter { + """Filters to entities where at least one related entity matches.""" + some: PrincipalFilter + + """Filters to entities where every related entity matches.""" + every: PrincipalFilter + + """Filters to entities where no related entity matches.""" + none: PrincipalFilter +} + +""" +A filter to be used against `Principal` object types. All fields are combined with a logical ‘and.’ +""" +input PrincipalFilter { + """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 `ownerId` field.""" + ownerId: UUIDFilter + + """Filter by the object’s `userId` field.""" + userId: UUIDFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `allowedMask` field.""" + allowedMask: BitStringFilter + + """Filter by the object’s `isReadOnly` field.""" + isReadOnly: BooleanFilter + + """Filter by the object’s `bypassStepUp` field.""" + bypassStepUp: BooleanFilter + + """Checks for all expressions in this list.""" + and: [PrincipalFilter!] + + """Checks for any expressions in this list.""" + or: [PrincipalFilter!] + + """Negates the expression.""" + not: PrincipalFilter + + """Filter by the object’s `owner` relation.""" + owner: UserFilter + + """Filter by the object’s `user` relation.""" + user: UserFilter + + """Filter by the object’s `principalEntities` relation.""" + principalEntities: PrincipalToManyPrincipalEntityFilter + + """`principalEntities` exist.""" + principalEntitiesExist: Boolean + + """Filter by the object’s `principalScopeOverrides` relation.""" + principalScopeOverrides: PrincipalToManyPrincipalScopeOverrideFilter + + """`principalScopeOverrides` exist.""" + principalScopeOverridesExist: Boolean +} + +""" +A filter to be used against BitString fields. All fields are combined with a logical ‘and.’ +""" +input BitStringFilter { """ Is null (if `true` is specified) or is not null (if `false` is specified). """ isNull: Boolean """Equal to the specified value.""" - equalTo: Datetime + equalTo: BitString """Not equal to the specified value.""" - notEqualTo: Datetime + notEqualTo: BitString """ Not equal to the specified value, treating null like an ordinary value. """ - distinctFrom: Datetime + distinctFrom: BitString """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: Datetime + notDistinctFrom: BitString """Included in the specified list.""" - in: [Datetime!] + in: [BitString!] """Not included in the specified list.""" - notIn: [Datetime!] + notIn: [BitString!] """Less than the specified value.""" - lessThan: Datetime + lessThan: BitString """Less than or equal to the specified value.""" - lessThanOrEqualTo: Datetime + lessThanOrEqualTo: BitString """Greater than the specified value.""" - greaterThan: Datetime + greaterThan: BitString """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: Datetime + greaterThanOrEqualTo: BitString } """ -A filter to be used against `User` object types. All fields are combined with a logical ‘and.’ +A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ """ -input UserFilter { - """Filter by the object’s `id` field.""" - id: UUIDFilter - - """Filter by the object’s `username` field.""" - username: StringTrgmFilter +input BooleanFilter { + """ + Is null (if `true` is specified) or is not null (if `false` is specified). + """ + isNull: Boolean - """Filter by the object’s `displayName` field.""" - displayName: StringTrgmFilter + """Equal to the specified value.""" + equalTo: Boolean - """Filter by the object’s `profilePicture` field.""" - profilePicture: ConstructiveInternalTypeImageFilter + """Not equal to the specified value.""" + notEqualTo: Boolean - """Filter by the object’s `searchTsv` field.""" - searchTsv: FullTextFilter + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Boolean - """Filter by the object’s `type` field.""" - type: IntFilter + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Boolean - """Filter by the object’s `createdAt` field.""" - createdAt: DatetimeFilter + """Included in the specified list.""" + in: [Boolean!] - """Filter by the object’s `updatedAt` field.""" - updatedAt: DatetimeFilter + """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 many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ +""" +input PrincipalToManyPrincipalEntityFilter { + """Filters to entities where at least one related entity matches.""" + some: PrincipalEntityFilter + + """Filters to entities where every related entity matches.""" + every: PrincipalEntityFilter + + """Filters to entities where no related entity matches.""" + none: PrincipalEntityFilter +} + +""" +A filter to be used against many `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ +""" +input PrincipalToManyPrincipalScopeOverrideFilter { + """Filters to entities where at least one related entity matches.""" + some: PrincipalScopeOverrideFilter + + """Filters to entities where every related entity matches.""" + every: PrincipalScopeOverrideFilter + + """Filters to entities where no related entity matches.""" + none: PrincipalScopeOverrideFilter +} + +""" +A filter to be used against `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ +""" +input PrincipalScopeOverrideFilter { + """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 `principalId` field.""" + principalId: UUIDFilter + + """Filter by the object’s `membershipType` field.""" + membershipType: IntFilter + + """Filter by the object’s `allowedMask` field.""" + allowedMask: BitStringFilter + + """Filter by the object’s `isAdmin` field.""" + isAdmin: BooleanFilter + + """Filter by the object’s `isReadOnly` field.""" + isReadOnly: BooleanFilter """Checks for all expressions in this list.""" - and: [UserFilter!] + and: [PrincipalScopeOverrideFilter!] """Checks for any expressions in this list.""" - or: [UserFilter!] + or: [PrincipalScopeOverrideFilter!] """Negates the expression.""" - not: UserFilter + not: PrincipalScopeOverrideFilter - """Filter by the object’s `roleType` relation.""" - roleType: RoleTypeFilter + """Filter by the object’s `principal` relation.""" + principal: PrincipalFilter +} - """Filter by the object’s `ownedEmails` relation.""" - ownedEmails: UserToManyEmailFilter +""" +A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ +""" +input UserToManyPrincipalEntityFilter { + """Filters to entities where at least one related entity matches.""" + some: PrincipalEntityFilter - """`ownedEmails` exist.""" - ownedEmailsExist: Boolean + """Filters to entities where every related entity matches.""" + every: PrincipalEntityFilter - """Filter by the object’s `ownedPhoneNumbers` relation.""" - ownedPhoneNumbers: UserToManyPhoneNumberFilter + """Filters to entities where no related entity matches.""" + none: PrincipalEntityFilter +} - """`ownedPhoneNumbers` exist.""" - ownedPhoneNumbersExist: Boolean +""" +A filter to be used against many `Email` object types. All fields are combined with a logical ‘and.’ +""" +input UserToManyEmailFilter { + """Filters to entities where at least one related entity matches.""" + some: EmailFilter - """Filter by the object’s `ownedCryptoAddresses` relation.""" - ownedCryptoAddresses: UserToManyCryptoAddressFilter + """Filters to entities where every related entity matches.""" + every: EmailFilter - """`ownedCryptoAddresses` exist.""" - ownedCryptoAddressesExist: Boolean + """Filters to entities where no related entity matches.""" + none: EmailFilter +} - """Filter by the object’s `ownedWebauthnCredentials` relation.""" - ownedWebauthnCredentials: UserToManyWebauthnCredentialFilter +""" +A filter to be used against `Email` object types. All fields are combined with a logical ‘and.’ +""" +input EmailFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter - """`ownedWebauthnCredentials` exist.""" - ownedWebauthnCredentialsExist: Boolean + """Filter by the object’s `ownerId` field.""" + ownerId: UUIDFilter - """Filter by the object’s `auditLogAuthsByActorId` relation.""" - auditLogAuthsByActorId: UserToManyAuditLogAuthFilter + """Filter by the object’s `email` field.""" + email: ConstructiveInternalTypeEmailFilter - """`auditLogAuthsByActorId` exist.""" - auditLogAuthsByActorIdExist: Boolean + """Filter by the object’s `isVerified` field.""" + isVerified: BooleanFilter - """TSV search on the `search_tsv` column.""" - tsvSearchTsv: String + """Filter by the object’s `isPrimary` field.""" + isPrimary: BooleanFilter - """TRGM search on the `display_name` column.""" - trgmDisplayName: TrgmSearchInput + """Filter by the object’s `name` field.""" + name: StringFilter - """ - Composite unified search. Provide a search string and it will be dispatched to - all text-compatible search algorithms (tsvector, BM25, pg_trgm) - 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 + """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: [EmailFilter!] + + """Checks for any expressions in this list.""" + or: [EmailFilter!] + + """Negates the expression.""" + not: EmailFilter + + """Filter by the object’s `owner` relation.""" + owner: UserFilter } """ -A filter to be used against String fields with pg_trgm support. All fields are combined with a logical ‘and.’ +A filter to be used against ConstructiveInternalTypeEmail fields. All fields are combined with a logical ‘and.’ """ -input StringTrgmFilter { +input ConstructiveInternalTypeEmailFilter { """ Is null (if `true` is specified) or is not null (if `false` is specified). """ @@ -1108,10 +1876,10 @@ input StringTrgmFilter { notIncludes: String """Contains the specified string (case-insensitive).""" - includesInsensitive: String + includesInsensitive: ConstructiveInternalTypeEmail """Does not contain the specified string (case-insensitive).""" - notIncludesInsensitive: String + notIncludesInsensitive: ConstructiveInternalTypeEmail """Starts with the specified string (case-sensitive).""" startsWith: String @@ -1120,10 +1888,10 @@ input StringTrgmFilter { notStartsWith: String """Starts with the specified string (case-insensitive).""" - startsWithInsensitive: String + startsWithInsensitive: ConstructiveInternalTypeEmail """Does not start with the specified string (case-insensitive).""" - notStartsWithInsensitive: String + notStartsWithInsensitive: ConstructiveInternalTypeEmail """Ends with the specified string (case-sensitive).""" endsWith: String @@ -1132,10 +1900,10 @@ input StringTrgmFilter { notEndsWith: String """Ends with the specified string (case-insensitive).""" - endsWithInsensitive: String + endsWithInsensitive: ConstructiveInternalTypeEmail """Does not end with the specified string (case-insensitive).""" - notEndsWithInsensitive: String + notEndsWithInsensitive: ConstructiveInternalTypeEmail """ Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. @@ -1150,237 +1918,50 @@ input StringTrgmFilter { """ 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 + likeInsensitive: ConstructiveInternalTypeEmail """ 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 + notLikeInsensitive: ConstructiveInternalTypeEmail """Equal to the specified value (case-insensitive).""" - equalToInsensitive: String + equalToInsensitive: ConstructiveInternalTypeEmail """Not equal to the specified value (case-insensitive).""" - notEqualToInsensitive: String + notEqualToInsensitive: ConstructiveInternalTypeEmail """ Not equal to the specified value, treating null like an ordinary value (case-insensitive). """ - distinctFromInsensitive: String + distinctFromInsensitive: ConstructiveInternalTypeEmail """ 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 - - """ - Fuzzy matches using pg_trgm trigram similarity. Tolerates typos and misspellings. - """ - similarTo: TrgmSearchInput - - """ - Fuzzy matches using pg_trgm word_similarity. Finds the best matching substring within the column value. - """ - wordSimilarTo: TrgmSearchInput -} - -""" -Input for pg_trgm fuzzy text matching. Provide a search value and optional similarity threshold. -""" -input TrgmSearchInput { - """The text to fuzzy-match against. Typos and misspellings are tolerated.""" - value: String! - - """ - Minimum similarity threshold (0.0 to 1.0). Higher = stricter matching. Default is 0.3. - """ - threshold: Float -} - -""" -A filter to be used against ConstructiveInternalTypeImage fields. All fields are combined with a logical ‘and.’ -""" -input ConstructiveInternalTypeImageFilter { - """ - Is null (if `true` is specified) or is not null (if `false` is specified). - """ - isNull: Boolean - - """Equal to the specified value.""" - equalTo: ConstructiveInternalTypeImage - - """Not equal to the specified value.""" - notEqualTo: ConstructiveInternalTypeImage - - """ - Not equal to the specified value, treating null like an ordinary value. - """ - distinctFrom: ConstructiveInternalTypeImage - - """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: ConstructiveInternalTypeImage - - """Included in the specified list.""" - in: [ConstructiveInternalTypeImage!] - - """Not included in the specified list.""" - notIn: [ConstructiveInternalTypeImage!] - - """Less than the specified value.""" - lessThan: ConstructiveInternalTypeImage - - """Less than or equal to the specified value.""" - lessThanOrEqualTo: ConstructiveInternalTypeImage - - """Greater than the specified value.""" - greaterThan: ConstructiveInternalTypeImage - - """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: ConstructiveInternalTypeImage - - """Contains the specified JSON.""" - contains: ConstructiveInternalTypeImage - - """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: ConstructiveInternalTypeImage -} - -""" -A filter to be used against FullText fields. All fields are combined with a logical ‘and.’ -""" -input FullTextFilter { - """ - Is null (if `true` is specified) or is not null (if `false` is specified). - """ - isNull: Boolean - - """Equal to the specified value.""" - equalTo: FullText - - """Not equal to the specified value.""" - notEqualTo: FullText - - """ - Not equal to the specified value, treating null like an ordinary value. - """ - distinctFrom: FullText - - """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: FullText - - """Included in the specified list.""" - in: [FullText!] - - """Not included in the specified list.""" - notIn: [FullText!] - - """Performs a full text search on the field.""" - matches: String -} - -""" -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 `RoleType` object types. All fields are combined with a logical ‘and.’ -""" -input RoleTypeFilter { - """Filter by the object’s `id` field.""" - id: IntFilter - - """Filter by the object’s `name` field.""" - name: StringFilter + notDistinctFromInsensitive: ConstructiveInternalTypeEmail - """Checks for all expressions in this list.""" - and: [RoleTypeFilter!] + """Included in the specified list (case-insensitive).""" + inInsensitive: [ConstructiveInternalTypeEmail!] - """Checks for any expressions in this list.""" - or: [RoleTypeFilter!] + """Not included in the specified list (case-insensitive).""" + notInInsensitive: [ConstructiveInternalTypeEmail!] - """Negates the expression.""" - not: RoleTypeFilter -} + """Less than the specified value (case-insensitive).""" + lessThanInsensitive: ConstructiveInternalTypeEmail -""" -A filter to be used against many `Email` object types. All fields are combined with a logical ‘and.’ -""" -input UserToManyEmailFilter { - """Filters to entities where at least one related entity matches.""" - some: EmailFilter + """Less than or equal to the specified value (case-insensitive).""" + lessThanOrEqualToInsensitive: ConstructiveInternalTypeEmail - """Filters to entities where every related entity matches.""" - every: EmailFilter + """Greater than the specified value (case-insensitive).""" + greaterThanInsensitive: ConstructiveInternalTypeEmail - """Filters to entities where no related entity matches.""" - none: EmailFilter + """Greater than or equal to the specified value (case-insensitive).""" + greaterThanOrEqualToInsensitive: ConstructiveInternalTypeEmail } +scalar ConstructiveInternalTypeEmail + """ A filter to be used against many `PhoneNumber` object types. All fields are combined with a logical ‘and.’ """ @@ -1961,6 +2542,192 @@ input InternetAddressFilter { containsOrContainedBy: InternetAddress } +"""Methods to use when ordering `PrincipalEntity`.""" +enum PrincipalEntityOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + PRINCIPAL_ID_ASC + PRINCIPAL_ID_DESC + ENTITY_ID_ASC + ENTITY_ID_DESC + OWNER_ID_ASC + OWNER_ID_DESC +} + +"""A connection to a list of `PrincipalScopeOverride` values.""" +type PrincipalScopeOverrideConnection { + """A list of `PrincipalScopeOverride` objects.""" + nodes: [PrincipalScopeOverride]! + + """ + A list of edges which contains the `PrincipalScopeOverride` and cursor to aid in pagination. + """ + edges: [PrincipalScopeOverrideEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `PrincipalScopeOverride` you could get from the connection. + """ + totalCount: Int! +} + +""" +Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. +""" +type PrincipalScopeOverride { + id: UUID! + createdAt: Datetime + updatedAt: Datetime + + """The principal this override applies to""" + principalId: UUID! + + """The scope level (membership_type) this override restricts""" + membershipType: Int! + + """ + Permission bitmask for this scope; AND-masked with parent permissions during cascade + """ + allowedMask: BitString! + + """ + Whether this principal has admin access at this scope (default true = inherit from parent) + """ + isAdmin: Boolean! + + """Whether this principal is restricted to read-only at this scope""" + isReadOnly: Boolean! + + """ + Reads a single `Principal` that is related to this `PrincipalScopeOverride`. + """ + principal: Principal +} + +"""A `PrincipalScopeOverride` edge in the connection.""" +type PrincipalScopeOverrideEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `PrincipalScopeOverride` at the end of the edge.""" + node: PrincipalScopeOverride +} + +"""Methods to use when ordering `PrincipalScopeOverride`.""" +enum PrincipalScopeOverrideOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + PRINCIPAL_ID_ASC + PRINCIPAL_ID_DESC + MEMBERSHIP_TYPE_ASC + MEMBERSHIP_TYPE_DESC + ALLOWED_MASK_ASC + ALLOWED_MASK_DESC + IS_ADMIN_ASC + IS_ADMIN_DESC + IS_READ_ONLY_ASC + IS_READ_ONLY_DESC +} + +"""A `Principal` edge in the connection.""" +type PrincipalEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `Principal` at the end of the edge.""" + node: Principal +} + +"""Methods to use when ordering `Principal`.""" +enum PrincipalOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + OWNER_ID_ASC + OWNER_ID_DESC + USER_ID_ASC + USER_ID_DESC + NAME_ASC + NAME_DESC + ALLOWED_MASK_ASC + ALLOWED_MASK_DESC + IS_READ_ONLY_ASC + IS_READ_ONLY_DESC + BYPASS_STEP_UP_ASC + BYPASS_STEP_UP_DESC +} + +"""A connection to a list of `Email` values.""" +type EmailConnection { + """A list of `Email` objects.""" + nodes: [Email]! + + """ + A list of edges which contains the `Email` and cursor to aid in pagination. + """ + edges: [EmailEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `Email` you could get from the connection.""" + totalCount: Int! +} + +"""User email addresses with verification and primary-email management""" +type Email { + id: UUID! + ownerId: UUID! + + """The email address""" + email: ConstructiveInternalTypeEmail! + + """Whether the email address has been verified via confirmation link""" + isVerified: Boolean! + + """Whether this is the user's primary email address""" + isPrimary: Boolean! + + """Optional user-provided label for this email (e.g. "Work", "Personal").""" + name: String + createdAt: Datetime + updatedAt: Datetime + + """Reads a single `User` that is related to this `Email`.""" + owner: User +} + +"""A `Email` edge in the connection.""" +type EmailEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `Email` at the end of the edge.""" + node: Email +} + """Methods to use when ordering `Email`.""" enum EmailOrderBy { NATURAL @@ -2626,6 +3393,126 @@ enum UserConnectedAccountOrderBy { UPDATED_AT_DESC } +"""A connection to a list of `OrgApiKeyList` values.""" +type OrgApiKeyListConnection { + """A list of `OrgApiKeyList` objects.""" + nodes: [OrgApiKeyList]! + + """ + A list of edges which contains the `OrgApiKeyList` and cursor to aid in pagination. + """ + edges: [OrgApiKeyListEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `OrgApiKeyList` you could get from the connection.""" + totalCount: Int! +} + +type OrgApiKeyList { + id: UUID + keyId: String + name: String + principalId: UUID + orgId: UUID + expiresAt: Datetime + revokedAt: Datetime + lastUsedAt: Datetime + mfaLevel: String + accessLevel: String + createdAt: Datetime + updatedAt: Datetime +} + +"""A `OrgApiKeyList` edge in the connection.""" +type OrgApiKeyListEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `OrgApiKeyList` at the end of the edge.""" + node: OrgApiKeyList +} + +""" +A filter to be used against `OrgApiKeyList` object types. All fields are combined with a logical ‘and.’ +""" +input OrgApiKeyListFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter + + """Filter by the object’s `keyId` field.""" + keyId: StringFilter + + """Filter by the object’s `name` field.""" + name: StringFilter + + """Filter by the object’s `principalId` field.""" + principalId: UUIDFilter + + """Filter by the object’s `orgId` field.""" + orgId: UUIDFilter + + """Filter by the object’s `expiresAt` field.""" + expiresAt: DatetimeFilter + + """Filter by the object’s `revokedAt` field.""" + revokedAt: DatetimeFilter + + """Filter by the object’s `lastUsedAt` field.""" + lastUsedAt: DatetimeFilter + + """Filter by the object’s `mfaLevel` field.""" + mfaLevel: StringFilter + + """Filter by the object’s `accessLevel` field.""" + accessLevel: StringFilter + + """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: [OrgApiKeyListFilter!] + + """Checks for any expressions in this list.""" + or: [OrgApiKeyListFilter!] + + """Negates the expression.""" + not: OrgApiKeyListFilter +} + +"""Methods to use when ordering `OrgApiKeyList`.""" +enum OrgApiKeyListOrderBy { + NATURAL + ID_ASC + ID_DESC + KEY_ID_ASC + KEY_ID_DESC + NAME_ASC + NAME_DESC + PRINCIPAL_ID_ASC + PRINCIPAL_ID_DESC + ORG_ID_ASC + ORG_ID_DESC + EXPIRES_AT_ASC + EXPIRES_AT_DESC + REVOKED_AT_ASC + REVOKED_AT_DESC + LAST_USED_AT_ASC + LAST_USED_AT_DESC + MFA_LEVEL_ASC + MFA_LEVEL_DESC + ACCESS_LEVEL_ASC + ACCESS_LEVEL_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC +} + """A connection to a list of `User` values.""" type UserConnection { """A list of `User` objects.""" @@ -2949,6 +3836,18 @@ type Mutation { """ input: CheckPasswordInput! ): CheckPasswordPayload + deleteOrgPrincipal( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteOrgPrincipalInput! + ): DeleteOrgPrincipalPayload + deletePrincipal( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeletePrincipalInput! + ): DeletePrincipalPayload disconnectAccount( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -2985,6 +3884,12 @@ type Mutation { """ input: ConfirmDeleteAccountInput! ): ConfirmDeleteAccountPayload + revokeOrgApiKey( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: RevokeOrgApiKeyInput! + ): RevokeOrgApiKeyPayload setPassword( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -3045,12 +3950,24 @@ type Mutation { """ input: LinkIdentityInput! ): LinkIdentityPayload + createOrgPrincipal( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateOrgPrincipalInput! + ): CreateOrgPrincipalPayload extendTokenExpires( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. """ input: ExtendTokenExpiresInput! ): ExtendTokenExpiresPayload + createOrgApiKey( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateOrgApiKeyInput! + ): CreateOrgApiKeyPayload createApiKey( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -3063,6 +3980,12 @@ type Mutation { """ input: RequestCrossOriginTokenInput! ): RequestCrossOriginTokenPayload + createPrincipal( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreatePrincipalInput! + ): CreatePrincipalPayload forgotPassword( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -3092,6 +4015,14 @@ type Mutation { input: CreateRoleTypeInput! ): CreateRoleTypePayload + """Creates a single `PrincipalEntity`.""" + createPrincipalEntity( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreatePrincipalEntityInput! + ): CreatePrincipalEntityPayload + """Creates a single `UserConnectedAccount`.""" createUserConnectedAccount( """ @@ -3124,6 +4055,14 @@ type Mutation { input: CreateAuditLogAuthInput! ): CreateAuditLogAuthPayload + """Creates a single `OrgApiKeyList`.""" + createOrgApiKeyList( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateOrgApiKeyListInput! + ): CreateOrgApiKeyListPayload + """Creates a single `Email`.""" createEmail( """ @@ -3156,6 +4095,14 @@ type Mutation { input: UpdateRoleTypeInput! ): UpdateRoleTypePayload + """Updates a single `PrincipalEntity` using a unique key and a patch.""" + updatePrincipalEntity( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdatePrincipalEntityInput! + ): UpdatePrincipalEntityPayload + """Updates a single `CryptoAddress` using a unique key and a patch.""" updateCryptoAddress( """ @@ -3212,6 +4159,14 @@ type Mutation { input: DeleteRoleTypeInput! ): DeleteRoleTypePayload + """Deletes a single `PrincipalEntity` using a unique key.""" + deletePrincipalEntity( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeletePrincipalEntityInput! + ): DeletePrincipalEntityPayload + """Deletes a single `CryptoAddress` using a unique key.""" deleteCryptoAddress( """ @@ -3345,6 +4300,56 @@ input CheckPasswordInput { password: String } +"""The output of our `deleteOrgPrincipal` mutation.""" +type DeleteOrgPrincipalPayload { + """ + 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 `deleteOrgPrincipal` mutation.""" +input DeleteOrgPrincipalInput { + """ + 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 + principalId: UUID +} + +"""The output of our `deletePrincipal` mutation.""" +type DeletePrincipalPayload { + """ + 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 `deletePrincipal` mutation.""" +input DeletePrincipalInput { + """ + 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 + principalId: UUID +} + """The output of our `disconnectAccount` mutation.""" type DisconnectAccountPayload { """ @@ -3496,6 +4501,32 @@ input ConfirmDeleteAccountInput { token: String } +"""The output of our `revokeOrgApiKey` mutation.""" +type RevokeOrgApiKeyPayload { + """ + 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 `revokeOrgApiKey` mutation.""" +input RevokeOrgApiKeyInput { + """ + 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 + keyId: UUID! + orgId: UUID! +} + """The output of our `setPassword` mutation.""" type SetPasswordPayload { """ @@ -3813,6 +4844,35 @@ input LinkIdentityInput { details: JSON } +"""The output of our `createOrgPrincipal` mutation.""" +type CreateOrgPrincipalPayload { + """ + 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 `createOrgPrincipal` mutation.""" +input CreateOrgPrincipalInput { + """ + 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 + name: String + orgId: UUID + allowedMask: BitString + isReadOnly: Boolean + bypassStepUp: Boolean +} + """The output of our `extendTokenExpires` mutation.""" type ExtendTokenExpiresPayload { """ @@ -3871,6 +4931,42 @@ input IntervalInput { years: Int } +"""The output of our `createOrgApiKey` mutation.""" +type CreateOrgApiKeyPayload { + """ + 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: CreateOrgApiKeyRecord + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +type CreateOrgApiKeyRecord { + apiKey: String + keyId: UUID + expiresAt: Datetime +} + +"""All input for the `createOrgApiKey` mutation.""" +input CreateOrgApiKeyInput { + """ + 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 + orgId: UUID + principalId: UUID + keyName: String + accessLevel: String + mfaLevel: String + expiresIn: IntervalInput +} + """The output of our `createApiKey` mutation.""" type CreateApiKeyPayload { """ @@ -3903,6 +4999,7 @@ input CreateApiKeyInput { accessLevel: String mfaLevel: String expiresIn: IntervalInput + principalId: UUID } """The output of our `requestCrossOriginToken` mutation.""" @@ -3933,6 +5030,35 @@ input RequestCrossOriginTokenInput { rememberMe: Boolean } +"""The output of our `createPrincipal` mutation.""" +type CreatePrincipalPayload { + """ + 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 `createPrincipal` mutation.""" +input CreatePrincipalInput { + """ + 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 + name: String + allowedMask: BitString + entityIds: [UUID] + isReadOnly: Boolean + bypassStepUp: Boolean +} + """The output of our `forgotPassword` mutation.""" type ForgotPasswordPayload { """ @@ -4061,6 +5187,57 @@ input RoleTypeInput { name: String! } +"""The output of our create `PrincipalEntity` mutation.""" +type CreatePrincipalEntityPayload { + """ + 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 `PrincipalEntity` that was created by this mutation.""" + principalEntity: PrincipalEntity + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PrincipalEntity`. May be used by Relay 1.""" + principalEntityEdge( + """The method to use when ordering `PrincipalEntity`.""" + orderBy: [PrincipalEntityOrderBy!]! = [PRIMARY_KEY_ASC] + ): PrincipalEntityEdge +} + +"""All input for the create `PrincipalEntity` mutation.""" +input CreatePrincipalEntityInput { + """ + 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 `PrincipalEntity` to be created by this mutation.""" + principalEntity: PrincipalEntityInput! +} + +"""An input for mutations affecting `PrincipalEntity`""" +input PrincipalEntityInput { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """The principal this scoping row belongs to""" + principalId: UUID! + + """The organization this principal is scoped to""" + entityId: UUID! + + """Denormalized owner_id from principals table for RLS""" + ownerId: UUID! +} + """The output of our create `UserConnectedAccount` mutation.""" type CreateUserConnectedAccountPayload { """ @@ -4286,6 +5463,51 @@ input AuditLogAuthInput { success: Boolean! } +"""The output of our create `OrgApiKeyList` mutation.""" +type CreateOrgApiKeyListPayload { + """ + 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 `OrgApiKeyList` that was created by this mutation.""" + orgApiKeyList: OrgApiKeyList + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} + +"""All input for the create `OrgApiKeyList` mutation.""" +input CreateOrgApiKeyListInput { + """ + 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 `OrgApiKeyList` to be created by this mutation.""" + orgApiKeyList: OrgApiKeyListInput! +} + +"""An input for mutations affecting `OrgApiKeyList`""" +input OrgApiKeyListInput { + id: UUID + keyId: String + name: String + principalId: UUID + orgId: UUID + expiresAt: Datetime + revokedAt: Datetime + lastUsedAt: Datetime + mfaLevel: String + accessLevel: String + createdAt: Datetime + updatedAt: Datetime +} + """The output of our create `Email` mutation.""" type CreateEmailPayload { """ @@ -4522,6 +5744,62 @@ input RoleTypePatch { name: String } +"""The output of our update `PrincipalEntity` mutation.""" +type UpdatePrincipalEntityPayload { + """ + 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 `PrincipalEntity` that was updated by this mutation.""" + principalEntity: PrincipalEntity + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PrincipalEntity`. May be used by Relay 1.""" + principalEntityEdge( + """The method to use when ordering `PrincipalEntity`.""" + orderBy: [PrincipalEntityOrderBy!]! = [PRIMARY_KEY_ASC] + ): PrincipalEntityEdge +} + +"""All input for the `updatePrincipalEntity` mutation.""" +input UpdatePrincipalEntityInput { + """ + 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 `PrincipalEntity` being updated. + """ + principalEntityPatch: PrincipalEntityPatch! +} + +""" +Represents an update to a `PrincipalEntity`. Fields that are set will be updated. +""" +input PrincipalEntityPatch { + id: UUID + createdAt: Datetime + updatedAt: Datetime + + """The principal this scoping row belongs to""" + principalId: UUID + + """The organization this principal is scoped to""" + entityId: UUID + + """Denormalized owner_id from principals table for RLS""" + ownerId: UUID +} + """The output of our update `CryptoAddress` mutation.""" type UpdateCryptoAddressPayload { """ @@ -4968,6 +6246,39 @@ input DeleteRoleTypeInput { id: Int! } +"""The output of our delete `PrincipalEntity` mutation.""" +type DeletePrincipalEntityPayload { + """ + 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 `PrincipalEntity` that was deleted by this mutation.""" + principalEntity: PrincipalEntity + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PrincipalEntity`. May be used by Relay 1.""" + principalEntityEdge( + """The method to use when ordering `PrincipalEntity`.""" + orderBy: [PrincipalEntityOrderBy!]! = [PRIMARY_KEY_ASC] + ): PrincipalEntityEdge +} + +"""All input for the `deletePrincipalEntity` mutation.""" +input DeletePrincipalEntityInput { + """ + 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 `CryptoAddress` mutation.""" type DeleteCryptoAddressPayload { """ diff --git a/sdk/constructive-sdk/schemas/compute.graphql b/sdk/constructive-sdk/schemas/compute.graphql index fc805077ac..594be85f63 100644 --- a/sdk/constructive-sdk/schemas/compute.graphql +++ b/sdk/constructive-sdk/schemas/compute.graphql @@ -317,10 +317,8 @@ type Query { orderBy: [FunctionExecutionLogOrderBy!] = [PRIMARY_KEY_ASC] ): FunctionExecutionLogConnection - """ - Reads and enables pagination through a set of `FunctionGraphExecutionNodeState`. - """ - functionGraphExecutionNodeStates( + """Reads and enables pagination through a set of `FunctionGraph`.""" + functionGraphs( """Only read the first `n` values of the set.""" first: Int @@ -342,14 +340,16 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: FunctionGraphExecutionNodeStateFilter + where: FunctionGraphFilter - """The method to use when ordering `FunctionGraphExecutionNodeState`.""" - orderBy: [FunctionGraphExecutionNodeStateOrderBy!] = [PRIMARY_KEY_ASC] - ): FunctionGraphExecutionNodeStateConnection + """The method to use when ordering `FunctionGraph`.""" + orderBy: [FunctionGraphOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphConnection - """Reads and enables pagination through a set of `FunctionGraph`.""" - functionGraphs( + """ + Reads and enables pagination through a set of `FunctionGraphExecutionNodeState`. + """ + functionGraphExecutionNodeStates( """Only read the first `n` values of the set.""" first: Int @@ -371,11 +371,11 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: FunctionGraphFilter + where: FunctionGraphExecutionNodeStateFilter - """The method to use when ordering `FunctionGraph`.""" - orderBy: [FunctionGraphOrderBy!] = [PRIMARY_KEY_ASC] - ): FunctionGraphConnection + """The method to use when ordering `FunctionGraphExecutionNodeState`.""" + orderBy: [FunctionGraphExecutionNodeStateOrderBy!] = [PRIMARY_KEY_ASC] + ): FunctionGraphExecutionNodeStateConnection """Reads and enables pagination through a set of `OrgFunctionInvocation`.""" orgFunctionInvocations( @@ -2752,6 +2752,154 @@ enum FunctionExecutionLogOrderBy { DATABASE_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! + + """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 `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 + 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 `FunctionGraphExecutionNodeState` values.""" type FunctionGraphExecutionNodeStateConnection { """A list of `FunctionGraphExecutionNodeState` objects.""" @@ -2904,162 +3052,6 @@ enum FunctionGraphExecutionNodeStateOrderBy { 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.""" @@ -3489,9 +3481,6 @@ type FunctionGraphExecution { """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! @@ -3582,9 +3571,6 @@ input FunctionGraphExecutionFilter { """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 @@ -3667,8 +3653,6 @@ enum FunctionGraphExecutionOrderBy { INVOCATION_ID_DESC DATABASE_ID_ASC DATABASE_ID_DESC - ENTITY_ID_ASC - ENTITY_ID_DESC OUTPUT_NODE_ASC OUTPUT_NODE_DESC OUTPUT_PORT_ASC @@ -4104,6 +4088,12 @@ type Mutation { """ input: CreateFunctionGraphInput! ): CreateFunctionGraphPayload + importGraphJson( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: ImportGraphJsonInput! + ): ImportGraphJsonPayload addEdge( """ The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. @@ -4116,12 +4106,6 @@ type Mutation { """ 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. @@ -4351,6 +4335,14 @@ type Mutation { input: UpdateFunctionExecutionLogInput! ): UpdateFunctionExecutionLogPayload + """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 `FunctionGraphExecutionNodeState` using a unique key and a patch. """ @@ -4361,14 +4353,6 @@ type Mutation { 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. """ @@ -4493,14 +4477,6 @@ type Mutation { 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( """ @@ -4509,6 +4485,14 @@ type Mutation { input: DeleteFunctionGraphInput! ): DeleteFunctionGraphPayload + """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 `OrgFunctionInvocation` using a unique key.""" deleteOrgFunctionInvocation( """ @@ -4808,13 +4792,12 @@ input CreateFunctionGraphInput { name: String context: String description: String - entityId: UUID createdBy: UUID definitionsCommitId: UUID } -"""The output of our `addEdge` mutation.""" -type AddEdgePayload { +"""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. @@ -4828,25 +4811,24 @@ type AddEdgePayload { query: Query } -"""All input for the `addEdge` mutation.""" -input AddEdgeInput { +"""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 - rootHash: UUID - srcNode: String - srcPort: String - dstNode: String - dstPort: String + name: String + graphJson: JSON context: String - graphName: String + description: String + createdBy: UUID + definitionsCommitId: UUID } -"""The output of our `addNode` mutation.""" -type AddNodePayload { +"""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. @@ -4860,8 +4842,8 @@ type AddNodePayload { query: Query } -"""All input for the `addNode` mutation.""" -input AddNodeInput { +"""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. @@ -4869,16 +4851,16 @@ input AddNodeInput { clientMutationId: String databaseId: UUID rootHash: UUID - nodeName: String - nodeType: String + srcNode: String + srcPort: String + dstNode: String + dstPort: String context: String graphName: String - props: JSON - meta: JSON } -"""The output of our `importGraphJson` mutation.""" -type ImportGraphJsonPayload { +"""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. @@ -4892,21 +4874,21 @@ type ImportGraphJsonPayload { query: Query } -"""All input for the `importGraphJson` mutation.""" -input ImportGraphJsonInput { +"""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 - name: String - graphJson: JSON + rootHash: UUID + nodeName: String + nodeType: String context: String - description: String - entityId: UUID - createdBy: UUID - definitionsCommitId: UUID + graphName: String + props: JSON + meta: JSON } """The output of our `insertNodeAtPath` mutation.""" @@ -5991,9 +5973,6 @@ input FunctionGraphExecutionInput { """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! @@ -6879,6 +6858,87 @@ input FunctionExecutionLogPatch { databaseId: 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 + + """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 `FunctionGraphExecutionNodeState` mutation.""" type UpdateFunctionGraphExecutionNodeStatePayload { """ @@ -6969,90 +7029,6 @@ input FunctionGraphExecutionNodeStatePatch { 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 { """ @@ -7413,9 +7389,6 @@ input FunctionGraphExecutionPatch { """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 @@ -7995,80 +7968,80 @@ input DeleteFunctionExecutionLogInput { id: UUID! } -"""The output of our delete `FunctionGraphExecutionNodeState` mutation.""" -type DeleteFunctionGraphExecutionNodeStatePayload { +"""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 `FunctionGraphExecutionNodeState` that was deleted by this mutation. - """ - functionGraphExecutionNodeState: FunctionGraphExecutionNodeState + """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 `FunctionGraphExecutionNodeState`. May be used by Relay 1. - """ - functionGraphExecutionNodeStateEdge( - """The method to use when ordering `FunctionGraphExecutionNodeState`.""" - orderBy: [FunctionGraphExecutionNodeStateOrderBy!]! = [PRIMARY_KEY_ASC] - ): FunctionGraphExecutionNodeStateEdge + """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 `deleteFunctionGraphExecutionNodeState` mutation.""" -input DeleteFunctionGraphExecutionNodeStateInput { +"""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 - """Timestamp of node state creation (partition key)""" - createdAt: Datetime! - - """Unique node state identifier""" + """Unique graph identifier""" id: UUID! } -"""The output of our delete `FunctionGraph` mutation.""" -type DeleteFunctionGraphPayload { +"""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 `FunctionGraph` that was deleted by this mutation.""" - functionGraph: FunctionGraph + """ + 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 `FunctionGraph`. May be used by Relay 1.""" - functionGraphEdge( - """The method to use when ordering `FunctionGraph`.""" - orderBy: [FunctionGraphOrderBy!]! = [PRIMARY_KEY_ASC] - ): FunctionGraphEdge + """ + 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 `deleteFunctionGraph` mutation.""" -input DeleteFunctionGraphInput { +"""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 - """Unique graph identifier""" + """Timestamp of node state creation (partition key)""" + createdAt: Datetime! + + """Unique node state identifier""" id: UUID! } diff --git a/sdk/constructive-sdk/schemas/modules.graphql b/sdk/constructive-sdk/schemas/modules.graphql index 750d6b37ec..09d1c2f001 100644 --- a/sdk/constructive-sdk/schemas/modules.graphql +++ b/sdk/constructive-sdk/schemas/modules.graphql @@ -747,8 +747,10 @@ type Query { orderBy: [SecureTableProvisionOrderBy!] = [PRIMARY_KEY_ASC] ): SecureTableProvisionConnection - """Reads and enables pagination through a set of `MerkleStoreModule`.""" - merkleStoreModules( + """ + Reads and enables pagination through a set of `DatabaseProvisionModule`. + """ + databaseProvisionModules( """Only read the first `n` values of the set.""" first: Int @@ -770,16 +772,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: MerkleStoreModuleFilter + where: DatabaseProvisionModuleFilter - """The method to use when ordering `MerkleStoreModule`.""" - orderBy: [MerkleStoreModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): MerkleStoreModuleConnection + """The method to use when ordering `DatabaseProvisionModule`.""" + orderBy: [DatabaseProvisionModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): DatabaseProvisionModuleConnection - """ - Reads and enables pagination through a set of `DatabaseProvisionModule`. - """ - databaseProvisionModules( + """Reads and enables pagination through a set of `ConfigSecretsModule`.""" + configSecretsModules( """Only read the first `n` values of the set.""" first: Int @@ -801,14 +801,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: DatabaseProvisionModuleFilter + where: ConfigSecretsModuleFilter - """The method to use when ordering `DatabaseProvisionModule`.""" - orderBy: [DatabaseProvisionModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): DatabaseProvisionModuleConnection + """The method to use when ordering `ConfigSecretsModule`.""" + orderBy: [ConfigSecretsModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): ConfigSecretsModuleConnection - """Reads and enables pagination through a set of `ConfigSecretsModule`.""" - configSecretsModules( + """Reads and enables pagination through a set of `GraphModule`.""" + graphModules( """Only read the first `n` values of the set.""" first: Int @@ -830,14 +830,14 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: ConfigSecretsModuleFilter + where: GraphModuleFilter - """The method to use when ordering `ConfigSecretsModule`.""" - orderBy: [ConfigSecretsModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): ConfigSecretsModuleConnection + """The method to use when ordering `GraphModule`.""" + orderBy: [GraphModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): GraphModuleConnection - """Reads and enables pagination through a set of `GraphModule`.""" - graphModules( + """Reads and enables pagination through a set of `MerkleStoreModule`.""" + merkleStoreModules( """Only read the first `n` values of the set.""" first: Int @@ -859,11 +859,11 @@ type Query { """ A filter to be used in determining which values should be returned by the collection. """ - where: GraphModuleFilter + where: MerkleStoreModuleFilter - """The method to use when ordering `GraphModule`.""" - orderBy: [GraphModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): GraphModuleConnection + """The method to use when ordering `MerkleStoreModule`.""" + orderBy: [MerkleStoreModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): MerkleStoreModuleConnection """Reads and enables pagination through a set of `RateLimitMetersModule`.""" rateLimitMetersModules( @@ -1041,6 +1041,35 @@ type Query { orderBy: [InvitesModuleOrderBy!] = [PRIMARY_KEY_ASC] ): InvitesModuleConnection + """Reads and enables pagination through a set of `PrincipalAuthModule`.""" + principalAuthModules( + """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: PrincipalAuthModuleFilter + + """The method to use when ordering `PrincipalAuthModule`.""" + orderBy: [PrincipalAuthModuleOrderBy!] = [PRIMARY_KEY_ASC] + ): PrincipalAuthModuleConnection + """Reads and enables pagination through a set of `ComputeLogModule`.""" computeLogModules( """Only read the first `n` values of the set.""" @@ -5611,196 +5640,226 @@ enum SecureTableProvisionOrderBy { OUT_FIELDS_DESC } -"""A connection to a list of `MerkleStoreModule` values.""" -type MerkleStoreModuleConnection { - """A list of `MerkleStoreModule` objects.""" - nodes: [MerkleStoreModule]! +"""A connection to a list of `DatabaseProvisionModule` values.""" +type DatabaseProvisionModuleConnection { + """A list of `DatabaseProvisionModule` objects.""" + nodes: [DatabaseProvisionModule]! """ - A list of edges which contains the `MerkleStoreModule` and cursor to aid in pagination. + A list of edges which contains the `DatabaseProvisionModule` and cursor to aid in pagination. """ - edges: [MerkleStoreModuleEdge]! + edges: [DatabaseProvisionModuleEdge]! """Information to aid in pagination.""" pageInfo: PageInfo! """ - The count of *all* `MerkleStoreModule` you could get from the connection. + The count of *all* `DatabaseProvisionModule` you could get from the connection. """ totalCount: Int! } -type MerkleStoreModule { +""" +Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. +""" +type DatabaseProvisionModule { id: UUID! - databaseId: UUID! - schemaId: UUID! - privateSchemaId: UUID! - publicSchemaName: String - privateSchemaName: String - objectTableId: UUID! - storeTableId: UUID! - commitTableId: UUID! - refTableId: UUID! - prefix: String! - apiName: String - privateApiName: String - scope: String! - functionPrefix: String - createdAt: Datetime! - - """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 + """The name for the new database""" + databaseName: String! - """Read all values in the set before (above) this cursor.""" - before: Cursor + """UUID of the user who owns this database""" + ownerId: UUID! - """Read all values in the set after (below) this cursor.""" - after: Cursor + """ + Subdomain prefix for the database. If null, auto-generated using unique_names + random chars + """ + subdomain: String - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: GraphModuleFilter + """Base domain for the database (e.g., example.com)""" + domain: String! - """The method to use when ordering `GraphModule`.""" - orderBy: [GraphModuleOrderBy!] = [PRIMARY_KEY_ASC] - ): GraphModuleConnection! -} + """ + JSONB array of modules to install. Each element is either a string ("users_module") or a [name, options] tuple (["permissions_module", {"scope": "app"}]) + """ + modules: JSON! -"""A connection to a list of `GraphModule` values.""" -type GraphModuleConnection { - """A list of `GraphModule` objects.""" - nodes: [GraphModule]! + """Additional configuration options for provisioning""" + options: JSON! """ - A list of edges which contains the `GraphModule` and cursor to aid in pagination. + When true, copies the owner user and password hash from source database to the newly provisioned database """ - edges: [GraphModuleEdge]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! + bootstrapUser: Boolean! - """The count of *all* `GraphModule` you could get from the connection.""" - totalCount: Int! -} + """Current status: pending, in_progress, completed, or failed""" + status: String! + errorMessage: String -type GraphModule { - 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] + """The ID of the provisioned database (set by trigger before RLS check)""" + databaseId: UUID createdAt: Datetime! - - """ - Reads a single `MerkleStoreModule` that is related to this `GraphModule`. - """ - merkleStoreModule: MerkleStoreModule + updatedAt: Datetime! + completedAt: Datetime } -"""A `GraphModule` edge in the connection.""" -type GraphModuleEdge { +"""A `DatabaseProvisionModule` edge in the connection.""" +type DatabaseProvisionModuleEdge { """A cursor for use in pagination.""" cursor: Cursor - """The `GraphModule` at the end of the edge.""" - node: GraphModule + """The `DatabaseProvisionModule` at the end of the edge.""" + node: DatabaseProvisionModule } """ -A filter to be used against `GraphModule` object types. All fields are combined with a logical ‘and.’ +A filter to be used against `DatabaseProvisionModule` object types. All fields are combined with a logical ‘and.’ """ -input GraphModuleFilter { +input DatabaseProvisionModuleFilter { """Filter by the object’s `id` field.""" id: UUIDFilter - """Filter by the object’s `databaseId` field.""" - databaseId: UUIDFilter - - """Filter by the object’s `publicSchemaId` field.""" - publicSchemaId: UUIDFilter + """Filter by the object’s `databaseName` field.""" + databaseName: StringFilter - """Filter by the object’s `privateSchemaId` field.""" - privateSchemaId: UUIDFilter + """Filter by the object’s `ownerId` field.""" + ownerId: UUIDFilter - """Filter by the object’s `publicSchemaName` field.""" - publicSchemaName: StringFilter + """Filter by the object’s `subdomain` field.""" + subdomain: StringFilter - """Filter by the object’s `privateSchemaName` field.""" - privateSchemaName: StringFilter + """Filter by the object’s `domain` field.""" + domain: StringFilter - """Filter by the object’s `scope` field.""" - scope: StringFilter + """Filter by the object’s `modules` field.""" + modules: JSONFilter - """Filter by the object’s `prefix` field.""" - prefix: StringFilter + """Filter by the object’s `options` field.""" + options: JSONFilter - """Filter by the object’s `merkleStoreModuleId` field.""" - merkleStoreModuleId: UUIDFilter + """Filter by the object’s `bootstrapUser` field.""" + bootstrapUser: BooleanFilter - """Filter by the object’s `graphsTableId` field.""" - graphsTableId: UUIDFilter + """Filter by the object’s `status` field.""" + status: StringFilter - """Filter by the object’s `apiName` field.""" - apiName: StringFilter + """Filter by the object’s `errorMessage` field.""" + errorMessage: StringFilter - """Filter by the object’s `privateApiName` field.""" - privateApiName: StringFilter + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter - """Filter by the object’s `entityTableId` field.""" - entityTableId: UUIDFilter + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter - """Filter by the object’s `policies` field.""" - policies: JSONFilter + """Filter by the object’s `updatedAt` field.""" + updatedAt: DatetimeFilter - """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 + """Filter by the object’s `completedAt` field.""" + completedAt: DatetimeFilter """Checks for all expressions in this list.""" - and: [GraphModuleFilter!] + and: [DatabaseProvisionModuleFilter!] """Checks for any expressions in this list.""" - or: [GraphModuleFilter!] + or: [DatabaseProvisionModuleFilter!] """Negates the expression.""" - not: GraphModuleFilter + not: DatabaseProvisionModuleFilter +} - """Filter by the object’s `merkleStoreModule` relation.""" - merkleStoreModule: MerkleStoreModuleFilter +"""Methods to use when ordering `DatabaseProvisionModule`.""" +enum DatabaseProvisionModuleOrderBy { + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ID_ASC + ID_DESC + DATABASE_NAME_ASC + DATABASE_NAME_DESC + OWNER_ID_ASC + OWNER_ID_DESC + SUBDOMAIN_ASC + SUBDOMAIN_DESC + DOMAIN_ASC + DOMAIN_DESC + MODULES_ASC + MODULES_DESC + OPTIONS_ASC + OPTIONS_DESC + BOOTSTRAP_USER_ASC + BOOTSTRAP_USER_DESC + STATUS_ASC + STATUS_DESC + ERROR_MESSAGE_ASC + ERROR_MESSAGE_DESC + DATABASE_ID_ASC + DATABASE_ID_DESC + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + COMPLETED_AT_ASC + COMPLETED_AT_DESC +} + +"""A connection to a list of `ConfigSecretsModule` values.""" +type ConfigSecretsModuleConnection { + """A list of `ConfigSecretsModule` objects.""" + nodes: [ConfigSecretsModule]! + + """ + A list of edges which contains the `ConfigSecretsModule` and cursor to aid in pagination. + """ + edges: [ConfigSecretsModuleEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `ConfigSecretsModule` you could get from the connection. + """ + totalCount: Int! } """ -A filter to be used against `MerkleStoreModule` object types. All fields are combined with a logical ‘and.’ +Entity-aware PGP-encrypted key-value config/secrets module. Supports app-level (admin-only) + and org-scoped (per-org secrets with manage_secrets permission) via the scope column. + User-scoped bcrypt credentials are handled by user_credentials_module. """ -input MerkleStoreModuleFilter { +type ConfigSecretsModule { + id: UUID! + databaseId: UUID! + schemaId: UUID! + privateSchemaId: UUID! + publicSchemaName: String + privateSchemaName: String + tableId: UUID! + configDefinitionsTableId: UUID + tableName: String! + apiName: String + privateApiName: String + scope: String! + prefix: String! + entityTableId: UUID + policies: JSON + provisions: JSON + hasConfig: Boolean! +} + +"""A `ConfigSecretsModule` edge in the connection.""" +type ConfigSecretsModuleEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `ConfigSecretsModule` at the end of the edge.""" + node: ConfigSecretsModule +} + +""" +A filter to be used against `ConfigSecretsModule` object types. All fields are combined with a logical ‘and.’ +""" +input ConfigSecretsModuleFilter { """Filter by the object’s `id` field.""" id: UUIDFilter @@ -5819,20 +5878,14 @@ input MerkleStoreModuleFilter { """Filter by the object’s `privateSchemaName` field.""" privateSchemaName: StringFilter - """Filter by the object’s `objectTableId` field.""" - objectTableId: UUIDFilter - - """Filter by the object’s `storeTableId` field.""" - storeTableId: UUIDFilter - - """Filter by the object’s `commitTableId` field.""" - commitTableId: UUIDFilter + """Filter by the object’s `tableId` field.""" + tableId: UUIDFilter - """Filter by the object’s `refTableId` field.""" - refTableId: UUIDFilter + """Filter by the object’s `configDefinitionsTableId` field.""" + configDefinitionsTableId: UUIDFilter - """Filter by the object’s `prefix` field.""" - prefix: StringFilter + """Filter by the object’s `tableName` field.""" + tableName: StringFilter """Filter by the object’s `apiName` field.""" apiName: StringFilter @@ -5843,44 +5896,33 @@ input MerkleStoreModuleFilter { """Filter by the object’s `scope` field.""" scope: StringFilter - """Filter by the object’s `functionPrefix` field.""" - functionPrefix: StringFilter - - """Filter by the object’s `createdAt` field.""" - createdAt: DatetimeFilter - - """Checks for all expressions in this list.""" - and: [MerkleStoreModuleFilter!] + """Filter by the object’s `prefix` field.""" + prefix: StringFilter - """Checks for any expressions in this list.""" - or: [MerkleStoreModuleFilter!] + """Filter by the object’s `entityTableId` field.""" + entityTableId: UUIDFilter - """Negates the expression.""" - not: MerkleStoreModuleFilter + """Filter by the object’s `policies` field.""" + policies: JSONFilter - """Filter by the object’s `graphModules` relation.""" - graphModules: MerkleStoreModuleToManyGraphModuleFilter + """Filter by the object’s `provisions` field.""" + provisions: JSONFilter - """`graphModules` exist.""" - graphModulesExist: Boolean -} + """Filter by the object’s `hasConfig` field.""" + hasConfig: BooleanFilter -""" -A filter to be used against many `GraphModule` object types. All fields are combined with a logical ‘and.’ -""" -input MerkleStoreModuleToManyGraphModuleFilter { - """Filters to entities where at least one related entity matches.""" - some: GraphModuleFilter + """Checks for all expressions in this list.""" + and: [ConfigSecretsModuleFilter!] - """Filters to entities where every related entity matches.""" - every: GraphModuleFilter + """Checks for any expressions in this list.""" + or: [ConfigSecretsModuleFilter!] - """Filters to entities where no related entity matches.""" - none: GraphModuleFilter + """Negates the expression.""" + not: ConfigSecretsModuleFilter } -"""Methods to use when ordering `GraphModule`.""" -enum GraphModuleOrderBy { +"""Methods to use when ordering `ConfigSecretsModule`.""" +enum ConfigSecretsModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC @@ -5888,369 +5930,362 @@ enum GraphModuleOrderBy { ID_DESC DATABASE_ID_ASC DATABASE_ID_DESC - PUBLIC_SCHEMA_ID_ASC - PUBLIC_SCHEMA_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 - SCOPE_ASC - SCOPE_DESC - PREFIX_ASC - PREFIX_DESC - MERKLE_STORE_MODULE_ID_ASC - MERKLE_STORE_MODULE_ID_DESC - GRAPHS_TABLE_ID_ASC - GRAPHS_TABLE_ID_DESC + TABLE_ID_ASC + TABLE_ID_DESC + CONFIG_DEFINITIONS_TABLE_ID_ASC + CONFIG_DEFINITIONS_TABLE_ID_DESC + TABLE_NAME_ASC + 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 - CREATED_AT_ASC - CREATED_AT_DESC + HAS_CONFIG_ASC + HAS_CONFIG_DESC } -"""A `MerkleStoreModule` edge in the connection.""" -type MerkleStoreModuleEdge { - """A cursor for use in pagination.""" - cursor: Cursor +"""A connection to a list of `GraphModule` values.""" +type GraphModuleConnection { + """A list of `GraphModule` objects.""" + nodes: [GraphModule]! - """The `MerkleStoreModule` at the end of the edge.""" - node: MerkleStoreModule + """ + A list of edges which contains the `GraphModule` and cursor to aid in pagination. + """ + edges: [GraphModuleEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `GraphModule` you could get from the connection.""" + totalCount: Int! } -"""Methods to use when ordering `MerkleStoreModule`.""" -enum MerkleStoreModuleOrderBy { - 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 - OBJECT_TABLE_ID_ASC - OBJECT_TABLE_ID_DESC - STORE_TABLE_ID_ASC - STORE_TABLE_ID_DESC - COMMIT_TABLE_ID_ASC - COMMIT_TABLE_ID_DESC - REF_TABLE_ID_ASC - REF_TABLE_ID_DESC - PREFIX_ASC - PREFIX_DESC - API_NAME_ASC - API_NAME_DESC - PRIVATE_API_NAME_ASC - PRIVATE_API_NAME_DESC - SCOPE_ASC - SCOPE_DESC - FUNCTION_PREFIX_ASC - FUNCTION_PREFIX_DESC - CREATED_AT_ASC - CREATED_AT_DESC -} - -"""A connection to a list of `DatabaseProvisionModule` values.""" -type DatabaseProvisionModuleConnection { - """A list of `DatabaseProvisionModule` objects.""" - nodes: [DatabaseProvisionModule]! +type GraphModule { + 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! """ - A list of edges which contains the `DatabaseProvisionModule` and cursor to aid in pagination. + Reads a single `MerkleStoreModule` that is related to this `GraphModule`. """ - edges: [DatabaseProvisionModuleEdge]! + merkleStoreModule: MerkleStoreModule +} - """Information to aid in pagination.""" - pageInfo: PageInfo! +type MerkleStoreModule { + id: UUID! + databaseId: UUID! + schemaId: UUID! + privateSchemaId: UUID! + publicSchemaName: String + privateSchemaName: String + objectTableId: UUID! + storeTableId: UUID! + commitTableId: UUID! + refTableId: UUID! + prefix: String! + apiName: String + privateApiName: String + scope: String! + functionPrefix: String + permissionKey: String + createdAt: Datetime! - """ - The count of *all* `DatabaseProvisionModule` you could get from the connection. - """ - totalCount: Int! + """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! } """ -Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. +A filter to be used against `GraphModule` object types. All fields are combined with a logical ‘and.’ """ -type DatabaseProvisionModule { - id: UUID! +input GraphModuleFilter { + """Filter by the object’s `id` field.""" + id: UUIDFilter - """The name for the new database""" - databaseName: String! + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter - """UUID of the user who owns this database""" - ownerId: UUID! + """Filter by the object’s `publicSchemaId` field.""" + publicSchemaId: UUIDFilter - """ - Subdomain prefix for the database. If null, auto-generated using unique_names + random chars - """ - subdomain: String + """Filter by the object’s `privateSchemaId` field.""" + privateSchemaId: UUIDFilter - """Base domain for the database (e.g., example.com)""" - domain: String! + """Filter by the object’s `publicSchemaName` field.""" + publicSchemaName: StringFilter - """ - JSONB array of modules to install. Each element is either a string ("users_module") or a [name, options] tuple (["permissions_module", {"scope": "app"}]) - """ - modules: JSON! + """Filter by the object’s `privateSchemaName` field.""" + privateSchemaName: StringFilter - """Additional configuration options for provisioning""" - options: JSON! + """Filter by the object’s `scope` field.""" + scope: StringFilter - """ - When true, copies the owner user and password hash from source database to the newly provisioned database - """ - bootstrapUser: Boolean! + """Filter by the object’s `prefix` field.""" + prefix: StringFilter - """Current status: pending, in_progress, completed, or failed""" - status: String! - errorMessage: String + """Filter by the object’s `merkleStoreModuleId` field.""" + merkleStoreModuleId: UUIDFilter - """The ID of the provisioned database (set by trigger before RLS check)""" - databaseId: UUID - createdAt: Datetime! - updatedAt: Datetime! - completedAt: Datetime -} + """Filter by the object’s `graphsTableId` field.""" + graphsTableId: UUIDFilter -"""A `DatabaseProvisionModule` edge in the connection.""" -type DatabaseProvisionModuleEdge { - """A cursor for use in pagination.""" - cursor: Cursor + """Filter by the object’s `apiName` field.""" + apiName: StringFilter - """The `DatabaseProvisionModule` at the end of the edge.""" - node: DatabaseProvisionModule + """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: [GraphModuleFilter!] + + """Checks for any expressions in this list.""" + or: [GraphModuleFilter!] + + """Negates the expression.""" + not: GraphModuleFilter + + """Filter by the object’s `merkleStoreModule` relation.""" + merkleStoreModule: MerkleStoreModuleFilter } """ -A filter to be used against `DatabaseProvisionModule` object types. All fields are combined with a logical ‘and.’ +A filter to be used against `MerkleStoreModule` object types. All fields are combined with a logical ‘and.’ """ -input DatabaseProvisionModuleFilter { +input MerkleStoreModuleFilter { """Filter by the object’s `id` field.""" id: UUIDFilter - """Filter by the object’s `databaseName` field.""" - databaseName: StringFilter + """Filter by the object’s `databaseId` field.""" + databaseId: UUIDFilter - """Filter by the object’s `ownerId` field.""" - ownerId: UUIDFilter + """Filter by the object’s `schemaId` field.""" + schemaId: UUIDFilter - """Filter by the object’s `subdomain` field.""" - subdomain: StringFilter + """Filter by the object’s `privateSchemaId` field.""" + privateSchemaId: UUIDFilter - """Filter by the object’s `domain` field.""" - domain: StringFilter + """Filter by the object’s `publicSchemaName` field.""" + publicSchemaName: StringFilter - """Filter by the object’s `modules` field.""" - modules: JSONFilter + """Filter by the object’s `privateSchemaName` field.""" + privateSchemaName: StringFilter - """Filter by the object’s `options` field.""" - options: JSONFilter + """Filter by the object’s `objectTableId` field.""" + objectTableId: UUIDFilter - """Filter by the object’s `bootstrapUser` field.""" - bootstrapUser: BooleanFilter + """Filter by the object’s `storeTableId` field.""" + storeTableId: UUIDFilter - """Filter by the object’s `status` field.""" - status: StringFilter + """Filter by the object’s `commitTableId` field.""" + commitTableId: UUIDFilter - """Filter by the object’s `errorMessage` field.""" - errorMessage: StringFilter + """Filter by the object’s `refTableId` field.""" + refTableId: UUIDFilter - """Filter by the object’s `databaseId` field.""" - databaseId: UUIDFilter + """Filter by the object’s `prefix` field.""" + prefix: StringFilter - """Filter by the object’s `createdAt` field.""" - createdAt: DatetimeFilter + """Filter by the object’s `apiName` field.""" + apiName: StringFilter - """Filter by the object’s `updatedAt` field.""" - updatedAt: DatetimeFilter + """Filter by the object’s `privateApiName` field.""" + privateApiName: StringFilter - """Filter by the object’s `completedAt` field.""" - completedAt: DatetimeFilter + """Filter by the object’s `scope` field.""" + scope: StringFilter + + """Filter by the object’s `functionPrefix` field.""" + functionPrefix: StringFilter + + """Filter by the object’s `permissionKey` field.""" + permissionKey: StringFilter + + """Filter by the object’s `createdAt` field.""" + createdAt: DatetimeFilter """Checks for all expressions in this list.""" - and: [DatabaseProvisionModuleFilter!] + and: [MerkleStoreModuleFilter!] """Checks for any expressions in this list.""" - or: [DatabaseProvisionModuleFilter!] + or: [MerkleStoreModuleFilter!] """Negates the expression.""" - not: DatabaseProvisionModuleFilter + not: MerkleStoreModuleFilter + + """Filter by the object’s `graphModules` relation.""" + graphModules: MerkleStoreModuleToManyGraphModuleFilter + + """`graphModules` exist.""" + graphModulesExist: Boolean } -"""Methods to use when ordering `DatabaseProvisionModule`.""" -enum DatabaseProvisionModuleOrderBy { +""" +A filter to be used against many `GraphModule` object types. All fields are combined with a logical ‘and.’ +""" +input MerkleStoreModuleToManyGraphModuleFilter { + """Filters to entities where at least one related entity matches.""" + some: GraphModuleFilter + + """Filters to entities where every related entity matches.""" + every: GraphModuleFilter + + """Filters to entities where no related entity matches.""" + none: GraphModuleFilter +} + +"""Methods to use when ordering `GraphModule`.""" +enum GraphModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC ID_ASC ID_DESC - DATABASE_NAME_ASC - DATABASE_NAME_DESC - OWNER_ID_ASC - OWNER_ID_DESC - SUBDOMAIN_ASC - SUBDOMAIN_DESC - DOMAIN_ASC - DOMAIN_DESC - MODULES_ASC - MODULES_DESC - OPTIONS_ASC - OPTIONS_DESC - BOOTSTRAP_USER_ASC - BOOTSTRAP_USER_DESC - STATUS_ASC - STATUS_DESC - ERROR_MESSAGE_ASC - ERROR_MESSAGE_DESC DATABASE_ID_ASC DATABASE_ID_DESC + PUBLIC_SCHEMA_ID_ASC + PUBLIC_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 + SCOPE_ASC + SCOPE_DESC + PREFIX_ASC + PREFIX_DESC + MERKLE_STORE_MODULE_ID_ASC + MERKLE_STORE_MODULE_ID_DESC + GRAPHS_TABLE_ID_ASC + GRAPHS_TABLE_ID_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 - UPDATED_AT_ASC - UPDATED_AT_DESC - COMPLETED_AT_ASC - COMPLETED_AT_DESC -} - -"""A connection to a list of `ConfigSecretsModule` values.""" -type ConfigSecretsModuleConnection { - """A list of `ConfigSecretsModule` objects.""" - nodes: [ConfigSecretsModule]! - - """ - A list of edges which contains the `ConfigSecretsModule` and cursor to aid in pagination. - """ - edges: [ConfigSecretsModuleEdge]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! - - """ - The count of *all* `ConfigSecretsModule` you could get from the connection. - """ - totalCount: Int! -} - -""" -Entity-aware PGP-encrypted key-value config/secrets module. Supports app-level (admin-only) - and org-scoped (per-org secrets with manage_secrets permission) via the scope column. - User-scoped bcrypt credentials are handled by user_credentials_module. -""" -type ConfigSecretsModule { - id: UUID! - databaseId: UUID! - schemaId: UUID! - privateSchemaId: UUID! - publicSchemaName: String - privateSchemaName: String - tableId: UUID! - configDefinitionsTableId: UUID - tableName: String! - apiName: String - privateApiName: String - scope: String! - prefix: String! - entityTableId: UUID - policies: JSON - provisions: JSON - hasConfig: Boolean! + CREATED_AT_DESC } -"""A `ConfigSecretsModule` edge in the connection.""" -type ConfigSecretsModuleEdge { +"""A `GraphModule` edge in the connection.""" +type GraphModuleEdge { """A cursor for use in pagination.""" cursor: Cursor - """The `ConfigSecretsModule` at the end of the edge.""" - node: ConfigSecretsModule + """The `GraphModule` at the end of the edge.""" + node: GraphModule } -""" -A filter to be used against `ConfigSecretsModule` object types. All fields are combined with a logical ‘and.’ -""" -input ConfigSecretsModuleFilter { - """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 `tableId` field.""" - tableId: UUIDFilter - - """Filter by the object’s `configDefinitionsTableId` field.""" - configDefinitionsTableId: UUIDFilter - - """Filter by the object’s `tableName` field.""" - tableName: 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 +"""A connection to a list of `MerkleStoreModule` values.""" +type MerkleStoreModuleConnection { + """A list of `MerkleStoreModule` objects.""" + nodes: [MerkleStoreModule]! - """Filter by the object’s `provisions` field.""" - provisions: JSONFilter + """ + A list of edges which contains the `MerkleStoreModule` and cursor to aid in pagination. + """ + edges: [MerkleStoreModuleEdge]! - """Filter by the object’s `hasConfig` field.""" - hasConfig: BooleanFilter + """Information to aid in pagination.""" + pageInfo: PageInfo! - """Checks for all expressions in this list.""" - and: [ConfigSecretsModuleFilter!] + """ + The count of *all* `MerkleStoreModule` you could get from the connection. + """ + totalCount: Int! +} - """Checks for any expressions in this list.""" - or: [ConfigSecretsModuleFilter!] +"""A `MerkleStoreModule` edge in the connection.""" +type MerkleStoreModuleEdge { + """A cursor for use in pagination.""" + cursor: Cursor - """Negates the expression.""" - not: ConfigSecretsModuleFilter + """The `MerkleStoreModule` at the end of the edge.""" + node: MerkleStoreModule } -"""Methods to use when ordering `ConfigSecretsModule`.""" -enum ConfigSecretsModuleOrderBy { +"""Methods to use when ordering `MerkleStoreModule`.""" +enum MerkleStoreModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC @@ -6266,28 +6301,28 @@ enum ConfigSecretsModuleOrderBy { PUBLIC_SCHEMA_NAME_DESC PRIVATE_SCHEMA_NAME_ASC PRIVATE_SCHEMA_NAME_DESC - TABLE_ID_ASC - TABLE_ID_DESC - CONFIG_DEFINITIONS_TABLE_ID_ASC - CONFIG_DEFINITIONS_TABLE_ID_DESC - TABLE_NAME_ASC - TABLE_NAME_DESC + OBJECT_TABLE_ID_ASC + OBJECT_TABLE_ID_DESC + STORE_TABLE_ID_ASC + STORE_TABLE_ID_DESC + COMMIT_TABLE_ID_ASC + COMMIT_TABLE_ID_DESC + REF_TABLE_ID_ASC + REF_TABLE_ID_DESC + PREFIX_ASC + PREFIX_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 - HAS_CONFIG_ASC - HAS_CONFIG_DESC + FUNCTION_PREFIX_ASC + FUNCTION_PREFIX_DESC + PERMISSION_KEY_ASC + PERMISSION_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC } """A connection to a list of `RateLimitMetersModule` values.""" @@ -7116,51 +7151,214 @@ input InvitesModuleFilter { """Filter by the object’s `emailsTableId` field.""" emailsTableId: UUIDFilter - """Filter by the object’s `usersTableId` field.""" - usersTableId: UUIDFilter + """Filter by the object’s `usersTableId` field.""" + usersTableId: UUIDFilter + + """Filter by the object’s `invitesTableId` field.""" + invitesTableId: UUIDFilter + + """Filter by the object’s `claimedInvitesTableId` field.""" + claimedInvitesTableId: UUIDFilter + + """Filter by the object’s `invitesTableName` field.""" + invitesTableName: StringFilter + + """Filter by the object’s `claimedInvitesTableName` field.""" + claimedInvitesTableName: StringFilter + + """Filter by the object’s `submitInviteCodeFunction` field.""" + submitInviteCodeFunction: 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 `apiName` field.""" + apiName: StringFilter + + """Filter by the object’s `privateApiName` field.""" + privateApiName: StringFilter + + """Checks for all expressions in this list.""" + and: [InvitesModuleFilter!] + + """Checks for any expressions in this list.""" + or: [InvitesModuleFilter!] + + """Negates the expression.""" + not: InvitesModuleFilter +} + +"""Methods to use when ordering `InvitesModule`.""" +enum InvitesModuleOrderBy { + 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 + EMAILS_TABLE_ID_ASC + EMAILS_TABLE_ID_DESC + USERS_TABLE_ID_ASC + USERS_TABLE_ID_DESC + INVITES_TABLE_ID_ASC + INVITES_TABLE_ID_DESC + CLAIMED_INVITES_TABLE_ID_ASC + CLAIMED_INVITES_TABLE_ID_DESC + INVITES_TABLE_NAME_ASC + INVITES_TABLE_NAME_DESC + CLAIMED_INVITES_TABLE_NAME_ASC + CLAIMED_INVITES_TABLE_NAME_DESC + SUBMIT_INVITE_CODE_FUNCTION_ASC + SUBMIT_INVITE_CODE_FUNCTION_DESC + SCOPE_ASC + SCOPE_DESC + PREFIX_ASC + PREFIX_DESC + ENTITY_TABLE_ID_ASC + ENTITY_TABLE_ID_DESC + API_NAME_ASC + API_NAME_DESC + PRIVATE_API_NAME_ASC + PRIVATE_API_NAME_DESC +} + +"""A connection to a list of `PrincipalAuthModule` values.""" +type PrincipalAuthModuleConnection { + """A list of `PrincipalAuthModule` objects.""" + nodes: [PrincipalAuthModule]! + + """ + A list of edges which contains the `PrincipalAuthModule` and cursor to aid in pagination. + """ + edges: [PrincipalAuthModuleEdge]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """ + The count of *all* `PrincipalAuthModule` you could get from the connection. + """ + totalCount: Int! +} + +""" +Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. +""" +type PrincipalAuthModule { + id: UUID! + databaseId: UUID! + schemaId: UUID! + principalsTableId: UUID! + principalEntitiesTableId: UUID! + principalScopeOverridesTableId: UUID! + usersTableId: UUID! + sessionsTableId: UUID! + sessionCredentialsTableId: UUID! + auditsTableId: UUID! + principalsTableName: String! + createPrincipalFunction: String! + deletePrincipalFunction: String! + createOrgPrincipalFunction: String! + deleteOrgPrincipalFunction: String! + createOrgApiKeyFunction: String! + revokeOrgApiKeyFunction: String! + apiName: String +} + +"""A `PrincipalAuthModule` edge in the connection.""" +type PrincipalAuthModuleEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `PrincipalAuthModule` at the end of the edge.""" + node: PrincipalAuthModule +} + +""" +A filter to be used against `PrincipalAuthModule` object types. All fields are combined with a logical ‘and.’ +""" +input PrincipalAuthModuleFilter { + """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 `principalsTableId` field.""" + principalsTableId: UUIDFilter + + """Filter by the object’s `principalEntitiesTableId` field.""" + principalEntitiesTableId: UUIDFilter + + """Filter by the object’s `principalScopeOverridesTableId` field.""" + principalScopeOverridesTableId: UUIDFilter + + """Filter by the object’s `usersTableId` field.""" + usersTableId: UUIDFilter + + """Filter by the object’s `sessionsTableId` field.""" + sessionsTableId: UUIDFilter + + """Filter by the object’s `sessionCredentialsTableId` field.""" + sessionCredentialsTableId: UUIDFilter - """Filter by the object’s `invitesTableId` field.""" - invitesTableId: UUIDFilter + """Filter by the object’s `auditsTableId` field.""" + auditsTableId: UUIDFilter - """Filter by the object’s `claimedInvitesTableId` field.""" - claimedInvitesTableId: UUIDFilter + """Filter by the object’s `principalsTableName` field.""" + principalsTableName: StringFilter - """Filter by the object’s `invitesTableName` field.""" - invitesTableName: StringFilter + """Filter by the object’s `createPrincipalFunction` field.""" + createPrincipalFunction: StringFilter - """Filter by the object’s `claimedInvitesTableName` field.""" - claimedInvitesTableName: StringFilter + """Filter by the object’s `deletePrincipalFunction` field.""" + deletePrincipalFunction: StringFilter - """Filter by the object’s `submitInviteCodeFunction` field.""" - submitInviteCodeFunction: StringFilter + """Filter by the object’s `createOrgPrincipalFunction` field.""" + createOrgPrincipalFunction: StringFilter - """Filter by the object’s `scope` field.""" - scope: StringFilter + """Filter by the object’s `deleteOrgPrincipalFunction` field.""" + deleteOrgPrincipalFunction: StringFilter - """Filter by the object’s `prefix` field.""" - prefix: StringFilter + """Filter by the object’s `createOrgApiKeyFunction` field.""" + createOrgApiKeyFunction: StringFilter - """Filter by the object’s `entityTableId` field.""" - entityTableId: UUIDFilter + """Filter by the object’s `revokeOrgApiKeyFunction` field.""" + revokeOrgApiKeyFunction: 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: [InvitesModuleFilter!] + and: [PrincipalAuthModuleFilter!] """Checks for any expressions in this list.""" - or: [InvitesModuleFilter!] + or: [PrincipalAuthModuleFilter!] """Negates the expression.""" - not: InvitesModuleFilter + not: PrincipalAuthModuleFilter } -"""Methods to use when ordering `InvitesModule`.""" -enum InvitesModuleOrderBy { +"""Methods to use when ordering `PrincipalAuthModule`.""" +enum PrincipalAuthModuleOrderBy { NATURAL PRIMARY_KEY_ASC PRIMARY_KEY_DESC @@ -7170,36 +7368,36 @@ enum InvitesModuleOrderBy { 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 - EMAILS_TABLE_ID_ASC - EMAILS_TABLE_ID_DESC + PRINCIPALS_TABLE_ID_ASC + PRINCIPALS_TABLE_ID_DESC + PRINCIPAL_ENTITIES_TABLE_ID_ASC + PRINCIPAL_ENTITIES_TABLE_ID_DESC + PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC + PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC USERS_TABLE_ID_ASC USERS_TABLE_ID_DESC - INVITES_TABLE_ID_ASC - INVITES_TABLE_ID_DESC - CLAIMED_INVITES_TABLE_ID_ASC - CLAIMED_INVITES_TABLE_ID_DESC - INVITES_TABLE_NAME_ASC - INVITES_TABLE_NAME_DESC - CLAIMED_INVITES_TABLE_NAME_ASC - CLAIMED_INVITES_TABLE_NAME_DESC - SUBMIT_INVITE_CODE_FUNCTION_ASC - SUBMIT_INVITE_CODE_FUNCTION_DESC - SCOPE_ASC - SCOPE_DESC - PREFIX_ASC - PREFIX_DESC - ENTITY_TABLE_ID_ASC - ENTITY_TABLE_ID_DESC + SESSIONS_TABLE_ID_ASC + SESSIONS_TABLE_ID_DESC + SESSION_CREDENTIALS_TABLE_ID_ASC + SESSION_CREDENTIALS_TABLE_ID_DESC + AUDITS_TABLE_ID_ASC + AUDITS_TABLE_ID_DESC + PRINCIPALS_TABLE_NAME_ASC + PRINCIPALS_TABLE_NAME_DESC + CREATE_PRINCIPAL_FUNCTION_ASC + CREATE_PRINCIPAL_FUNCTION_DESC + DELETE_PRINCIPAL_FUNCTION_ASC + DELETE_PRINCIPAL_FUNCTION_DESC + CREATE_ORG_PRINCIPAL_FUNCTION_ASC + CREATE_ORG_PRINCIPAL_FUNCTION_DESC + DELETE_ORG_PRINCIPAL_FUNCTION_ASC + DELETE_ORG_PRINCIPAL_FUNCTION_DESC + CREATE_ORG_API_KEY_FUNCTION_ASC + CREATE_ORG_API_KEY_FUNCTION_DESC + REVOKE_ORG_API_KEY_FUNCTION_ASC + REVOKE_ORG_API_KEY_FUNCTION_DESC API_NAME_ASC API_NAME_DESC - PRIVATE_API_NAME_ASC - PRIVATE_API_NAME_DESC } """A connection to a list of `ComputeLogModule` values.""" @@ -13034,14 +13232,6 @@ type Mutation { input: CreateSecureTableProvisionInput! ): CreateSecureTableProvisionPayload - """Creates a single `MerkleStoreModule`.""" - createMerkleStoreModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateMerkleStoreModuleInput! - ): CreateMerkleStoreModulePayload - """Creates a single `DatabaseProvisionModule`.""" createDatabaseProvisionModule( """ @@ -13066,6 +13256,14 @@ type Mutation { input: CreateGraphModuleInput! ): CreateGraphModulePayload + """Creates a single `MerkleStoreModule`.""" + createMerkleStoreModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateMerkleStoreModuleInput! + ): CreateMerkleStoreModulePayload + """Creates a single `RateLimitMetersModule`.""" createRateLimitMetersModule( """ @@ -13114,6 +13312,14 @@ type Mutation { input: CreateInvitesModuleInput! ): CreateInvitesModulePayload + """Creates a single `PrincipalAuthModule`.""" + createPrincipalAuthModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreatePrincipalAuthModuleInput! + ): CreatePrincipalAuthModulePayload + """Creates a single `ComputeLogModule`.""" createComputeLogModule( """ @@ -13530,14 +13736,6 @@ type Mutation { input: UpdateSecureTableProvisionInput! ): UpdateSecureTableProvisionPayload - """Updates a single `MerkleStoreModule` using a unique key and a patch.""" - updateMerkleStoreModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateMerkleStoreModuleInput! - ): UpdateMerkleStoreModulePayload - """ Updates a single `DatabaseProvisionModule` using a unique key and a patch. """ @@ -13564,6 +13762,14 @@ type Mutation { input: UpdateGraphModuleInput! ): UpdateGraphModulePayload + """Updates a single `MerkleStoreModule` using a unique key and a patch.""" + updateMerkleStoreModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateMerkleStoreModuleInput! + ): UpdateMerkleStoreModulePayload + """ Updates a single `RateLimitMetersModule` using a unique key and a patch. """ @@ -13616,6 +13822,14 @@ type Mutation { input: UpdateInvitesModuleInput! ): UpdateInvitesModulePayload + """Updates a single `PrincipalAuthModule` using a unique key and a patch.""" + updatePrincipalAuthModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdatePrincipalAuthModuleInput! + ): UpdatePrincipalAuthModulePayload + """Updates a single `ComputeLogModule` using a unique key and a patch.""" updateComputeLogModule( """ @@ -14014,14 +14228,6 @@ type Mutation { input: DeleteSecureTableProvisionInput! ): DeleteSecureTableProvisionPayload - """Deletes a single `MerkleStoreModule` using a unique key.""" - deleteMerkleStoreModule( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteMerkleStoreModuleInput! - ): DeleteMerkleStoreModulePayload - """Deletes a single `DatabaseProvisionModule` using a unique key.""" deleteDatabaseProvisionModule( """ @@ -14046,6 +14252,14 @@ type Mutation { input: DeleteGraphModuleInput! ): DeleteGraphModulePayload + """Deletes a single `MerkleStoreModule` using a unique key.""" + deleteMerkleStoreModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteMerkleStoreModuleInput! + ): DeleteMerkleStoreModulePayload + """Deletes a single `RateLimitMetersModule` using a unique key.""" deleteRateLimitMetersModule( """ @@ -14094,6 +14308,14 @@ type Mutation { input: DeleteInvitesModuleInput! ): DeleteInvitesModulePayload + """Deletes a single `PrincipalAuthModule` using a unique key.""" + deletePrincipalAuthModule( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeletePrincipalAuthModuleInput! + ): DeletePrincipalAuthModulePayload + """Deletes a single `ComputeLogModule` using a unique key.""" deleteComputeLogModule( """ @@ -15899,61 +16121,6 @@ input SecureTableProvisionInput { outFields: [UUID] } -"""The output of our create `MerkleStoreModule` mutation.""" -type CreateMerkleStoreModulePayload { - """ - 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 `MerkleStoreModule` that was created by this mutation.""" - merkleStoreModule: MerkleStoreModule - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MerkleStoreModule`. May be used by Relay 1.""" - merkleStoreModuleEdge( - """The method to use when ordering `MerkleStoreModule`.""" - orderBy: [MerkleStoreModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): MerkleStoreModuleEdge -} - -"""All input for the create `MerkleStoreModule` mutation.""" -input CreateMerkleStoreModuleInput { - """ - 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 `MerkleStoreModule` to be created by this mutation.""" - merkleStoreModule: MerkleStoreModuleInput! -} - -"""An input for mutations affecting `MerkleStoreModule`""" -input MerkleStoreModuleInput { - id: UUID - databaseId: UUID! - schemaId: UUID - privateSchemaId: UUID - publicSchemaName: String - privateSchemaName: String - objectTableId: UUID - storeTableId: UUID - commitTableId: UUID - refTableId: UUID - prefix: String - apiName: String - privateApiName: String - scope: String - functionPrefix: String - createdAt: Datetime -} - """The output of our create `DatabaseProvisionModule` mutation.""" type CreateDatabaseProvisionModulePayload { """ @@ -16143,6 +16310,62 @@ input GraphModuleInput { createdAt: Datetime } +"""The output of our create `MerkleStoreModule` mutation.""" +type CreateMerkleStoreModulePayload { + """ + 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 `MerkleStoreModule` that was created by this mutation.""" + merkleStoreModule: MerkleStoreModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MerkleStoreModule`. May be used by Relay 1.""" + merkleStoreModuleEdge( + """The method to use when ordering `MerkleStoreModule`.""" + orderBy: [MerkleStoreModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): MerkleStoreModuleEdge +} + +"""All input for the create `MerkleStoreModule` mutation.""" +input CreateMerkleStoreModuleInput { + """ + 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 `MerkleStoreModule` to be created by this mutation.""" + merkleStoreModule: MerkleStoreModuleInput! +} + +"""An input for mutations affecting `MerkleStoreModule`""" +input MerkleStoreModuleInput { + id: UUID + databaseId: UUID! + schemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + objectTableId: UUID + storeTableId: UUID + commitTableId: UUID + refTableId: UUID + prefix: String + apiName: String + privateApiName: String + scope: String + functionPrefix: String + permissionKey: String + createdAt: Datetime +} + """The output of our create `RateLimitMetersModule` mutation.""" type CreateRateLimitMetersModulePayload { """ @@ -16475,7 +16698,64 @@ input InvitesModuleInput { prefix: String entityTableId: UUID apiName: String - privateApiName: String + privateApiName: String +} + +"""The output of our create `PrincipalAuthModule` mutation.""" +type CreatePrincipalAuthModulePayload { + """ + 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 `PrincipalAuthModule` that was created by this mutation.""" + principalAuthModule: PrincipalAuthModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PrincipalAuthModule`. May be used by Relay 1.""" + principalAuthModuleEdge( + """The method to use when ordering `PrincipalAuthModule`.""" + orderBy: [PrincipalAuthModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): PrincipalAuthModuleEdge +} + +"""All input for the create `PrincipalAuthModule` mutation.""" +input CreatePrincipalAuthModuleInput { + """ + 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 `PrincipalAuthModule` to be created by this mutation.""" + principalAuthModule: PrincipalAuthModuleInput! +} + +"""An input for mutations affecting `PrincipalAuthModule`""" +input PrincipalAuthModuleInput { + id: UUID + databaseId: UUID! + schemaId: UUID + principalsTableId: UUID + principalEntitiesTableId: UUID + principalScopeOverridesTableId: UUID + usersTableId: UUID + sessionsTableId: UUID + sessionCredentialsTableId: UUID + auditsTableId: UUID + principalsTableName: String + createPrincipalFunction: String + deletePrincipalFunction: String + createOrgPrincipalFunction: String + deleteOrgPrincipalFunction: String + createOrgApiKeyFunction: String + revokeOrgApiKeyFunction: String + apiName: String } """The output of our create `ComputeLogModule` mutation.""" @@ -19939,66 +20219,6 @@ input SecureTableProvisionPatch { outFields: [UUID] } -"""The output of our update `MerkleStoreModule` mutation.""" -type UpdateMerkleStoreModulePayload { - """ - 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 `MerkleStoreModule` that was updated by this mutation.""" - merkleStoreModule: MerkleStoreModule - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MerkleStoreModule`. May be used by Relay 1.""" - merkleStoreModuleEdge( - """The method to use when ordering `MerkleStoreModule`.""" - orderBy: [MerkleStoreModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): MerkleStoreModuleEdge -} - -"""All input for the `updateMerkleStoreModule` mutation.""" -input UpdateMerkleStoreModuleInput { - """ - 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 `MerkleStoreModule` being updated. - """ - merkleStoreModulePatch: MerkleStoreModulePatch! -} - -""" -Represents an update to a `MerkleStoreModule`. Fields that are set will be updated. -""" -input MerkleStoreModulePatch { - id: UUID - databaseId: UUID - schemaId: UUID - privateSchemaId: UUID - publicSchemaName: String - privateSchemaName: String - objectTableId: UUID - storeTableId: UUID - commitTableId: UUID - refTableId: UUID - prefix: String - apiName: String - privateApiName: String - scope: String - functionPrefix: String - createdAt: Datetime -} - """The output of our update `DatabaseProvisionModule` mutation.""" type UpdateDatabaseProvisionModulePayload { """ @@ -20203,6 +20423,67 @@ input GraphModulePatch { createdAt: Datetime } +"""The output of our update `MerkleStoreModule` mutation.""" +type UpdateMerkleStoreModulePayload { + """ + 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 `MerkleStoreModule` that was updated by this mutation.""" + merkleStoreModule: MerkleStoreModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MerkleStoreModule`. May be used by Relay 1.""" + merkleStoreModuleEdge( + """The method to use when ordering `MerkleStoreModule`.""" + orderBy: [MerkleStoreModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): MerkleStoreModuleEdge +} + +"""All input for the `updateMerkleStoreModule` mutation.""" +input UpdateMerkleStoreModuleInput { + """ + 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 `MerkleStoreModule` being updated. + """ + merkleStoreModulePatch: MerkleStoreModulePatch! +} + +""" +Represents an update to a `MerkleStoreModule`. Fields that are set will be updated. +""" +input MerkleStoreModulePatch { + id: UUID + databaseId: UUID + schemaId: UUID + privateSchemaId: UUID + publicSchemaName: String + privateSchemaName: String + objectTableId: UUID + storeTableId: UUID + commitTableId: UUID + refTableId: UUID + prefix: String + apiName: String + privateApiName: String + scope: String + functionPrefix: String + permissionKey: String + createdAt: Datetime +} + """The output of our update `RateLimitMetersModule` mutation.""" type UpdateRateLimitMetersModulePayload { """ @@ -20568,6 +20849,68 @@ input InvitesModulePatch { privateApiName: String } +"""The output of our update `PrincipalAuthModule` mutation.""" +type UpdatePrincipalAuthModulePayload { + """ + 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 `PrincipalAuthModule` that was updated by this mutation.""" + principalAuthModule: PrincipalAuthModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PrincipalAuthModule`. May be used by Relay 1.""" + principalAuthModuleEdge( + """The method to use when ordering `PrincipalAuthModule`.""" + orderBy: [PrincipalAuthModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): PrincipalAuthModuleEdge +} + +"""All input for the `updatePrincipalAuthModule` mutation.""" +input UpdatePrincipalAuthModuleInput { + """ + 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 `PrincipalAuthModule` being updated. + """ + principalAuthModulePatch: PrincipalAuthModulePatch! +} + +""" +Represents an update to a `PrincipalAuthModule`. Fields that are set will be updated. +""" +input PrincipalAuthModulePatch { + id: UUID + databaseId: UUID + schemaId: UUID + principalsTableId: UUID + principalEntitiesTableId: UUID + principalScopeOverridesTableId: UUID + usersTableId: UUID + sessionsTableId: UUID + sessionCredentialsTableId: UUID + auditsTableId: UUID + principalsTableName: String + createPrincipalFunction: String + deletePrincipalFunction: String + createOrgPrincipalFunction: String + deleteOrgPrincipalFunction: String + createOrgApiKeyFunction: String + revokeOrgApiKeyFunction: String + apiName: String +} + """The output of our update `ComputeLogModule` mutation.""" type UpdateComputeLogModulePayload { """ @@ -23541,39 +23884,6 @@ input DeleteSecureTableProvisionInput { id: UUID! } -"""The output of our delete `MerkleStoreModule` mutation.""" -type DeleteMerkleStoreModulePayload { - """ - 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 `MerkleStoreModule` that was deleted by this mutation.""" - merkleStoreModule: MerkleStoreModule - - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query - - """An edge for our `MerkleStoreModule`. May be used by Relay 1.""" - merkleStoreModuleEdge( - """The method to use when ordering `MerkleStoreModule`.""" - orderBy: [MerkleStoreModuleOrderBy!]! = [PRIMARY_KEY_ASC] - ): MerkleStoreModuleEdge -} - -"""All input for the `deleteMerkleStoreModule` mutation.""" -input DeleteMerkleStoreModuleInput { - """ - 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 `DatabaseProvisionModule` mutation.""" type DeleteDatabaseProvisionModulePayload { """ @@ -23673,6 +23983,39 @@ input DeleteGraphModuleInput { id: UUID! } +"""The output of our delete `MerkleStoreModule` mutation.""" +type DeleteMerkleStoreModulePayload { + """ + 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 `MerkleStoreModule` that was deleted by this mutation.""" + merkleStoreModule: MerkleStoreModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `MerkleStoreModule`. May be used by Relay 1.""" + merkleStoreModuleEdge( + """The method to use when ordering `MerkleStoreModule`.""" + orderBy: [MerkleStoreModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): MerkleStoreModuleEdge +} + +"""All input for the `deleteMerkleStoreModule` mutation.""" +input DeleteMerkleStoreModuleInput { + """ + 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 { """ @@ -23871,6 +24214,39 @@ input DeleteInvitesModuleInput { id: UUID! } +"""The output of our delete `PrincipalAuthModule` mutation.""" +type DeletePrincipalAuthModulePayload { + """ + 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 `PrincipalAuthModule` that was deleted by this mutation.""" + principalAuthModule: PrincipalAuthModule + + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query + + """An edge for our `PrincipalAuthModule`. May be used by Relay 1.""" + principalAuthModuleEdge( + """The method to use when ordering `PrincipalAuthModule`.""" + orderBy: [PrincipalAuthModuleOrderBy!]! = [PRIMARY_KEY_ASC] + ): PrincipalAuthModuleEdge +} + +"""All input for the `deletePrincipalAuthModule` mutation.""" +input DeletePrincipalAuthModuleInput { + """ + 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 { """ diff --git a/sdk/constructive-sdk/src/auth/README.md b/sdk/constructive-sdk/src/auth/README.md index e7bb3828bf..e56c8f42cc 100644 --- a/sdk/constructive-sdk/src/auth/README.md +++ b/sdk/constructive-sdk/src/auth/README.md @@ -8,9 +8,9 @@ ## Overview -- **Tables:** 9 +- **Tables:** 13 - **Custom queries:** 5 -- **Custom mutations:** 25 +- **Custom mutations:** 29 **Generators:** ORM diff --git a/sdk/constructive-sdk/src/auth/orm/README.md b/sdk/constructive-sdk/src/auth/orm/README.md index 68bf0ce72d..343ccbb2bd 100644 --- a/sdk/constructive-sdk/src/auth/orm/README.md +++ b/sdk/constructive-sdk/src/auth/orm/README.md @@ -21,6 +21,9 @@ const db = createClient({ | Model | Operations | |-------|------------| +| `principal` | findMany, findOne, create, update, delete | +| `principalEntity` | findMany, findOne, create, update, delete | +| `principalScopeOverride` | findMany, findOne, create, update, delete | | `email` | findMany, findOne, create, update, delete | | `phoneNumber` | findMany, findOne, create, update, delete | | `cryptoAddress` | findMany, findOne, create, update, delete | @@ -29,10 +32,118 @@ const db = createClient({ | `identityProvider` | findMany, findOne, create, update, delete | | `roleType` | findMany, findOne, create, update, delete | | `userConnectedAccount` | findMany, findOne, create, update, delete | +| `orgApiKeyList` | findMany, findOne, create, update, delete | | `user` | findMany, findOne, create, update, delete | ## Table Operations +### `db.principal` + +CRUD operations for Principal records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `ownerId` | UUID | Yes | +| `userId` | UUID | Yes | +| `name` | String | Yes | +| `allowedMask` | BitString | Yes | +| `isReadOnly` | Boolean | Yes | +| `bypassStepUp` | Boolean | Yes | + +**Operations:** + +```typescript +// List all principal records +const items = await db.principal.findMany({ select: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }).execute(); + +// Get one by principalId +const item = await db.principal.findOne({ principalId: '', select: { id: true, createdAt: true, updatedAt: true, ownerId: true, userId: true, name: true, allowedMask: true, isReadOnly: true, bypassStepUp: true } }).execute(); + +// Create +const created = await db.principal.create({ data: { id: '', ownerId: '', userId: '', name: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' }, select: { principalId: true } }).execute(); + +// Update +const updated = await db.principal.update({ where: { principalId: '' }, data: { id: '' }, select: { principalId: true } }).execute(); + +// Delete +const deleted = await db.principal.delete({ where: { principalId: '' } }).execute(); +``` + +### `db.principalEntity` + +CRUD operations for PrincipalEntity records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `principalId` | UUID | Yes | +| `entityId` | UUID | Yes | +| `ownerId` | UUID | Yes | + +**Operations:** + +```typescript +// List all principalEntity records +const items = await db.principalEntity.findMany({ select: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }).execute(); + +// Get one by id +const item = await db.principalEntity.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, principalId: true, entityId: true, ownerId: true } }).execute(); + +// Create +const created = await db.principalEntity.create({ data: { principalId: '', entityId: '', ownerId: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalEntity.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalEntity.delete({ where: { id: '' } }).execute(); +``` + +### `db.principalScopeOverride` + +CRUD operations for PrincipalScopeOverride records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `principalId` | UUID | Yes | +| `membershipType` | Int | Yes | +| `allowedMask` | BitString | Yes | +| `isAdmin` | Boolean | Yes | +| `isReadOnly` | Boolean | Yes | + +**Operations:** + +```typescript +// List all principalScopeOverride records +const items = await db.principalScopeOverride.findMany({ select: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }).execute(); + +// Get one by id +const item = await db.principalScopeOverride.findOne({ id: '', select: { id: true, createdAt: true, updatedAt: true, principalId: true, membershipType: true, allowedMask: true, isAdmin: true, isReadOnly: true } }).execute(); + +// Create +const created = await db.principalScopeOverride.create({ data: { principalId: '', membershipType: '', allowedMask: '', isAdmin: '', isReadOnly: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalScopeOverride.update({ where: { id: '' }, data: { principalId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalScopeOverride.delete({ where: { id: '' } }).execute(); +``` + ### `db.email` CRUD operations for Email records. @@ -319,6 +430,46 @@ const updated = await db.userConnectedAccount.update({ where: { id: '' }, const deleted = await db.userConnectedAccount.delete({ where: { id: '' } }).execute(); ``` +### `db.orgApiKeyList` + +CRUD operations for OrgApiKeyList records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `keyId` | String | Yes | +| `name` | String | Yes | +| `principalId` | UUID | Yes | +| `orgId` | UUID | Yes | +| `expiresAt` | Datetime | Yes | +| `revokedAt` | Datetime | Yes | +| `lastUsedAt` | Datetime | Yes | +| `mfaLevel` | String | Yes | +| `accessLevel` | String | Yes | +| `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | + +**Operations:** + +```typescript +// List all orgApiKeyList records +const items = await db.orgApiKeyList.findMany({ select: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }).execute(); + +// Get one by id +const item = await db.orgApiKeyList.findOne({ id: '', select: { id: true, keyId: true, name: true, principalId: true, orgId: true, expiresAt: true, revokedAt: true, lastUsedAt: true, mfaLevel: true, accessLevel: true, createdAt: true, updatedAt: true } }).execute(); + +// Create +const created = await db.orgApiKeyList.create({ data: { keyId: '', name: '', principalId: '', orgId: '', expiresAt: '', revokedAt: '', lastUsedAt: '', mfaLevel: '', accessLevel: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.orgApiKeyList.update({ where: { id: '' }, data: { keyId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.orgApiKeyList.delete({ where: { id: '' } }).execute(); +``` + ### `db.user` CRUD operations for User records. @@ -374,26 +525,26 @@ currentUserAgent const result = await db.query.currentUserAgent().execute(); ``` -### `db.query.currentIpAddress` +### `db.query.currentUserId` -currentIpAddress +currentUserId - **Type:** query - **Arguments:** none ```typescript -const result = await db.query.currentIpAddress().execute(); +const result = await db.query.currentUserId().execute(); ``` -### `db.query.currentUserId` +### `db.query.currentIpAddress` -currentUserId +currentIpAddress - **Type:** query - **Arguments:** none ```typescript -const result = await db.query.currentUserId().execute(); +const result = await db.query.currentIpAddress().execute(); ``` ### `db.query.requireStepUp` @@ -467,6 +618,21 @@ checkPassword const result = await db.mutation.checkPassword({ input: { password: '' } }).execute(); ``` +### `db.mutation.deleteOrgPrincipal` + +deleteOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | DeleteOrgPrincipalInput (required) | + +```typescript +const result = await db.mutation.deleteOrgPrincipal({ input: { principalId: '' } }).execute(); +``` + ### `db.mutation.disconnectAccount` disconnectAccount @@ -557,6 +723,21 @@ confirmDeleteAccount const result = await db.mutation.confirmDeleteAccount({ input: { userId: '', token: '' } }).execute(); ``` +### `db.mutation.revokeOrgApiKey` + +revokeOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | RevokeOrgApiKeyInput (required) | + +```typescript +const result = await db.mutation.revokeOrgApiKey({ input: { keyId: '', orgId: '' } }).execute(); +``` + ### `db.mutation.setPassword` setPassword @@ -707,6 +888,21 @@ linkIdentity const result = await db.mutation.linkIdentity({ input: { service: '', identifier: '', details: '' } }).execute(); ``` +### `db.mutation.createOrgPrincipal` + +createOrgPrincipal + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgPrincipalInput (required) | + +```typescript +const result = await db.mutation.createOrgPrincipal({ input: { name: '', orgId: '', allowedMask: '', isReadOnly: '', bypassStepUp: '' } }).execute(); +``` + ### `db.mutation.extendTokenExpires` extendTokenExpires @@ -722,6 +918,21 @@ extendTokenExpires const result = await db.mutation.extendTokenExpires({ input: { amount: '' } }).execute(); ``` +### `db.mutation.createOrgApiKey` + +createOrgApiKey + +- **Type:** mutation +- **Arguments:** + + | Argument | Type | + |----------|------| + | `input` | CreateOrgApiKeyInput (required) | + +```typescript +const result = await db.mutation.createOrgApiKey({ input: '' }).execute(); +``` + ### `db.mutation.createApiKey` createApiKey @@ -734,7 +945,7 @@ createApiKey | `input` | CreateApiKeyInput (required) | ```typescript -const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '' } }).execute(); +const result = await db.mutation.createApiKey({ input: { keyName: '', accessLevel: '', mfaLevel: '', expiresIn: '', principalId: '' } }).execute(); ``` ### `db.mutation.requestCrossOriginToken` diff --git a/sdk/constructive-sdk/src/auth/orm/index.ts b/sdk/constructive-sdk/src/auth/orm/index.ts index 35448d7362..f3ecc5703a 100644 --- a/sdk/constructive-sdk/src/auth/orm/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/index.ts @@ -5,6 +5,9 @@ */ import { OrmClient } from './client'; import type { OrmClientConfig } from './client'; +import { PrincipalModel } from './models/principal'; +import { PrincipalEntityModel } from './models/principalEntity'; +import { PrincipalScopeOverrideModel } from './models/principalScopeOverride'; import { EmailModel } from './models/email'; import { PhoneNumberModel } from './models/phoneNumber'; import { CryptoAddressModel } from './models/cryptoAddress'; @@ -13,6 +16,7 @@ import { AuditLogAuthModel } from './models/auditLogAuth'; import { IdentityProviderModel } from './models/identityProvider'; import { RoleTypeModel } from './models/roleType'; import { UserConnectedAccountModel } from './models/userConnectedAccount'; +import { OrgApiKeyListModel } from './models/orgApiKeyList'; import { UserModel } from './models/user'; import { createQueryOperations } from './query'; import { createMutationOperations } from './mutation'; @@ -49,6 +53,9 @@ export { createMutationOperations } from './mutation'; export function createClient(config: OrmClientConfig) { const client = new OrmClient(config); return { + principal: new PrincipalModel(client), + principalEntity: new PrincipalEntityModel(client), + principalScopeOverride: new PrincipalScopeOverrideModel(client), email: new EmailModel(client), phoneNumber: new PhoneNumberModel(client), cryptoAddress: new CryptoAddressModel(client), @@ -57,6 +64,7 @@ export function createClient(config: OrmClientConfig) { identityProvider: new IdentityProviderModel(client), roleType: new RoleTypeModel(client), userConnectedAccount: new UserConnectedAccountModel(client), + orgApiKeyList: new OrgApiKeyListModel(client), user: new UserModel(client), query: createQueryOperations(client), mutation: createMutationOperations(client), diff --git a/sdk/constructive-sdk/src/auth/orm/input-types.ts b/sdk/constructive-sdk/src/auth/orm/input-types.ts index 734fe10c3a..f47ec67005 100644 --- a/sdk/constructive-sdk/src/auth/orm/input-types.ts +++ b/sdk/constructive-sdk/src/auth/orm/input-types.ts @@ -235,8 +235,54 @@ export type Base64EncodedBinary = unknown; export type ConstructiveInternalTypeEmail = unknown; export type ConstructiveInternalTypeImage = unknown; export type ConstructiveInternalTypeOrigin = unknown; -/** User email addresses with verification and primary-email management */ +/** Scoped sub-identities (API keys and agents) with precomputed SPRT */ // ============ Entity Types ============ +export interface Principal { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The human user who owns and manages this principal */ + ownerId?: string | null; + /** The user row (type=3 Principal) that represents this principal identity */ + userId?: string | null; + /** Human-readable label for this principal (e.g., billing-bot, ci-deploy-key) */ + name?: string | null; + /** Permission bitmask subset; all-1s means inherit all parent permissions */ + allowedMask?: string | null; + /** Whether this principal is restricted to read-only operations */ + isReadOnly?: boolean | null; + /** Whether this principal bypasses MFA step-up requirements */ + bypassStepUp?: boolean | null; +} +/** Association table scoping principals to specific organizations */ +export interface PrincipalEntity { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The principal this scoping row belongs to */ + principalId?: string | null; + /** The organization this principal is scoped to */ + entityId?: string | null; + /** Denormalized owner_id from principals table for RLS */ + ownerId?: string | null; +} +/** Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions. */ +export interface PrincipalScopeOverride { + id: string; + createdAt?: string | null; + updatedAt?: string | null; + /** The principal this override applies to */ + principalId?: string | null; + /** The scope level (membership_type) this override restricts */ + membershipType?: number | null; + /** Permission bitmask for this scope; AND-masked with parent permissions during cascade */ + allowedMask?: string | null; + /** Whether this principal has admin access at this scope (default true = inherit from parent) */ + isAdmin?: boolean | null; + /** Whether this principal is restricted to read-only at this scope */ + isReadOnly?: boolean | null; +} +/** User email addresses with verification and primary-email management */ export interface Email { id: string; ownerId?: string | null; @@ -349,6 +395,20 @@ export interface UserConnectedAccount { createdAt?: string | null; updatedAt?: string | null; } +export interface OrgApiKeyList { + id: string; + keyId?: string | null; + name?: string | null; + principalId?: string | null; + orgId?: string | null; + expiresAt?: string | null; + revokedAt?: string | null; + lastUsedAt?: string | null; + mfaLevel?: string | null; + accessLevel?: string | null; + createdAt?: string | null; + updatedAt?: string | null; +} export interface User { id: string; username?: string | null; @@ -378,6 +438,20 @@ export interface PageInfo { endCursor?: string | null; } // ============ Entity Relation Types ============ +export interface PrincipalRelations { + owner?: User | null; + user?: User | null; + principalEntities?: ConnectionResult; + principalScopeOverrides?: ConnectionResult; +} +export interface PrincipalEntityRelations { + entity?: User | null; + owner?: User | null; + principal?: Principal | null; +} +export interface PrincipalScopeOverrideRelations { + principal?: Principal | null; +} export interface EmailRelations { owner?: User | null; } @@ -396,8 +470,12 @@ export interface AuditLogAuthRelations { export interface IdentityProviderRelations {} export interface RoleTypeRelations {} export interface UserConnectedAccountRelations {} +export interface OrgApiKeyListRelations {} export interface UserRelations { roleType?: RoleType | null; + ownedPrincipals?: ConnectionResult; + principals?: ConnectionResult; + principalEntitiesByEntityId?: ConnectionResult; ownedEmails?: ConnectionResult; ownedPhoneNumbers?: ConnectionResult; ownedCryptoAddresses?: ConnectionResult; @@ -405,6 +483,10 @@ export interface UserRelations { auditLogAuthsByActorId?: ConnectionResult; } // ============ Entity Types With Relations ============ +export type PrincipalWithRelations = Principal & PrincipalRelations; +export type PrincipalEntityWithRelations = PrincipalEntity & PrincipalEntityRelations; +export type PrincipalScopeOverrideWithRelations = PrincipalScopeOverride & + PrincipalScopeOverrideRelations; export type EmailWithRelations = Email & EmailRelations; export type PhoneNumberWithRelations = PhoneNumber & PhoneNumberRelations; export type CryptoAddressWithRelations = CryptoAddress & CryptoAddressRelations; @@ -414,8 +496,68 @@ export type IdentityProviderWithRelations = IdentityProvider & IdentityProviderR export type RoleTypeWithRelations = RoleType & RoleTypeRelations; export type UserConnectedAccountWithRelations = UserConnectedAccount & UserConnectedAccountRelations; +export type OrgApiKeyListWithRelations = OrgApiKeyList & OrgApiKeyListRelations; export type UserWithRelations = User & UserRelations; // ============ Entity Select Types ============ +export type PrincipalSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + ownerId?: boolean; + userId?: boolean; + name?: boolean; + allowedMask?: boolean; + isReadOnly?: boolean; + bypassStepUp?: boolean; + owner?: { + select: UserSelect; + }; + user?: { + select: UserSelect; + }; + principalEntities?: { + select: PrincipalEntitySelect; + first?: number; + filter?: PrincipalEntityFilter; + orderBy?: PrincipalEntityOrderBy[]; + }; + principalScopeOverrides?: { + select: PrincipalScopeOverrideSelect; + first?: number; + filter?: PrincipalScopeOverrideFilter; + orderBy?: PrincipalScopeOverrideOrderBy[]; + }; +}; +export type PrincipalEntitySelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + principalId?: boolean; + entityId?: boolean; + ownerId?: boolean; + entity?: { + select: UserSelect; + }; + owner?: { + select: UserSelect; + }; + principal?: { + select: PrincipalSelect; + }; +}; +export type PrincipalScopeOverrideSelect = { + id?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + principalId?: boolean; + membershipType?: boolean; + allowedMask?: boolean; + isAdmin?: boolean; + isReadOnly?: boolean; + principal?: { + select: PrincipalSelect; + }; +}; export type EmailSelect = { id?: boolean; ownerId?: boolean; @@ -509,6 +651,20 @@ export type UserConnectedAccountSelect = { createdAt?: boolean; updatedAt?: boolean; }; +export type OrgApiKeyListSelect = { + id?: boolean; + keyId?: boolean; + name?: boolean; + principalId?: boolean; + orgId?: boolean; + expiresAt?: boolean; + revokedAt?: boolean; + lastUsedAt?: boolean; + mfaLevel?: boolean; + accessLevel?: boolean; + createdAt?: boolean; + updatedAt?: boolean; +}; export type UserSelect = { id?: boolean; username?: boolean; @@ -524,6 +680,24 @@ export type UserSelect = { roleType?: { select: RoleTypeSelect; }; + ownedPrincipals?: { + select: PrincipalSelect; + first?: number; + filter?: PrincipalFilter; + orderBy?: PrincipalOrderBy[]; + }; + principals?: { + select: PrincipalSelect; + first?: number; + filter?: PrincipalFilter; + orderBy?: PrincipalOrderBy[]; + }; + principalEntitiesByEntityId?: { + select: PrincipalEntitySelect; + first?: number; + filter?: PrincipalEntityFilter; + orderBy?: PrincipalEntityOrderBy[]; + }; ownedEmails?: { select: EmailSelect; first?: number; @@ -556,6 +730,96 @@ export type UserSelect = { }; }; // ============ Table Filter Types ============ +export interface PrincipalFilter { + /** 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 `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `userId` field. */ + userId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Filter by the object’s `bypassStepUp` field. */ + bypassStepUp?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalFilter[]; + /** Negates the expression. */ + not?: PrincipalFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `user` relation. */ + user?: UserFilter; + /** Filter by the object’s `principalEntities` relation. */ + principalEntities?: PrincipalToManyPrincipalEntityFilter; + /** `principalEntities` exist. */ + principalEntitiesExist?: boolean; + /** Filter by the object’s `principalScopeOverrides` relation. */ + principalScopeOverrides?: PrincipalToManyPrincipalScopeOverrideFilter; + /** `principalScopeOverrides` exist. */ + principalScopeOverridesExist?: boolean; +} +export interface PrincipalEntityFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalEntityFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalEntityFilter[]; + /** Negates the expression. */ + not?: PrincipalEntityFilter; + /** Filter by the object’s `entity` relation. */ + entity?: UserFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +export interface PrincipalScopeOverrideFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `membershipType` field. */ + membershipType?: IntFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isAdmin` field. */ + isAdmin?: BooleanFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalScopeOverrideFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalScopeOverrideFilter[]; + /** Negates the expression. */ + not?: PrincipalScopeOverrideFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} export interface EmailFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -756,6 +1020,38 @@ export interface UserConnectedAccountFilter { /** Negates the expression. */ not?: UserConnectedAccountFilter; } +export interface OrgApiKeyListFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `keyId` field. */ + keyId?: StringFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `orgId` field. */ + orgId?: UUIDFilter; + /** Filter by the object’s `expiresAt` field. */ + expiresAt?: DatetimeFilter; + /** Filter by the object’s `revokedAt` field. */ + revokedAt?: DatetimeFilter; + /** Filter by the object’s `lastUsedAt` field. */ + lastUsedAt?: DatetimeFilter; + /** Filter by the object’s `mfaLevel` field. */ + mfaLevel?: StringFilter; + /** Filter by the object’s `accessLevel` field. */ + accessLevel?: StringFilter; + /** 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?: OrgApiKeyListFilter[]; + /** Checks for any expressions in this list. */ + or?: OrgApiKeyListFilter[]; + /** Negates the expression. */ + not?: OrgApiKeyListFilter; +} export interface UserFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -781,6 +1077,18 @@ export interface UserFilter { not?: UserFilter; /** Filter by the object’s `roleType` relation. */ roleType?: RoleTypeFilter; + /** Filter by the object’s `ownedPrincipals` relation. */ + ownedPrincipals?: UserToManyPrincipalFilter; + /** `ownedPrincipals` exist. */ + ownedPrincipalsExist?: boolean; + /** Filter by the object’s `principals` relation. */ + principals?: UserToManyPrincipalFilter; + /** `principals` exist. */ + principalsExist?: boolean; + /** Filter by the object’s `principalEntitiesByEntityId` relation. */ + principalEntitiesByEntityId?: UserToManyPrincipalEntityFilter; + /** `principalEntitiesByEntityId` exist. */ + principalEntitiesByEntityIdExist?: boolean; /** Filter by the object’s `ownedEmails` relation. */ ownedEmails?: UserToManyEmailFilter; /** `ownedEmails` exist. */ @@ -815,6 +1123,64 @@ export interface UserFilter { unifiedSearch?: string; } // ============ OrderBy Types ============ +export type PrincipalOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'USER_ID_ASC' + | 'USER_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC' + | 'BYPASS_STEP_UP_ASC' + | 'BYPASS_STEP_UP_DESC'; +export type PrincipalEntityOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ENTITY_ID_ASC' + | 'ENTITY_ID_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC'; +export type PrincipalScopeOverrideOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'MEMBERSHIP_TYPE_ASC' + | 'MEMBERSHIP_TYPE_DESC' + | 'ALLOWED_MASK_ASC' + | 'ALLOWED_MASK_DESC' + | 'IS_ADMIN_ASC' + | 'IS_ADMIN_DESC' + | 'IS_READ_ONLY_ASC' + | 'IS_READ_ONLY_DESC'; export type EmailOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -967,6 +1333,32 @@ export type UserConnectedAccountOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; +export type OrgApiKeyListOrderBy = + | 'NATURAL' + | 'ID_ASC' + | 'ID_DESC' + | 'KEY_ID_ASC' + | 'KEY_ID_DESC' + | 'NAME_ASC' + | 'NAME_DESC' + | 'PRINCIPAL_ID_ASC' + | 'PRINCIPAL_ID_DESC' + | 'ORG_ID_ASC' + | 'ORG_ID_DESC' + | 'EXPIRES_AT_ASC' + | 'EXPIRES_AT_DESC' + | 'REVOKED_AT_ASC' + | 'REVOKED_AT_DESC' + | 'LAST_USED_AT_ASC' + | 'LAST_USED_AT_DESC' + | 'MFA_LEVEL_ASC' + | 'MFA_LEVEL_DESC' + | 'ACCESS_LEVEL_ASC' + | 'ACCESS_LEVEL_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC'; export type UserOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -994,6 +1386,82 @@ export type UserOrderBy = | 'SEARCH_SCORE_ASC' | 'SEARCH_SCORE_DESC'; // ============ CRUD Input Types ============ +export interface CreatePrincipalInput { + clientMutationId?: string; + principal: { + ownerId: string; + userId: string; + name?: string; + allowedMask?: string; + isReadOnly?: boolean; + bypassStepUp?: boolean; + }; +} +export interface PrincipalPatch { + ownerId?: string | null; + userId?: string | null; + name?: string | null; + allowedMask?: string | null; + isReadOnly?: boolean | null; + bypassStepUp?: boolean | null; +} +export interface UpdatePrincipalInput { + clientMutationId?: string; + principalId: string; + principalPatch: PrincipalPatch; +} +export interface DeletePrincipalInput { + clientMutationId?: string; + principalId: string; +} +export interface CreatePrincipalEntityInput { + clientMutationId?: string; + principalEntity: { + principalId: string; + entityId: string; + ownerId: string; + }; +} +export interface PrincipalEntityPatch { + principalId?: string | null; + entityId?: string | null; + ownerId?: string | null; +} +export interface UpdatePrincipalEntityInput { + clientMutationId?: string; + id: string; + principalEntityPatch: PrincipalEntityPatch; +} +export interface DeletePrincipalEntityInput { + clientMutationId?: string; + id: string; +} +export interface CreatePrincipalScopeOverrideInput { + clientMutationId?: string; + principalScopeOverride: { + principalId: string; + membershipType?: number; + allowedMask?: string; + isAdmin?: boolean; + isReadOnly?: boolean; + }; +} +export interface PrincipalScopeOverridePatch { + principalId?: string | null; + membershipType?: number | null; + allowedMask?: string | null; + isAdmin?: boolean | null; + isReadOnly?: boolean | null; +} +export interface UpdatePrincipalScopeOverrideInput { + clientMutationId?: string; + id: string; + principalScopeOverridePatch: PrincipalScopeOverridePatch; +} +export interface DeletePrincipalScopeOverrideInput { + clientMutationId?: string; + id: string; +} export interface CreateEmailInput { clientMutationId?: string; email: { @@ -1210,6 +1678,40 @@ export interface DeleteUserConnectedAccountInput { clientMutationId?: string; id: string; } +export interface CreateOrgApiKeyListInput { + clientMutationId?: string; + orgApiKeyList: { + keyId?: string; + name?: string; + principalId?: string; + orgId?: string; + expiresAt?: string; + revokedAt?: string; + lastUsedAt?: string; + mfaLevel?: string; + accessLevel?: string; + }; +} +export interface OrgApiKeyListPatch { + keyId?: string | null; + name?: string | null; + principalId?: string | null; + orgId?: string | null; + expiresAt?: string | null; + revokedAt?: string | null; + lastUsedAt?: string | null; + mfaLevel?: string | null; + accessLevel?: string | null; +} +export interface UpdateOrgApiKeyListInput { + clientMutationId?: string; + id: string; + orgApiKeyListPatch: OrgApiKeyListPatch; +} +export interface DeleteOrgApiKeyListInput { + clientMutationId?: string; + id: string; +} export interface CreateUserInput { clientMutationId?: string; user: { @@ -1237,7 +1739,14 @@ export interface DeleteUserInput { } // ============ Connection Fields Map ============ export const connectionFieldsMap = { + Principal: { + principalEntities: 'PrincipalEntity', + principalScopeOverrides: 'PrincipalScopeOverride', + }, User: { + ownedPrincipals: 'Principal', + principals: 'Principal', + principalEntitiesByEntityId: 'PrincipalEntity', ownedEmails: 'Email', ownedPhoneNumbers: 'PhoneNumber', ownedCryptoAddresses: 'CryptoAddress', @@ -1256,6 +1765,10 @@ export interface CheckPasswordInput { clientMutationId?: string; password?: string; } +export interface DeleteOrgPrincipalInput { + clientMutationId?: string; + principalId?: string; +} export interface DisconnectAccountInput { clientMutationId?: string; accountId: string; @@ -1281,6 +1794,11 @@ export interface ConfirmDeleteAccountInput { userId?: string; token?: string; } +export interface RevokeOrgApiKeyInput { + clientMutationId?: string; + keyId: string; + orgId: string; +} export interface SetPasswordInput { clientMutationId?: string; currentPassword?: string; @@ -1347,16 +1865,34 @@ export interface LinkIdentityInput { identifier: string; details?: Record; } +export interface CreateOrgPrincipalInput { + clientMutationId?: string; + name?: string; + orgId?: string; + allowedMask?: string; + isReadOnly?: boolean; + bypassStepUp?: boolean; +} export interface ExtendTokenExpiresInput { clientMutationId?: string; amount?: IntervalInput; } +export interface CreateOrgApiKeyInput { + clientMutationId?: string; + orgId?: string; + principalId?: string; + keyName?: string; + accessLevel?: string; + mfaLevel?: string; + expiresIn?: IntervalInput; +} export interface CreateApiKeyInput { clientMutationId?: string; keyName?: string; accessLevel?: string; mfaLevel?: string; expiresIn?: IntervalInput; + principalId?: string; } export interface RequestCrossOriginTokenInput { clientMutationId?: string; @@ -1382,6 +1918,24 @@ export interface ProvisionBucketInput { */ ownerId?: string; } +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} +/** A filter to be used against many `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalToManyPrincipalScopeOverrideFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalScopeOverrideFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalScopeOverrideFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalScopeOverrideFilter; +} /** A filter to be used against ConstructiveInternalTypeEmail fields. All fields are combined with a logical ‘and.’ */ export interface ConstructiveInternalTypeEmailFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -1669,6 +2223,24 @@ export interface ConstructiveInternalTypeImageFilter { /** Contained by the specified JSON. */ containedBy?: ConstructiveInternalTypeImage; } +/** A filter to be used against many `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalFilter; +} +/** A filter to be used against many `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface UserToManyPrincipalEntityFilter { + /** Filters to entities where at least one related entity matches. */ + some?: PrincipalEntityFilter; + /** Filters to entities where every related entity matches. */ + every?: PrincipalEntityFilter; + /** Filters to entities where no related entity matches. */ + none?: PrincipalEntityFilter; +} /** A filter to be used against many `Email` object types. All fields are combined with a logical ‘and.’ */ export interface UserToManyEmailFilter { /** Filters to entities where at least one related entity matches. */ @@ -1721,6 +2293,18 @@ export interface TrgmSearchInput { /** Minimum similarity threshold (0.0 to 1.0). Higher = stricter matching. Default is 0.3. */ threshold?: number; } +/** An input for mutations affecting `PrincipalEntity` */ +export interface PrincipalEntityInput { + id?: string; + createdAt?: string; + updatedAt?: string; + /** The principal this scoping row belongs to */ + principalId: string; + /** The organization this principal is scoped to */ + entityId: string; + /** Denormalized owner_id from principals table for RLS */ + ownerId: string; +} /** An input for mutations affecting `Email` */ export interface EmailInput { id?: string; @@ -1837,7 +2421,22 @@ export interface UserConnectedAccountInput { createdAt?: string; updatedAt?: string; } -/** An input for mutations affecting `User` */ +/** An input for mutations affecting `OrgApiKeyList` */ +export interface OrgApiKeyListInput { + id?: string; + keyId?: string; + name?: string; + principalId?: string; + orgId?: string; + expiresAt?: string; + revokedAt?: string; + lastUsedAt?: string; + mfaLevel?: string; + accessLevel?: string; + createdAt?: string; + updatedAt?: string; +} +/** An input for mutations affecting `User` */ export interface UserInput { id?: string; username?: string; @@ -1866,6 +2465,99 @@ export interface IntervalInput { /** A quantity of years. */ years?: number; } +/** A filter to be used against `PrincipalEntity` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalEntityFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `entityId` field. */ + entityId?: UUIDFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalEntityFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalEntityFilter[]; + /** Negates the expression. */ + not?: PrincipalEntityFilter; + /** Filter by the object’s `entity` relation. */ + entity?: UserFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +/** A filter to be used against `PrincipalScopeOverride` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalScopeOverrideFilter { + /** 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 `principalId` field. */ + principalId?: UUIDFilter; + /** Filter by the object’s `membershipType` field. */ + membershipType?: IntFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isAdmin` field. */ + isAdmin?: BooleanFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalScopeOverrideFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalScopeOverrideFilter[]; + /** Negates the expression. */ + not?: PrincipalScopeOverrideFilter; + /** Filter by the object’s `principal` relation. */ + principal?: PrincipalFilter; +} +/** A filter to be used against `Principal` object types. All fields are combined with a logical ‘and.’ */ +export interface PrincipalFilter { + /** 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 `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `userId` field. */ + userId?: UUIDFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `allowedMask` field. */ + allowedMask?: BitStringFilter; + /** Filter by the object’s `isReadOnly` field. */ + isReadOnly?: BooleanFilter; + /** Filter by the object’s `bypassStepUp` field. */ + bypassStepUp?: BooleanFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalFilter[]; + /** Negates the expression. */ + not?: PrincipalFilter; + /** Filter by the object’s `owner` relation. */ + owner?: UserFilter; + /** Filter by the object’s `user` relation. */ + user?: UserFilter; + /** Filter by the object’s `principalEntities` relation. */ + principalEntities?: PrincipalToManyPrincipalEntityFilter; + /** `principalEntities` exist. */ + principalEntitiesExist?: boolean; + /** Filter by the object’s `principalScopeOverrides` relation. */ + principalScopeOverrides?: PrincipalToManyPrincipalScopeOverrideFilter; + /** `principalScopeOverrides` exist. */ + principalScopeOverridesExist?: boolean; +} /** A filter to be used against `Email` object types. All fields are combined with a logical ‘and.’ */ export interface EmailFilter { /** Filter by the object’s `id` field. */ @@ -2042,6 +2734,152 @@ export interface UUIDFilter { /** Greater than or equal to the specified value. */ greaterThanOrEqualTo?: string; } +/** 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 `User` object types. All fields are combined with a logical ‘and.’ */ +export interface UserFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `username` field. */ + username?: StringTrgmFilter; + /** Filter by the object’s `displayName` field. */ + displayName?: StringTrgmFilter; + /** Filter by the object’s `profilePicture` field. */ + profilePicture?: ConstructiveInternalTypeImageFilter; + /** Filter by the object’s `searchTsv` field. */ + searchTsv?: FullTextFilter; + /** Filter by the object’s `type` field. */ + type?: IntFilter; + /** 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?: UserFilter[]; + /** Checks for any expressions in this list. */ + or?: UserFilter[]; + /** Negates the expression. */ + not?: UserFilter; + /** Filter by the object’s `roleType` relation. */ + roleType?: RoleTypeFilter; + /** Filter by the object’s `ownedPrincipals` relation. */ + ownedPrincipals?: UserToManyPrincipalFilter; + /** `ownedPrincipals` exist. */ + ownedPrincipalsExist?: boolean; + /** Filter by the object’s `principals` relation. */ + principals?: UserToManyPrincipalFilter; + /** `principals` exist. */ + principalsExist?: boolean; + /** Filter by the object’s `principalEntitiesByEntityId` relation. */ + principalEntitiesByEntityId?: UserToManyPrincipalEntityFilter; + /** `principalEntitiesByEntityId` exist. */ + principalEntitiesByEntityIdExist?: boolean; + /** Filter by the object’s `ownedEmails` relation. */ + ownedEmails?: UserToManyEmailFilter; + /** `ownedEmails` exist. */ + ownedEmailsExist?: boolean; + /** Filter by the object’s `ownedPhoneNumbers` relation. */ + ownedPhoneNumbers?: UserToManyPhoneNumberFilter; + /** `ownedPhoneNumbers` exist. */ + ownedPhoneNumbersExist?: boolean; + /** Filter by the object’s `ownedCryptoAddresses` relation. */ + ownedCryptoAddresses?: UserToManyCryptoAddressFilter; + /** `ownedCryptoAddresses` exist. */ + ownedCryptoAddressesExist?: boolean; + /** Filter by the object’s `ownedWebauthnCredentials` relation. */ + ownedWebauthnCredentials?: UserToManyWebauthnCredentialFilter; + /** `ownedWebauthnCredentials` exist. */ + ownedWebauthnCredentialsExist?: boolean; + /** Filter by the object’s `auditLogAuthsByActorId` relation. */ + auditLogAuthsByActorId?: UserToManyAuditLogAuthFilter; + /** `auditLogAuthsByActorId` exist. */ + auditLogAuthsByActorIdExist?: boolean; + /** TSV search on the `search_tsv` column. */ + tsvSearchTsv?: string; + /** TRGM search on the `display_name` column. */ + trgmDisplayName?: TrgmSearchInput; + /** + * Composite unified search. Provide a search string and it will be dispatched to + * all text-compatible search algorithms (tsvector, BM25, pg_trgm) + * 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; +} +/** 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 BitString fields. All fields are combined with a logical ‘and.’ */ +export interface BitStringFilter { + /** 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 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). */ @@ -2144,90 +2982,6 @@ export interface StringFilter { /** Greater than or equal to the specified value (case-insensitive). */ greaterThanOrEqualToInsensitive?: string; } -/** 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 `User` object types. All fields are combined with a logical ‘and.’ */ -export interface UserFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `username` field. */ - username?: StringTrgmFilter; - /** Filter by the object’s `displayName` field. */ - displayName?: StringTrgmFilter; - /** Filter by the object’s `profilePicture` field. */ - profilePicture?: ConstructiveInternalTypeImageFilter; - /** Filter by the object’s `searchTsv` field. */ - searchTsv?: FullTextFilter; - /** Filter by the object’s `type` field. */ - type?: IntFilter; - /** 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?: UserFilter[]; - /** Checks for any expressions in this list. */ - or?: UserFilter[]; - /** Negates the expression. */ - not?: UserFilter; - /** Filter by the object’s `roleType` relation. */ - roleType?: RoleTypeFilter; - /** Filter by the object’s `ownedEmails` relation. */ - ownedEmails?: UserToManyEmailFilter; - /** `ownedEmails` exist. */ - ownedEmailsExist?: boolean; - /** Filter by the object’s `ownedPhoneNumbers` relation. */ - ownedPhoneNumbers?: UserToManyPhoneNumberFilter; - /** `ownedPhoneNumbers` exist. */ - ownedPhoneNumbersExist?: boolean; - /** Filter by the object’s `ownedCryptoAddresses` relation. */ - ownedCryptoAddresses?: UserToManyCryptoAddressFilter; - /** `ownedCryptoAddresses` exist. */ - ownedCryptoAddressesExist?: boolean; - /** Filter by the object’s `ownedWebauthnCredentials` relation. */ - ownedWebauthnCredentials?: UserToManyWebauthnCredentialFilter; - /** `ownedWebauthnCredentials` exist. */ - ownedWebauthnCredentialsExist?: boolean; - /** Filter by the object’s `auditLogAuthsByActorId` relation. */ - auditLogAuthsByActorId?: UserToManyAuditLogAuthFilter; - /** `auditLogAuthsByActorId` exist. */ - auditLogAuthsByActorIdExist?: boolean; - /** TSV search on the `search_tsv` column. */ - tsvSearchTsv?: string; - /** TRGM search on the `display_name` column. */ - trgmDisplayName?: TrgmSearchInput; - /** - * Composite unified search. Provide a search string and it will be dispatched to - * all text-compatible search algorithms (tsvector, BM25, pg_trgm) - * 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; -} /** A filter to be used against BigInt fields. All fields are combined with a logical ‘and.’ */ export interface BigIntFilter { /** Is null (if `true` is specified) or is not null (if `false` is specified). */ @@ -2346,31 +3100,6 @@ export interface FullTextFilter { /** Performs a full text search on the field. */ matches?: 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 `RoleType` object types. All fields are combined with a logical ‘and.’ */ export interface RoleTypeFilter { /** Filter by the object’s `id` field. */ @@ -2405,6 +3134,14 @@ export interface CheckPasswordPayload { export type CheckPasswordPayloadSelect = { clientMutationId?: boolean; }; +export interface DeleteOrgPrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type DeleteOrgPrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface DisconnectAccountPayload { clientMutationId?: string | null; result?: boolean | null; @@ -2453,6 +3190,14 @@ export type ConfirmDeleteAccountPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; +export interface RevokeOrgApiKeyPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type RevokeOrgApiKeyPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface SetPasswordPayload { clientMutationId?: string | null; result?: boolean | null; @@ -2543,6 +3288,14 @@ export type LinkIdentityPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; +export interface CreateOrgPrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreateOrgPrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; export interface ExtendTokenExpiresPayload { clientMutationId?: string | null; result?: ExtendTokenExpiresRecord[] | null; @@ -2553,6 +3306,16 @@ export type ExtendTokenExpiresPayloadSelect = { select: ExtendTokenExpiresRecordSelect; }; }; +export interface CreateOrgApiKeyPayload { + clientMutationId?: string | null; + result?: CreateOrgApiKeyRecord | null; +} +export type CreateOrgApiKeyPayloadSelect = { + clientMutationId?: boolean; + result?: { + select: CreateOrgApiKeyRecordSelect; + }; +}; export interface CreateApiKeyPayload { clientMutationId?: string | null; result?: CreateApiKeyRecord | null; @@ -2607,6 +3370,67 @@ export type ProvisionBucketPayloadSelect = { endpoint?: boolean; error?: boolean; }; +export interface CreatePrincipalPayload { + clientMutationId?: string | null; + result?: string | null; +} +export type CreatePrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface DeletePrincipalPayload { + clientMutationId?: string | null; + result?: boolean | null; +} +export type DeletePrincipalPayloadSelect = { + clientMutationId?: boolean; + result?: boolean; +}; +export interface CreatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was created by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type CreatePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; +export interface UpdatePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was updated by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type UpdatePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; +export interface DeletePrincipalEntityPayload { + clientMutationId?: string | null; + /** The `PrincipalEntity` that was deleted by this mutation. */ + principalEntity?: PrincipalEntity | null; + principalEntityEdge?: PrincipalEntityEdge | null; +} +export type DeletePrincipalEntityPayloadSelect = { + clientMutationId?: boolean; + principalEntity?: { + select: PrincipalEntitySelect; + }; + principalEntityEdge?: { + select: PrincipalEntityEdgeSelect; + }; +}; export interface CreateEmailPayload { clientMutationId?: string | null; /** The `Email` that was created by this mutation. */ @@ -2899,6 +3723,17 @@ export type CreateUserConnectedAccountPayloadSelect = { select: UserConnectedAccountSelect; }; }; +export interface CreateOrgApiKeyListPayload { + clientMutationId?: string | null; + /** The `OrgApiKeyList` that was created by this mutation. */ + orgApiKeyList?: OrgApiKeyList | null; +} +export type CreateOrgApiKeyListPayloadSelect = { + clientMutationId?: boolean; + orgApiKeyList?: { + select: OrgApiKeyListSelect; + }; +}; export interface CreateUserPayload { clientMutationId?: string | null; /** The `User` that was created by this mutation. */ @@ -3026,6 +3861,16 @@ export type ExtendTokenExpiresRecordSelect = { sessionId?: boolean; expiresAt?: boolean; }; +export interface CreateOrgApiKeyRecord { + apiKey?: string | null; + keyId?: string | null; + expiresAt?: string | null; +} +export type CreateOrgApiKeyRecordSelect = { + apiKey?: boolean; + keyId?: boolean; + expiresAt?: boolean; +}; export interface CreateApiKeyRecord { apiKey?: string | null; keyId?: string | null; @@ -3036,6 +3881,18 @@ export type CreateApiKeyRecordSelect = { keyId?: boolean; expiresAt?: boolean; }; +/** A `PrincipalEntity` edge in the connection. */ +export interface PrincipalEntityEdge { + cursor?: string | null; + /** The `PrincipalEntity` at the end of the edge. */ + node?: PrincipalEntity | null; +} +export type PrincipalEntityEdgeSelect = { + cursor?: boolean; + node?: { + select: PrincipalEntitySelect; + }; +}; /** A `Email` edge in the connection. */ export interface EmailEdge { cursor?: string | null; diff --git a/sdk/constructive-sdk/src/auth/orm/models/index.ts b/sdk/constructive-sdk/src/auth/orm/models/index.ts index f0ecad3b71..d041785e90 100644 --- a/sdk/constructive-sdk/src/auth/orm/models/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/models/index.ts @@ -3,6 +3,9 @@ * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ +export { PrincipalModel } from './principal'; +export { PrincipalEntityModel } from './principalEntity'; +export { PrincipalScopeOverrideModel } from './principalScopeOverride'; export { EmailModel } from './email'; export { PhoneNumberModel } from './phoneNumber'; export { CryptoAddressModel } from './cryptoAddress'; @@ -11,4 +14,5 @@ export { AuditLogAuthModel } from './auditLogAuth'; export { IdentityProviderModel } from './identityProvider'; export { RoleTypeModel } from './roleType'; export { UserConnectedAccountModel } from './userConnectedAccount'; +export { OrgApiKeyListModel } from './orgApiKeyList'; export { UserModel } from './user'; diff --git a/sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts b/sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts new file mode 100644 index 0000000000..fe7120ee8a --- /dev/null +++ b/sdk/constructive-sdk/src/auth/orm/models/orgApiKeyList.ts @@ -0,0 +1,174 @@ +/** + * OrgApiKeyList 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 { + OrgApiKeyList, + OrgApiKeyListWithRelations, + OrgApiKeyListSelect, + OrgApiKeyListFilter, + OrgApiKeyListOrderBy, + CreateOrgApiKeyListInput, + UpdateOrgApiKeyListInput, + OrgApiKeyListPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class OrgApiKeyListModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyLists: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + 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, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyLists', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyList: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', + document, + variables, + transform: (data: { + orgApiKeyLists?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + orgApiKeyList: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'OrgApiKeyList', + 'orgApiKeyLists', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'OrgApiKeyListFilter', + 'OrgApiKeyListOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'OrgApiKeyList', + fieldName: 'orgApiKeyList', + document, + variables, + transform: (data: { + orgApiKeyLists?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + orgApiKeyList: data.orgApiKeyLists?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createOrgApiKeyList: { + orgApiKeyList: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'OrgApiKeyList', + 'createOrgApiKeyList', + 'orgApiKeyList', + args.select, + args.data, + 'CreateOrgApiKeyListInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'OrgApiKeyList', + fieldName: 'createOrgApiKeyList', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/principal.ts b/sdk/constructive-sdk/src/auth/orm/models/principal.ts new file mode 100644 index 0000000000..66c9d2ff40 --- /dev/null +++ b/sdk/constructive-sdk/src/auth/orm/models/principal.ts @@ -0,0 +1,208 @@ +/** + * Principal 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 { + Principal, + PrincipalWithRelations, + PrincipalSelect, + PrincipalFilter, + PrincipalOrderBy, + CreatePrincipalInput, + UpdatePrincipalInput, + PrincipalPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principals: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + 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, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principals', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principal: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'Principal', + 'principals', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', + document, + variables, + transform: (data: { + principals?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principal: data.principals?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + principalId: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principal: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'Principal', + 'principals', + args.select, + { + where: { + principalId: { + equalTo: args.principalId, + }, + }, + first: 1, + }, + 'PrincipalFilter', + 'PrincipalOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'Principal', + fieldName: 'principal', + document, + variables, + transform: (data: { + principals?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principal: data.principals?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipal: { + principal: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'Principal', + 'createPrincipal', + 'principal', + args.select, + args.data, + 'CreatePrincipalInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'Principal', + fieldName: 'createPrincipal', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + principalId: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipal: { + principal: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'Principal', + 'deletePrincipal', + 'principal', + { + principalId: args.where.principalId, + }, + 'DeletePrincipalInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'Principal', + fieldName: 'deletePrincipal', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts b/sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts new file mode 100644 index 0000000000..0c265501f5 --- /dev/null +++ b/sdk/constructive-sdk/src/auth/orm/models/principalEntity.ts @@ -0,0 +1,245 @@ +/** + * PrincipalEntity 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 { + PrincipalEntity, + PrincipalEntityWithRelations, + PrincipalEntitySelect, + PrincipalEntityFilter, + PrincipalEntityOrderBy, + CreatePrincipalEntityInput, + UpdatePrincipalEntityInput, + PrincipalEntityPatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalEntityModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntities: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + 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, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntities', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntity: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', + document, + variables, + transform: (data: { + principalEntities?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalEntity: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalEntity', + 'principalEntities', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalEntityFilter', + 'PrincipalEntityOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalEntity', + fieldName: 'principalEntity', + document, + variables, + transform: (data: { + principalEntities?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalEntity: data.principalEntities?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalEntity', + 'createPrincipalEntity', + 'principalEntity', + args.select, + args.data, + 'CreatePrincipalEntityInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'createPrincipalEntity', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrincipalEntityPatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PrincipalEntity', + 'updatePrincipalEntity', + 'principalEntity', + args.select, + args.where.id, + args.data, + 'UpdatePrincipalEntityInput', + 'id', + 'principalEntityPatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'updatePrincipalEntity', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipalEntity: { + principalEntity: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PrincipalEntity', + 'deletePrincipalEntity', + 'principalEntity', + { + id: args.where.id, + }, + 'DeletePrincipalEntityInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalEntity', + fieldName: 'deletePrincipalEntity', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts b/sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts new file mode 100644 index 0000000000..3d3e7bedd3 --- /dev/null +++ b/sdk/constructive-sdk/src/auth/orm/models/principalScopeOverride.ts @@ -0,0 +1,176 @@ +/** + * PrincipalScopeOverride 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 { + PrincipalScopeOverride, + PrincipalScopeOverrideWithRelations, + PrincipalScopeOverrideSelect, + PrincipalScopeOverrideFilter, + PrincipalScopeOverrideOrderBy, + CreatePrincipalScopeOverrideInput, + UpdatePrincipalScopeOverrideInput, + PrincipalScopeOverridePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalScopeOverrideModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverrides: ConnectionResult< + InferSelectResult + >; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + 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, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverrides', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverride: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', + document, + variables, + transform: (data: { + principalScopeOverrides?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalScopeOverride: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalScopeOverride', + 'principalScopeOverrides', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalScopeOverrideFilter', + 'PrincipalScopeOverrideOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalScopeOverride', + fieldName: 'principalScopeOverride', + document, + variables, + transform: (data: { + principalScopeOverrides?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalScopeOverride: data.principalScopeOverrides?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalScopeOverride: { + principalScopeOverride: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalScopeOverride', + 'createPrincipalScopeOverride', + 'principalScopeOverride', + args.select, + args.data, + 'CreatePrincipalScopeOverrideInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalScopeOverride', + fieldName: 'createPrincipalScopeOverride', + document, + variables, + }); + } +} diff --git a/sdk/constructive-sdk/src/auth/orm/mutation/index.ts b/sdk/constructive-sdk/src/auth/orm/mutation/index.ts index d8864374dd..de98ebe402 100644 --- a/sdk/constructive-sdk/src/auth/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/mutation/index.ts @@ -10,12 +10,14 @@ import type { SignOutInput, SendAccountDeletionEmailInput, CheckPasswordInput, + DeleteOrgPrincipalInput, DisconnectAccountInput, RevokeApiKeyInput, RevokeSessionInput, VerifyPasswordInput, VerifyTotpInput, ConfirmDeleteAccountInput, + RevokeOrgApiKeyInput, SetPasswordInput, VerifyEmailInput, ProvisionNewUserInput, @@ -26,7 +28,9 @@ import type { SignUpInput, SignInInput, LinkIdentityInput, + CreateOrgPrincipalInput, ExtendTokenExpiresInput, + CreateOrgApiKeyInput, CreateApiKeyInput, RequestCrossOriginTokenInput, ForgotPasswordInput, @@ -35,12 +39,14 @@ import type { SignOutPayload, SendAccountDeletionEmailPayload, CheckPasswordPayload, + DeleteOrgPrincipalPayload, DisconnectAccountPayload, RevokeApiKeyPayload, RevokeSessionPayload, VerifyPasswordPayload, VerifyTotpPayload, ConfirmDeleteAccountPayload, + RevokeOrgApiKeyPayload, SetPasswordPayload, VerifyEmailPayload, ProvisionNewUserPayload, @@ -51,7 +57,9 @@ import type { SignUpPayload, SignInPayload, LinkIdentityPayload, + CreateOrgPrincipalPayload, ExtendTokenExpiresPayload, + CreateOrgApiKeyPayload, CreateApiKeyPayload, RequestCrossOriginTokenPayload, ForgotPasswordPayload, @@ -60,12 +68,14 @@ import type { SignOutPayloadSelect, SendAccountDeletionEmailPayloadSelect, CheckPasswordPayloadSelect, + DeleteOrgPrincipalPayloadSelect, DisconnectAccountPayloadSelect, RevokeApiKeyPayloadSelect, RevokeSessionPayloadSelect, VerifyPasswordPayloadSelect, VerifyTotpPayloadSelect, ConfirmDeleteAccountPayloadSelect, + RevokeOrgApiKeyPayloadSelect, SetPasswordPayloadSelect, VerifyEmailPayloadSelect, ProvisionNewUserPayloadSelect, @@ -76,7 +86,9 @@ import type { SignUpPayloadSelect, SignInPayloadSelect, LinkIdentityPayloadSelect, + CreateOrgPrincipalPayloadSelect, ExtendTokenExpiresPayloadSelect, + CreateOrgApiKeyPayloadSelect, CreateApiKeyPayloadSelect, RequestCrossOriginTokenPayloadSelect, ForgotPasswordPayloadSelect, @@ -93,6 +105,9 @@ export interface SendAccountDeletionEmailVariables { export interface CheckPasswordVariables { input: CheckPasswordInput; } +export interface DeleteOrgPrincipalVariables { + input: DeleteOrgPrincipalInput; +} export interface DisconnectAccountVariables { input: DisconnectAccountInput; } @@ -111,6 +126,9 @@ export interface VerifyTotpVariables { export interface ConfirmDeleteAccountVariables { input: ConfirmDeleteAccountInput; } +export interface RevokeOrgApiKeyVariables { + input: RevokeOrgApiKeyInput; +} export interface SetPasswordVariables { input: SetPasswordInput; } @@ -141,9 +159,15 @@ export interface SignInVariables { export interface LinkIdentityVariables { input: LinkIdentityInput; } +export interface CreateOrgPrincipalVariables { + input: CreateOrgPrincipalInput; +} export interface ExtendTokenExpiresVariables { input: ExtendTokenExpiresInput; } +export interface CreateOrgApiKeyVariables { + input: CreateOrgApiKeyInput; +} export interface CreateApiKeyVariables { input: CreateApiKeyInput; } @@ -255,6 +279,35 @@ export function createMutationOperations(client: OrmClient) { 'CheckPasswordPayload' ), }), + deleteOrgPrincipal: ( + args: DeleteOrgPrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + deleteOrgPrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'DeleteOrgPrincipal', + fieldName: 'deleteOrgPrincipal', + ...buildCustomDocument( + 'mutation', + 'DeleteOrgPrincipal', + 'deleteOrgPrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'DeleteOrgPrincipalInput!', + }, + ], + connectionFieldsMap, + 'DeleteOrgPrincipalPayload' + ), + }), disconnectAccount: ( args: DisconnectAccountVariables, options: { @@ -429,6 +482,35 @@ export function createMutationOperations(client: OrmClient) { 'ConfirmDeleteAccountPayload' ), }), + revokeOrgApiKey: ( + args: RevokeOrgApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + revokeOrgApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'RevokeOrgApiKey', + fieldName: 'revokeOrgApiKey', + ...buildCustomDocument( + 'mutation', + 'RevokeOrgApiKey', + 'revokeOrgApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'RevokeOrgApiKeyInput!', + }, + ], + connectionFieldsMap, + 'RevokeOrgApiKeyPayload' + ), + }), setPassword: ( args: SetPasswordVariables, options: { @@ -719,6 +801,35 @@ export function createMutationOperations(client: OrmClient) { 'LinkIdentityPayload' ), }), + createOrgPrincipal: ( + args: CreateOrgPrincipalVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createOrgPrincipal: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateOrgPrincipal', + fieldName: 'createOrgPrincipal', + ...buildCustomDocument( + 'mutation', + 'CreateOrgPrincipal', + 'createOrgPrincipal', + options.select, + args, + [ + { + name: 'input', + type: 'CreateOrgPrincipalInput!', + }, + ], + connectionFieldsMap, + 'CreateOrgPrincipalPayload' + ), + }), extendTokenExpires: ( args: ExtendTokenExpiresVariables, options: { @@ -748,6 +859,35 @@ export function createMutationOperations(client: OrmClient) { 'ExtendTokenExpiresPayload' ), }), + createOrgApiKey: ( + args: CreateOrgApiKeyVariables, + options: { + select: S; + } & StrictSelect + ) => + new QueryBuilder<{ + createOrgApiKey: InferSelectResult | null; + }>({ + client, + operation: 'mutation', + operationName: 'CreateOrgApiKey', + fieldName: 'createOrgApiKey', + ...buildCustomDocument( + 'mutation', + 'CreateOrgApiKey', + 'createOrgApiKey', + options.select, + args, + [ + { + name: 'input', + type: 'CreateOrgApiKeyInput!', + }, + ], + connectionFieldsMap, + 'CreateOrgApiKeyPayload' + ), + }), createApiKey: ( args: CreateApiKeyVariables, options: { diff --git a/sdk/constructive-sdk/src/auth/orm/query/index.ts b/sdk/constructive-sdk/src/auth/orm/query/index.ts index 408632294d..c91b14032e 100644 --- a/sdk/constructive-sdk/src/auth/orm/query/index.ts +++ b/sdk/constructive-sdk/src/auth/orm/query/index.ts @@ -32,18 +32,18 @@ export function createQueryOperations(client: OrmClient) { undefined ), }), - currentIpAddress: (options?: { select?: Record }) => + currentUserId: (options?: { select?: Record }) => new QueryBuilder<{ - currentIpAddress: string | null; + currentUserId: string | null; }>({ client, operation: 'query', - operationName: 'CurrentIpAddress', - fieldName: 'currentIpAddress', + operationName: 'CurrentUserId', + fieldName: 'currentUserId', ...buildCustomDocument( 'query', - 'CurrentIpAddress', - 'currentIpAddress', + 'CurrentUserId', + 'currentUserId', options?.select, undefined, [], @@ -51,18 +51,18 @@ export function createQueryOperations(client: OrmClient) { undefined ), }), - currentUserId: (options?: { select?: Record }) => + currentIpAddress: (options?: { select?: Record }) => new QueryBuilder<{ - currentUserId: string | null; + currentIpAddress: string | null; }>({ client, operation: 'query', - operationName: 'CurrentUserId', - fieldName: 'currentUserId', + operationName: 'CurrentIpAddress', + fieldName: 'currentIpAddress', ...buildCustomDocument( 'query', - 'CurrentUserId', - 'currentUserId', + 'CurrentIpAddress', + 'currentIpAddress', options?.select, undefined, [], diff --git a/sdk/constructive-sdk/src/compute/orm/README.md b/sdk/constructive-sdk/src/compute/orm/README.md index c266bdfcb7..37af8ed014 100644 --- a/sdk/constructive-sdk/src/compute/orm/README.md +++ b/sdk/constructive-sdk/src/compute/orm/README.md @@ -33,8 +33,8 @@ const db = createClient({ | `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 | +| `functionGraphExecutionNodeState` | findMany, findOne, create, update, delete | | `orgFunctionInvocation` | findMany, findOne, create, update, delete | | `functionInvocation` | findMany, findOne, create, update, delete | | `functionGraphExecution` | findMany, findOne, create, update, delete | @@ -470,85 +470,84 @@ const updated = await db.functionExecutionLog.update({ where: { id: '' }, const deleted = await db.functionExecutionLog.delete({ where: { id: '' } }).execute(); ``` -### `db.functionGraphExecutionNodeState` +### `db.functionGraph` -CRUD operations for FunctionGraphExecutionNodeState records. +CRUD operations for FunctionGraph 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 | +| `storeId` | 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 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(); +// List all functionGraph records +const items = await db.functionGraph.findMany({ select: { id: true, databaseId: true, storeId: 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.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(); +const item = await db.functionGraph.findOne({ id: '', select: { id: true, databaseId: true, storeId: 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.functionGraphExecutionNodeState.create({ data: { executionId: '', databaseId: '', nodeName: '', nodePath: '', status: '', startedAt: '', completedAt: '', errorCode: '', errorMessage: '', outputId: '' }, select: { id: true } }).execute(); +const created = await db.functionGraph.create({ data: { databaseId: '', storeId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); // Update -const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); +const updated = await db.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); +const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); ``` -### `db.functionGraph` +### `db.functionGraphExecutionNodeState` -CRUD operations for FunctionGraph records. +CRUD operations for FunctionGraphExecutionNodeState records. **Fields:** | Field | Type | Editable | |-------|------|----------| +| `createdAt` | Datetime | No | | `id` | UUID | No | +| `executionId` | UUID | Yes | | `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 | +| `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 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(); +// 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.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(); +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.functionGraph.create({ data: { databaseId: '', storeId: '', entityId: '', context: '', name: '', description: '', definitionsCommitId: '', isValid: '', validationErrors: '', createdBy: '' }, select: { id: true } }).execute(); +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.functionGraph.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.functionGraphExecutionNodeState.update({ where: { id: '' }, data: { executionId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.functionGraph.delete({ where: { id: '' } }).execute(); +const deleted = await db.functionGraphExecutionNodeState.delete({ where: { id: '' } }).execute(); ``` ### `db.orgFunctionInvocation` @@ -649,7 +648,6 @@ CRUD operations for FunctionGraphExecution records. | `graphId` | UUID | Yes | | `invocationId` | UUID | Yes | | `databaseId` | UUID | Yes | -| `entityId` | UUID | Yes | | `outputNode` | String | Yes | | `outputPort` | String | Yes | | `status` | String | Yes | @@ -673,13 +671,13 @@ CRUD operations for FunctionGraphExecution records. ```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(); +const items = await db.functionGraphExecution.findMany({ select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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(); +const item = await db.functionGraphExecution.findOne({ id: '', select: { startedAt: true, id: true, graphId: true, invocationId: true, databaseId: 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(); +const created = await db.functionGraphExecution.create({ data: { startedAt: '', graphId: '', invocationId: '', databaseId: '', 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(); @@ -882,49 +880,49 @@ addNodeAndSave const result = await db.mutation.addNodeAndSave({ input: '' }).execute(); ``` -### `db.mutation.addEdge` +### `db.mutation.importGraphJson` -addEdge +importGraphJson - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddEdgeInput (required) | + | `input` | ImportGraphJsonInput (required) | ```typescript -const result = await db.mutation.addEdge({ input: '' }).execute(); +const result = await db.mutation.importGraphJson({ input: '' }).execute(); ``` -### `db.mutation.addNode` +### `db.mutation.addEdge` -addNode +addEdge - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | AddNodeInput (required) | + | `input` | AddEdgeInput (required) | ```typescript -const result = await db.mutation.addNode({ input: '' }).execute(); +const result = await db.mutation.addEdge({ input: '' }).execute(); ``` -### `db.mutation.importGraphJson` +### `db.mutation.addNode` -importGraphJson +addNode - **Type:** mutation - **Arguments:** | Argument | Type | |----------|------| - | `input` | ImportGraphJsonInput (required) | + | `input` | AddNodeInput (required) | ```typescript -const result = await db.mutation.importGraphJson({ input: '' }).execute(); +const result = await db.mutation.addNode({ input: '' }).execute(); ``` ### `db.mutation.insertNodeAtPath` diff --git a/sdk/constructive-sdk/src/compute/orm/index.ts b/sdk/constructive-sdk/src/compute/orm/index.ts index 99193c1d28..818e6503db 100644 --- a/sdk/constructive-sdk/src/compute/orm/index.ts +++ b/sdk/constructive-sdk/src/compute/orm/index.ts @@ -17,8 +17,8 @@ import { FunctionGraphExecutionOutputModel } from './models/functionGraphExecuti 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 { FunctionGraphExecutionNodeStateModel } from './models/functionGraphExecutionNodeState'; import { OrgFunctionInvocationModel } from './models/orgFunctionInvocation'; import { FunctionInvocationModel } from './models/functionInvocation'; import { FunctionGraphExecutionModel } from './models/functionGraphExecution'; @@ -70,8 +70,8 @@ export function createClient(config: OrmClientConfig) { functionGraphCommit: new FunctionGraphCommitModel(client), secretDefinition: new SecretDefinitionModel(client), functionExecutionLog: new FunctionExecutionLogModel(client), - functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), functionGraph: new FunctionGraphModel(client), + functionGraphExecutionNodeState: new FunctionGraphExecutionNodeStateModel(client), orgFunctionInvocation: new OrgFunctionInvocationModel(client), functionInvocation: new FunctionInvocationModel(client), functionGraphExecution: new FunctionGraphExecutionModel(client), diff --git a/sdk/constructive-sdk/src/compute/orm/input-types.ts b/sdk/constructive-sdk/src/compute/orm/input-types.ts index f88c3e77d1..2426122692 100644 --- a/sdk/constructive-sdk/src/compute/orm/input-types.ts +++ b/sdk/constructive-sdk/src/compute/orm/input-types.ts @@ -444,33 +444,6 @@ export interface FunctionExecutionLog { /** 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 */ @@ -479,8 +452,6 @@ export interface FunctionGraph { 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) */ @@ -500,6 +471,33 @@ export interface FunctionGraph { /** Timestamp of last modification */ updatedAt?: 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; +} /** 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) */ @@ -576,8 +574,6 @@ export interface FunctionGraphExecution { 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) */ @@ -702,8 +698,8 @@ export interface FunctionGraphExecutionOutputRelations {} export interface FunctionGraphCommitRelations {} export interface SecretDefinitionRelations {} export interface FunctionExecutionLogRelations {} -export interface FunctionGraphExecutionNodeStateRelations {} export interface FunctionGraphRelations {} +export interface FunctionGraphExecutionNodeStateRelations {} export interface OrgFunctionInvocationRelations {} export interface FunctionInvocationRelations {} export interface FunctionGraphExecutionRelations { @@ -730,9 +726,9 @@ export type FunctionGraphCommitWithRelations = FunctionGraphCommit & FunctionGra export type SecretDefinitionWithRelations = SecretDefinition & SecretDefinitionRelations; export type FunctionExecutionLogWithRelations = FunctionExecutionLog & FunctionExecutionLogRelations; +export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; export type FunctionGraphExecutionNodeStateWithRelations = FunctionGraphExecutionNodeState & FunctionGraphExecutionNodeStateRelations; -export type FunctionGraphWithRelations = FunctionGraph & FunctionGraphRelations; export type OrgFunctionInvocationWithRelations = OrgFunctionInvocation & OrgFunctionInvocationRelations; export type FunctionInvocationWithRelations = FunctionInvocation & FunctionInvocationRelations; @@ -862,25 +858,10 @@ export type FunctionExecutionLogSelect = { 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; @@ -891,6 +872,20 @@ export type FunctionGraphSelect = { createdAt?: boolean; updatedAt?: 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 OrgFunctionInvocationSelect = { createdAt?: boolean; id?: boolean; @@ -930,7 +925,6 @@ export type FunctionGraphExecutionSelect = { graphId?: boolean; invocationId?: boolean; databaseId?: boolean; - entityId?: boolean; outputNode?: boolean; outputPort?: boolean; status?: boolean; @@ -1276,38 +1270,6 @@ export interface 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; @@ -1315,8 +1277,6 @@ export interface FunctionGraphFilter { 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. */ @@ -1342,6 +1302,38 @@ export interface FunctionGraphFilter { /** Negates the expression. */ not?: FunctionGraphFilter; } +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 OrgFunctionInvocationFilter { /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; @@ -1427,8 +1419,6 @@ export interface FunctionGraphExecutionFilter { 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. */ @@ -1777,34 +1767,6 @@ export type FunctionExecutionLogOrderBy = | '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' @@ -1815,8 +1777,6 @@ export type FunctionGraphOrderBy = | 'DATABASE_ID_DESC' | 'STORE_ID_ASC' | 'STORE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'CONTEXT_ASC' | 'CONTEXT_DESC' | 'NAME_ASC' @@ -1835,6 +1795,34 @@ export type FunctionGraphOrderBy = | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_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 OrgFunctionInvocationOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -1915,8 +1903,6 @@ export type FunctionGraphExecutionOrderBy = | 'INVOCATION_ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' - | 'ENTITY_ID_ASC' - | 'ENTITY_ID_DESC' | 'OUTPUT_NODE_ASC' | 'OUTPUT_NODE_DESC' | 'OUTPUT_PORT_ASC' @@ -2350,6 +2336,40 @@ export interface DeleteFunctionExecutionLogInput { clientMutationId?: string; id: string; } +export interface CreateFunctionGraphInput { + clientMutationId?: string; + functionGraph: { + databaseId: string; + storeId: string; + context?: string; + name?: string; + description?: string; + definitionsCommitId: string; + isValid?: boolean; + validationErrors?: Record; + createdBy?: string; + }; +} +export interface FunctionGraphPatch { + databaseId?: string | null; + storeId?: 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 CreateFunctionGraphExecutionNodeStateInput { clientMutationId?: string; functionGraphExecutionNodeState: { @@ -2386,42 +2406,6 @@ 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: { @@ -2511,7 +2495,6 @@ export interface CreateFunctionGraphExecutionInput { graphId: string; invocationId?: string; databaseId: string; - entityId?: string; outputNode: string; outputPort?: string; status?: string; @@ -2537,7 +2520,6 @@ export interface FunctionGraphExecutionPatch { graphId?: string | null; invocationId?: string | null; databaseId?: string | null; - entityId?: string | null; outputNode?: string | null; outputPort?: string | null; status?: string | null; @@ -2695,6 +2677,16 @@ export interface AddNodeAndSaveInput { meta?: Record; message?: string; } +export interface ImportGraphJsonInput { + clientMutationId?: string; + databaseId?: string; + name?: string; + graphJson?: Record; + context?: string; + description?: string; + createdBy?: string; + definitionsCommitId?: string; +} export interface AddEdgeInput { clientMutationId?: string; databaseId?: string; @@ -2717,17 +2709,6 @@ export interface AddNodeInput { 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; @@ -3102,8 +3083,6 @@ export interface FunctionGraphExecutionInput { 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) */ @@ -3680,27 +3659,27 @@ export type AddNodeAndSavePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface AddEdgePayload { +export interface ImportGraphJsonPayload { clientMutationId?: string | null; result?: string | null; } -export type AddEdgePayloadSelect = { +export type ImportGraphJsonPayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface AddNodePayload { +export interface AddEdgePayload { clientMutationId?: string | null; result?: string | null; } -export type AddNodePayloadSelect = { +export type AddEdgePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; -export interface ImportGraphJsonPayload { +export interface AddNodePayload { clientMutationId?: string | null; result?: string | null; } -export type ImportGraphJsonPayloadSelect = { +export type AddNodePayloadSelect = { clientMutationId?: boolean; result?: boolean; }; @@ -4237,6 +4216,44 @@ export type DeleteFunctionExecutionLogPayloadSelect = { select: FunctionExecutionLogEdgeSelect; }; }; +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 CreateFunctionGraphExecutionNodeStatePayload { clientMutationId?: string | null; /** The `FunctionGraphExecutionNodeState` that was created by this mutation. */ @@ -4282,44 +4299,6 @@ export type DeleteFunctionGraphExecutionNodeStatePayloadSelect = { 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. */ @@ -4632,18 +4611,6 @@ export type FunctionExecutionLogEdgeSelect = { 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; @@ -4656,6 +4623,18 @@ export type FunctionGraphEdgeSelect = { select: FunctionGraphSelect; }; }; +/** 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 `OrgFunctionInvocation` edge in the connection. */ export interface OrgFunctionInvocationEdge { cursor?: string | null; diff --git a/sdk/constructive-sdk/src/compute/orm/models/index.ts b/sdk/constructive-sdk/src/compute/orm/models/index.ts index 51e9b9f05d..2d012df7c9 100644 --- a/sdk/constructive-sdk/src/compute/orm/models/index.ts +++ b/sdk/constructive-sdk/src/compute/orm/models/index.ts @@ -15,8 +15,8 @@ export { FunctionGraphExecutionOutputModel } from './functionGraphExecutionOutpu export { FunctionGraphCommitModel } from './functionGraphCommit'; export { SecretDefinitionModel } from './secretDefinition'; export { FunctionExecutionLogModel } from './functionExecutionLog'; -export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; export { FunctionGraphModel } from './functionGraph'; +export { FunctionGraphExecutionNodeStateModel } from './functionGraphExecutionNodeState'; export { OrgFunctionInvocationModel } from './orgFunctionInvocation'; export { FunctionInvocationModel } from './functionInvocation'; export { FunctionGraphExecutionModel } from './functionGraphExecution'; diff --git a/sdk/constructive-sdk/src/compute/orm/mutation/index.ts b/sdk/constructive-sdk/src/compute/orm/mutation/index.ts index b4abf9132b..932f75c399 100644 --- a/sdk/constructive-sdk/src/compute/orm/mutation/index.ts +++ b/sdk/constructive-sdk/src/compute/orm/mutation/index.ts @@ -15,9 +15,9 @@ import type { SaveGraphInput, AddEdgeAndSaveInput, AddNodeAndSaveInput, + ImportGraphJsonInput, AddEdgeInput, AddNodeInput, - ImportGraphJsonInput, InsertNodeAtPathInput, StartExecutionInput, ProvisionBucketInput, @@ -29,9 +29,9 @@ import type { SaveGraphPayload, AddEdgeAndSavePayload, AddNodeAndSavePayload, + ImportGraphJsonPayload, AddEdgePayload, AddNodePayload, - ImportGraphJsonPayload, InsertNodeAtPathPayload, StartExecutionPayload, ProvisionBucketPayload, @@ -43,9 +43,9 @@ import type { SaveGraphPayloadSelect, AddEdgeAndSavePayloadSelect, AddNodeAndSavePayloadSelect, + ImportGraphJsonPayloadSelect, AddEdgePayloadSelect, AddNodePayloadSelect, - ImportGraphJsonPayloadSelect, InsertNodeAtPathPayloadSelect, StartExecutionPayloadSelect, ProvisionBucketPayloadSelect, @@ -75,15 +75,15 @@ export interface AddEdgeAndSaveVariables { export interface AddNodeAndSaveVariables { input: AddNodeAndSaveInput; } +export interface ImportGraphJsonVariables { + input: ImportGraphJsonInput; +} export interface AddEdgeVariables { input: AddEdgeInput; } export interface AddNodeVariables { input: AddNodeInput; } -export interface ImportGraphJsonVariables { - input: ImportGraphJsonInput; -} export interface InsertNodeAtPathVariables { input: InsertNodeAtPathInput; } @@ -334,6 +334,35 @@ export function createMutationOperations(client: OrmClient) { 'AddNodeAndSavePayload' ), }), + 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' + ), + }), addEdge: ( args: AddEdgeVariables, options: { @@ -392,35 +421,6 @@ export function createMutationOperations(client: OrmClient) { '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: { diff --git a/sdk/constructive-sdk/src/modules/README.md b/sdk/constructive-sdk/src/modules/README.md index da85bdefa2..2a6fea3811 100644 --- a/sdk/constructive-sdk/src/modules/README.md +++ b/sdk/constructive-sdk/src/modules/README.md @@ -8,7 +8,7 @@ ## Overview -- **Tables:** 59 +- **Tables:** 60 - **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 495d56755f..91f09623c3 100644 --- a/sdk/constructive-sdk/src/modules/orm/README.md +++ b/sdk/constructive-sdk/src/modules/orm/README.md @@ -47,16 +47,17 @@ const db = createClient({ | `cryptoAuthModule` | findMany, findOne, create, update, delete | | `sessionsModule` | findMany, findOne, create, update, delete | | `secureTableProvision` | findMany, findOne, create, update, delete | -| `merkleStoreModule` | findMany, findOne, create, update, delete | -| `graphModule` | findMany, findOne, create, update, delete | | `databaseProvisionModule` | findMany, findOne, create, update, delete | | `configSecretsModule` | findMany, findOne, create, update, delete | +| `graphModule` | findMany, findOne, create, update, delete | +| `merkleStoreModule` | findMany, findOne, create, update, delete | | `rateLimitMetersModule` | findMany, findOne, create, update, delete | | `realtimeModule` | findMany, findOne, create, update, delete | | `webauthnAuthModule` | findMany, findOne, create, update, delete | | `functionInvocationModule` | findMany, findOne, create, update, delete | | `functionModule` | findMany, findOne, create, update, delete | | `invitesModule` | findMany, findOne, create, update, delete | +| `principalAuthModule` | findMany, findOne, create, update, delete | | `computeLogModule` | findMany, findOne, create, update, delete | | `inferenceLogModule` | findMany, findOne, create, update, delete | | `namespaceModule` | findMany, findOne, create, update, delete | @@ -1053,53 +1054,51 @@ const updated = await db.secureTableProvision.update({ where: { id: '' }, const deleted = await db.secureTableProvision.delete({ where: { id: '' } }).execute(); ``` -### `db.merkleStoreModule` +### `db.databaseProvisionModule` -CRUD operations for MerkleStoreModule records. +CRUD operations for DatabaseProvisionModule records. **Fields:** | Field | Type | Editable | |-------|------|----------| | `id` | UUID | No | +| `databaseName` | String | Yes | +| `ownerId` | UUID | Yes | +| `subdomain` | String | Yes | +| `domain` | String | Yes | +| `modules` | JSON | Yes | +| `options` | JSON | Yes | +| `bootstrapUser` | Boolean | Yes | +| `status` | String | Yes | +| `errorMessage` | String | Yes | | `databaseId` | UUID | Yes | -| `schemaId` | UUID | Yes | -| `privateSchemaId` | UUID | Yes | -| `publicSchemaName` | String | Yes | -| `privateSchemaName` | String | Yes | -| `objectTableId` | UUID | Yes | -| `storeTableId` | UUID | Yes | -| `commitTableId` | UUID | Yes | -| `refTableId` | UUID | Yes | -| `prefix` | String | Yes | -| `apiName` | String | Yes | -| `privateApiName` | String | Yes | -| `scope` | String | Yes | -| `functionPrefix` | String | Yes | | `createdAt` | Datetime | No | +| `updatedAt` | Datetime | No | +| `completedAt` | Datetime | Yes | **Operations:** ```typescript -// List all merkleStoreModule records -const items = await db.merkleStoreModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }).execute(); +// List all databaseProvisionModule records +const items = await db.databaseProvisionModule.findMany({ select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); // Get one by id -const item = await db.merkleStoreModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, createdAt: true } }).execute(); +const item = await db.databaseProvisionModule.findOne({ id: '', select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); // Create -const created = await db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '' }, select: { id: true } }).execute(); +const created = await db.databaseProvisionModule.create({ data: { databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }, select: { id: true } }).execute(); // Update -const updated = await db.merkleStoreModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.databaseProvisionModule.update({ where: { id: '' }, data: { databaseName: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.merkleStoreModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.databaseProvisionModule.delete({ where: { id: '' } }).execute(); ``` -### `db.graphModule` +### `db.configSecretsModule` -CRUD operations for GraphModule records. +CRUD operations for ConfigSecretsModule records. **Fields:** @@ -1107,86 +1106,89 @@ CRUD operations for GraphModule records. |-------|------|----------| | `id` | UUID | No | | `databaseId` | UUID | Yes | -| `publicSchemaId` | UUID | Yes | +| `schemaId` | UUID | Yes | | `privateSchemaId` | UUID | Yes | | `publicSchemaName` | String | Yes | | `privateSchemaName` | String | Yes | -| `scope` | String | Yes | -| `prefix` | String | Yes | -| `merkleStoreModuleId` | UUID | Yes | -| `graphsTableId` | UUID | Yes | +| `tableId` | UUID | Yes | +| `configDefinitionsTableId` | UUID | Yes | +| `tableName` | 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 | -| `createdAt` | Datetime | No | +| `hasConfig` | Boolean | Yes | **Operations:** ```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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +// List all configSecretsModule records +const items = await db.configSecretsModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: 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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); +const item = await db.configSecretsModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); // Create -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(); +const created = await db.configSecretsModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }, select: { id: true } }).execute(); // Update -const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.configSecretsModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.graphModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.configSecretsModule.delete({ where: { id: '' } }).execute(); ``` -### `db.databaseProvisionModule` +### `db.graphModule` -CRUD operations for DatabaseProvisionModule records. +CRUD operations for GraphModule records. **Fields:** | Field | Type | Editable | |-------|------|----------| | `id` | UUID | No | -| `databaseName` | String | Yes | -| `ownerId` | UUID | Yes | -| `subdomain` | String | Yes | -| `domain` | String | Yes | -| `modules` | JSON | Yes | -| `options` | JSON | Yes | -| `bootstrapUser` | Boolean | Yes | -| `status` | String | Yes | -| `errorMessage` | String | Yes | | `databaseId` | UUID | Yes | +| `publicSchemaId` | UUID | Yes | +| `privateSchemaId` | UUID | Yes | +| `publicSchemaName` | String | Yes | +| `privateSchemaName` | String | Yes | +| `scope` | String | Yes | +| `prefix` | String | Yes | +| `merkleStoreModuleId` | UUID | Yes | +| `graphsTableId` | UUID | Yes | +| `apiName` | String | Yes | +| `privateApiName` | String | Yes | +| `entityTableId` | UUID | Yes | +| `policies` | JSON | Yes | +| `provisions` | JSON | Yes | +| `defaultPermissions` | String | Yes | | `createdAt` | Datetime | No | -| `updatedAt` | Datetime | No | -| `completedAt` | Datetime | Yes | **Operations:** ```typescript -// List all databaseProvisionModule records -const items = await db.databaseProvisionModule.findMany({ select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: true } }).execute(); +// 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, apiName: true, privateApiName: true, entityTableId: true, policies: true, provisions: true, defaultPermissions: true, createdAt: true } }).execute(); // Get one by id -const item = await db.databaseProvisionModule.findOne({ id: '', select: { id: true, databaseName: true, ownerId: true, subdomain: true, domain: true, modules: true, options: true, bootstrapUser: true, status: true, errorMessage: true, databaseId: true, createdAt: true, updatedAt: true, completedAt: 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.databaseProvisionModule.create({ data: { databaseName: '', ownerId: '', subdomain: '', domain: '', modules: '', options: '', bootstrapUser: '', status: '', errorMessage: '', databaseId: '', completedAt: '' }, 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.databaseProvisionModule.update({ where: { id: '' }, data: { databaseName: '' }, select: { id: true } }).execute(); +const updated = await db.graphModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.databaseProvisionModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.graphModule.delete({ where: { id: '' } }).execute(); ``` -### `db.configSecretsModule` +### `db.merkleStoreModule` -CRUD operations for ConfigSecretsModule records. +CRUD operations for MerkleStoreModule records. **Fields:** @@ -1198,35 +1200,35 @@ CRUD operations for ConfigSecretsModule records. | `privateSchemaId` | UUID | Yes | | `publicSchemaName` | String | Yes | | `privateSchemaName` | String | Yes | -| `tableId` | UUID | Yes | -| `configDefinitionsTableId` | UUID | Yes | -| `tableName` | String | Yes | +| `objectTableId` | UUID | Yes | +| `storeTableId` | UUID | Yes | +| `commitTableId` | UUID | Yes | +| `refTableId` | UUID | Yes | +| `prefix` | String | Yes | | `apiName` | String | Yes | | `privateApiName` | String | Yes | | `scope` | String | Yes | -| `prefix` | String | Yes | -| `entityTableId` | UUID | Yes | -| `policies` | JSON | Yes | -| `provisions` | JSON | Yes | -| `hasConfig` | Boolean | Yes | +| `functionPrefix` | String | Yes | +| `permissionKey` | String | Yes | +| `createdAt` | Datetime | No | **Operations:** ```typescript -// List all configSecretsModule records -const items = await db.configSecretsModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); +// List all merkleStoreModule records +const items = await db.merkleStoreModule.findMany({ select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }).execute(); // Get one by id -const item = await db.configSecretsModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, tableId: true, configDefinitionsTableId: true, tableName: true, apiName: true, privateApiName: true, scope: true, prefix: true, entityTableId: true, policies: true, provisions: true, hasConfig: true } }).execute(); +const item = await db.merkleStoreModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, privateSchemaId: true, publicSchemaName: true, privateSchemaName: true, objectTableId: true, storeTableId: true, commitTableId: true, refTableId: true, prefix: true, apiName: true, privateApiName: true, scope: true, functionPrefix: true, permissionKey: true, createdAt: true } }).execute(); // Create -const created = await db.configSecretsModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', tableId: '', configDefinitionsTableId: '', tableName: '', apiName: '', privateApiName: '', scope: '', prefix: '', entityTableId: '', policies: '', provisions: '', hasConfig: '' }, select: { id: true } }).execute(); +const created = await db.merkleStoreModule.create({ data: { databaseId: '', schemaId: '', privateSchemaId: '', publicSchemaName: '', privateSchemaName: '', objectTableId: '', storeTableId: '', commitTableId: '', refTableId: '', prefix: '', apiName: '', privateApiName: '', scope: '', functionPrefix: '', permissionKey: '' }, select: { id: true } }).execute(); // Update -const updated = await db.configSecretsModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); +const updated = await db.merkleStoreModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); // Delete -const deleted = await db.configSecretsModule.delete({ where: { id: '' } }).execute(); +const deleted = await db.merkleStoreModule.delete({ where: { id: '' } }).execute(); ``` ### `db.rateLimitMetersModule` @@ -1498,6 +1500,52 @@ const updated = await db.invitesModule.update({ where: { id: '' }, data: { const deleted = await db.invitesModule.delete({ where: { id: '' } }).execute(); ``` +### `db.principalAuthModule` + +CRUD operations for PrincipalAuthModule records. + +**Fields:** + +| Field | Type | Editable | +|-------|------|----------| +| `id` | UUID | No | +| `databaseId` | UUID | Yes | +| `schemaId` | UUID | Yes | +| `principalsTableId` | UUID | Yes | +| `principalEntitiesTableId` | UUID | Yes | +| `principalScopeOverridesTableId` | UUID | Yes | +| `usersTableId` | UUID | Yes | +| `sessionsTableId` | UUID | Yes | +| `sessionCredentialsTableId` | UUID | Yes | +| `auditsTableId` | UUID | Yes | +| `principalsTableName` | String | Yes | +| `createPrincipalFunction` | String | Yes | +| `deletePrincipalFunction` | String | Yes | +| `createOrgPrincipalFunction` | String | Yes | +| `deleteOrgPrincipalFunction` | String | Yes | +| `createOrgApiKeyFunction` | String | Yes | +| `revokeOrgApiKeyFunction` | String | Yes | +| `apiName` | String | Yes | + +**Operations:** + +```typescript +// List all principalAuthModule records +const items = await db.principalAuthModule.findMany({ select: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }).execute(); + +// Get one by id +const item = await db.principalAuthModule.findOne({ id: '', select: { id: true, databaseId: true, schemaId: true, principalsTableId: true, principalEntitiesTableId: true, principalScopeOverridesTableId: true, usersTableId: true, sessionsTableId: true, sessionCredentialsTableId: true, auditsTableId: true, principalsTableName: true, createPrincipalFunction: true, deletePrincipalFunction: true, createOrgPrincipalFunction: true, deleteOrgPrincipalFunction: true, createOrgApiKeyFunction: true, revokeOrgApiKeyFunction: true, apiName: true } }).execute(); + +// Create +const created = await db.principalAuthModule.create({ data: { databaseId: '', schemaId: '', principalsTableId: '', principalEntitiesTableId: '', principalScopeOverridesTableId: '', usersTableId: '', sessionsTableId: '', sessionCredentialsTableId: '', auditsTableId: '', principalsTableName: '', createPrincipalFunction: '', deletePrincipalFunction: '', createOrgPrincipalFunction: '', deleteOrgPrincipalFunction: '', createOrgApiKeyFunction: '', revokeOrgApiKeyFunction: '', apiName: '' }, select: { id: true } }).execute(); + +// Update +const updated = await db.principalAuthModule.update({ where: { id: '' }, data: { databaseId: '' }, select: { id: true } }).execute(); + +// Delete +const deleted = await db.principalAuthModule.delete({ where: { id: '' } }).execute(); +``` + ### `db.computeLogModule` CRUD operations for ComputeLogModule records. diff --git a/sdk/constructive-sdk/src/modules/orm/index.ts b/sdk/constructive-sdk/src/modules/orm/index.ts index 7c5a882c52..592de14627 100644 --- a/sdk/constructive-sdk/src/modules/orm/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/index.ts @@ -31,16 +31,17 @@ import { BlueprintConstructionModel } from './models/blueprintConstruction'; import { CryptoAuthModuleModel } from './models/cryptoAuthModule'; import { SessionsModuleModel } from './models/sessionsModule'; import { SecureTableProvisionModel } from './models/secureTableProvision'; -import { MerkleStoreModuleModel } from './models/merkleStoreModule'; -import { GraphModuleModel } from './models/graphModule'; import { DatabaseProvisionModuleModel } from './models/databaseProvisionModule'; import { ConfigSecretsModuleModel } from './models/configSecretsModule'; +import { GraphModuleModel } from './models/graphModule'; +import { MerkleStoreModuleModel } from './models/merkleStoreModule'; import { RateLimitMetersModuleModel } from './models/rateLimitMetersModule'; import { RealtimeModuleModel } from './models/realtimeModule'; import { WebauthnAuthModuleModel } from './models/webauthnAuthModule'; import { FunctionInvocationModuleModel } from './models/functionInvocationModule'; import { FunctionModuleModel } from './models/functionModule'; import { InvitesModuleModel } from './models/invitesModule'; +import { PrincipalAuthModuleModel } from './models/principalAuthModule'; import { ComputeLogModuleModel } from './models/computeLogModule'; import { InferenceLogModuleModel } from './models/inferenceLogModule'; import { NamespaceModuleModel } from './models/namespaceModule'; @@ -125,16 +126,17 @@ export function createClient(config: OrmClientConfig) { cryptoAuthModule: new CryptoAuthModuleModel(client), sessionsModule: new SessionsModuleModel(client), secureTableProvision: new SecureTableProvisionModel(client), - merkleStoreModule: new MerkleStoreModuleModel(client), - graphModule: new GraphModuleModel(client), databaseProvisionModule: new DatabaseProvisionModuleModel(client), configSecretsModule: new ConfigSecretsModuleModel(client), + graphModule: new GraphModuleModel(client), + merkleStoreModule: new MerkleStoreModuleModel(client), rateLimitMetersModule: new RateLimitMetersModuleModel(client), realtimeModule: new RealtimeModuleModel(client), webauthnAuthModule: new WebauthnAuthModuleModel(client), functionInvocationModule: new FunctionInvocationModuleModel(client), functionModule: new FunctionModuleModel(client), invitesModule: new InvitesModuleModel(client), + principalAuthModule: new PrincipalAuthModuleModel(client), computeLogModule: new ComputeLogModuleModel(client), inferenceLogModule: new InferenceLogModuleModel(client), namespaceModule: new NamespaceModuleModel(client), diff --git a/sdk/constructive-sdk/src/modules/orm/input-types.ts b/sdk/constructive-sdk/src/modules/orm/input-types.ts index ddd8bf6a34..4d52180d99 100644 --- a/sdk/constructive-sdk/src/modules/orm/input-types.ts +++ b/sdk/constructive-sdk/src/modules/orm/input-types.ts @@ -606,43 +606,6 @@ export interface SecureTableProvision { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[] | null; } -export interface MerkleStoreModule { - id: string; - databaseId?: string | null; - schemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - objectTableId?: string | null; - storeTableId?: string | null; - commitTableId?: string | null; - refTableId?: string | null; - prefix?: string | null; - apiName?: string | null; - privateApiName?: string | null; - scope?: string | null; - functionPrefix?: string | null; - createdAt?: string | null; -} -export interface GraphModule { - id: string; - databaseId?: string | null; - publicSchemaId?: string | null; - privateSchemaId?: string | null; - publicSchemaName?: string | null; - privateSchemaName?: string | null; - scope?: string | null; - prefix?: string | null; - merkleStoreModuleId?: string | null; - graphsTableId?: string | null; - apiName?: string | null; - privateApiName?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - defaultPermissions?: string[] | null; - createdAt?: string | null; -} /** Tracks database provisioning requests and their status. The BEFORE INSERT trigger creates the database and sets database_id before RLS policies are evaluated. */ export interface DatabaseProvisionModule { id: string; @@ -693,6 +656,44 @@ export interface ConfigSecretsModule { provisions?: Record | null; hasConfig?: boolean | null; } +export interface GraphModule { + id: string; + databaseId?: string | null; + publicSchemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + scope?: string | null; + prefix?: string | null; + merkleStoreModuleId?: string | null; + graphsTableId?: 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 MerkleStoreModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + privateSchemaId?: string | null; + publicSchemaName?: string | null; + privateSchemaName?: string | null; + objectTableId?: string | null; + storeTableId?: string | null; + commitTableId?: string | null; + refTableId?: string | null; + prefix?: string | null; + apiName?: string | null; + privateApiName?: string | null; + scope?: string | null; + functionPrefix?: string | null; + permissionKey?: string | null; + createdAt?: string | null; +} export interface RateLimitMetersModule { id: string; databaseId?: string | null; @@ -806,6 +807,27 @@ export interface InvitesModule { apiName?: string | null; privateApiName?: string | null; } +/** Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database. */ +export interface PrincipalAuthModule { + id: string; + databaseId?: string | null; + schemaId?: string | null; + principalsTableId?: string | null; + principalEntitiesTableId?: string | null; + principalScopeOverridesTableId?: string | null; + usersTableId?: string | null; + sessionsTableId?: string | null; + sessionCredentialsTableId?: string | null; + auditsTableId?: string | null; + principalsTableName?: string | null; + createPrincipalFunction?: string | null; + deletePrincipalFunction?: string | null; + createOrgPrincipalFunction?: string | null; + deleteOrgPrincipalFunction?: string | null; + createOrgApiKeyFunction?: string | null; + revokeOrgApiKeyFunction?: string | null; + apiName?: string | null; +} export interface ComputeLogModule { id: string; databaseId?: string | null; @@ -1831,20 +1853,21 @@ export interface BlueprintConstructionRelations { export interface CryptoAuthModuleRelations {} export interface SessionsModuleRelations {} export interface SecureTableProvisionRelations {} -export interface MerkleStoreModuleRelations { - graphModules?: ConnectionResult; -} +export interface DatabaseProvisionModuleRelations {} +export interface ConfigSecretsModuleRelations {} export interface GraphModuleRelations { merkleStoreModule?: MerkleStoreModule | null; } -export interface DatabaseProvisionModuleRelations {} -export interface ConfigSecretsModuleRelations {} +export interface MerkleStoreModuleRelations { + graphModules?: ConnectionResult; +} export interface RateLimitMetersModuleRelations {} export interface RealtimeModuleRelations {} export interface WebauthnAuthModuleRelations {} export interface FunctionInvocationModuleRelations {} export interface FunctionModuleRelations {} export interface InvitesModuleRelations {} +export interface PrincipalAuthModuleRelations {} export interface ComputeLogModuleRelations {} export interface InferenceLogModuleRelations {} export interface NamespaceModuleRelations {} @@ -1912,11 +1935,11 @@ export type CryptoAuthModuleWithRelations = CryptoAuthModule & CryptoAuthModuleR export type SessionsModuleWithRelations = SessionsModule & SessionsModuleRelations; export type SecureTableProvisionWithRelations = SecureTableProvision & SecureTableProvisionRelations; -export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; -export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; export type DatabaseProvisionModuleWithRelations = DatabaseProvisionModule & DatabaseProvisionModuleRelations; export type ConfigSecretsModuleWithRelations = ConfigSecretsModule & ConfigSecretsModuleRelations; +export type GraphModuleWithRelations = GraphModule & GraphModuleRelations; +export type MerkleStoreModuleWithRelations = MerkleStoreModule & MerkleStoreModuleRelations; export type RateLimitMetersModuleWithRelations = RateLimitMetersModule & RateLimitMetersModuleRelations; export type RealtimeModuleWithRelations = RealtimeModule & RealtimeModuleRelations; @@ -1925,6 +1948,7 @@ export type FunctionInvocationModuleWithRelations = FunctionInvocationModule & FunctionInvocationModuleRelations; export type FunctionModuleWithRelations = FunctionModule & FunctionModuleRelations; export type InvitesModuleWithRelations = InvitesModule & InvitesModuleRelations; +export type PrincipalAuthModuleWithRelations = PrincipalAuthModule & PrincipalAuthModuleRelations; export type ComputeLogModuleWithRelations = ComputeLogModule & ComputeLogModuleRelations; export type InferenceLogModuleWithRelations = InferenceLogModule & InferenceLogModuleRelations; export type NamespaceModuleWithRelations = NamespaceModule & NamespaceModuleRelations; @@ -2273,29 +2297,40 @@ export type SecureTableProvisionSelect = { policies?: boolean; outFields?: boolean; }; -export type MerkleStoreModuleSelect = { +export type DatabaseProvisionModuleSelect = { + id?: boolean; + databaseName?: boolean; + ownerId?: boolean; + subdomain?: boolean; + domain?: boolean; + modules?: boolean; + options?: boolean; + bootstrapUser?: boolean; + status?: boolean; + errorMessage?: boolean; + databaseId?: boolean; + createdAt?: boolean; + updatedAt?: boolean; + completedAt?: boolean; +}; +export type ConfigSecretsModuleSelect = { id?: boolean; databaseId?: boolean; schemaId?: boolean; privateSchemaId?: boolean; publicSchemaName?: boolean; privateSchemaName?: boolean; - objectTableId?: boolean; - storeTableId?: boolean; - commitTableId?: boolean; - refTableId?: boolean; - prefix?: boolean; + tableId?: boolean; + configDefinitionsTableId?: boolean; + tableName?: boolean; apiName?: boolean; privateApiName?: boolean; scope?: boolean; - functionPrefix?: boolean; - createdAt?: boolean; - graphModules?: { - select: GraphModuleSelect; - first?: number; - filter?: GraphModuleFilter; - orderBy?: GraphModuleOrderBy[]; - }; + prefix?: boolean; + entityTableId?: boolean; + policies?: boolean; + provisions?: boolean; + hasConfig?: boolean; }; export type GraphModuleSelect = { id?: boolean; @@ -2319,40 +2354,30 @@ export type GraphModuleSelect = { select: MerkleStoreModuleSelect; }; }; -export type DatabaseProvisionModuleSelect = { - id?: boolean; - databaseName?: boolean; - ownerId?: boolean; - subdomain?: boolean; - domain?: boolean; - modules?: boolean; - options?: boolean; - bootstrapUser?: boolean; - status?: boolean; - errorMessage?: boolean; - databaseId?: boolean; - createdAt?: boolean; - updatedAt?: boolean; - completedAt?: boolean; -}; -export type ConfigSecretsModuleSelect = { +export type MerkleStoreModuleSelect = { id?: boolean; databaseId?: boolean; schemaId?: boolean; privateSchemaId?: boolean; publicSchemaName?: boolean; privateSchemaName?: boolean; - tableId?: boolean; - configDefinitionsTableId?: boolean; - tableName?: boolean; + objectTableId?: boolean; + storeTableId?: boolean; + commitTableId?: boolean; + refTableId?: boolean; + prefix?: boolean; apiName?: boolean; privateApiName?: boolean; scope?: boolean; - prefix?: boolean; - entityTableId?: boolean; - policies?: boolean; - provisions?: boolean; - hasConfig?: boolean; + functionPrefix?: boolean; + permissionKey?: boolean; + createdAt?: boolean; + graphModules?: { + select: GraphModuleSelect; + first?: number; + filter?: GraphModuleFilter; + orderBy?: GraphModuleOrderBy[]; + }; }; export type RateLimitMetersModuleSelect = { id?: boolean; @@ -2467,6 +2492,26 @@ export type InvitesModuleSelect = { apiName?: boolean; privateApiName?: boolean; }; +export type PrincipalAuthModuleSelect = { + id?: boolean; + databaseId?: boolean; + schemaId?: boolean; + principalsTableId?: boolean; + principalEntitiesTableId?: boolean; + principalScopeOverridesTableId?: boolean; + usersTableId?: boolean; + sessionsTableId?: boolean; + sessionCredentialsTableId?: boolean; + auditsTableId?: boolean; + principalsTableName?: boolean; + createPrincipalFunction?: boolean; + deletePrincipalFunction?: boolean; + createOrgPrincipalFunction?: boolean; + deleteOrgPrincipalFunction?: boolean; + createOrgApiKeyFunction?: boolean; + revokeOrgApiKeyFunction?: boolean; + apiName?: boolean; +}; export type ComputeLogModuleSelect = { id?: boolean; databaseId?: boolean; @@ -3841,7 +3886,43 @@ export interface SecureTableProvisionFilter { /** Negates the expression. */ not?: SecureTableProvisionFilter; } -export interface MerkleStoreModuleFilter { +export interface DatabaseProvisionModuleFilter { + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `databaseName` field. */ + databaseName?: StringFilter; + /** Filter by the object’s `ownerId` field. */ + ownerId?: UUIDFilter; + /** Filter by the object’s `subdomain` field. */ + subdomain?: StringFilter; + /** Filter by the object’s `domain` field. */ + domain?: StringFilter; + /** Filter by the object’s `modules` field. */ + modules?: JSONFilter; + /** Filter by the object’s `options` field. */ + options?: JSONFilter; + /** Filter by the object’s `bootstrapUser` field. */ + bootstrapUser?: BooleanFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `errorMessage` field. */ + errorMessage?: StringFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: DatabaseProvisionModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: DatabaseProvisionModuleFilter[]; + /** Negates the expression. */ + not?: DatabaseProvisionModuleFilter; +} +export interface ConfigSecretsModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -3854,36 +3935,34 @@ export interface MerkleStoreModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `objectTableId` field. */ - objectTableId?: UUIDFilter; - /** Filter by the object’s `storeTableId` field. */ - storeTableId?: UUIDFilter; - /** Filter by the object’s `commitTableId` field. */ - commitTableId?: UUIDFilter; - /** Filter by the object’s `refTableId` field. */ - refTableId?: UUIDFilter; - /** Filter by the object’s `prefix` field. */ - prefix?: StringFilter; + /** Filter by the object’s `tableId` field. */ + tableId?: UUIDFilter; + /** Filter by the object’s `configDefinitionsTableId` field. */ + configDefinitionsTableId?: UUIDFilter; + /** Filter by the object’s `tableName` field. */ + tableName?: 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 `functionPrefix` field. */ - functionPrefix?: StringFilter; - /** Filter by the object’s `createdAt` field. */ - createdAt?: DatetimeFilter; + /** 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 `hasConfig` field. */ + hasConfig?: BooleanFilter; /** Checks for all expressions in this list. */ - and?: MerkleStoreModuleFilter[]; + and?: ConfigSecretsModuleFilter[]; /** Checks for any expressions in this list. */ - or?: MerkleStoreModuleFilter[]; + or?: ConfigSecretsModuleFilter[]; /** Negates the expression. */ - not?: MerkleStoreModuleFilter; - /** Filter by the object’s `graphModules` relation. */ - graphModules?: MerkleStoreModuleToManyGraphModuleFilter; - /** `graphModules` exist. */ - graphModulesExist?: boolean; + not?: ConfigSecretsModuleFilter; } export interface GraphModuleFilter { /** Filter by the object’s `id` field. */ @@ -3929,43 +4008,7 @@ export interface GraphModuleFilter { /** Filter by the object’s `merkleStoreModule` relation. */ merkleStoreModule?: MerkleStoreModuleFilter; } -export interface DatabaseProvisionModuleFilter { - /** Filter by the object’s `id` field. */ - id?: UUIDFilter; - /** Filter by the object’s `databaseName` field. */ - databaseName?: StringFilter; - /** Filter by the object’s `ownerId` field. */ - ownerId?: UUIDFilter; - /** Filter by the object’s `subdomain` field. */ - subdomain?: StringFilter; - /** Filter by the object’s `domain` field. */ - domain?: StringFilter; - /** Filter by the object’s `modules` field. */ - modules?: JSONFilter; - /** Filter by the object’s `options` field. */ - options?: JSONFilter; - /** Filter by the object’s `bootstrapUser` field. */ - bootstrapUser?: BooleanFilter; - /** Filter by the object’s `status` field. */ - status?: StringFilter; - /** Filter by the object’s `errorMessage` field. */ - errorMessage?: StringFilter; - /** Filter by the object’s `databaseId` field. */ - databaseId?: UUIDFilter; - /** Filter by the object’s `createdAt` field. */ - createdAt?: DatetimeFilter; - /** Filter by the object’s `updatedAt` field. */ - updatedAt?: DatetimeFilter; - /** Filter by the object’s `completedAt` field. */ - completedAt?: DatetimeFilter; - /** Checks for all expressions in this list. */ - and?: DatabaseProvisionModuleFilter[]; - /** Checks for any expressions in this list. */ - or?: DatabaseProvisionModuleFilter[]; - /** Negates the expression. */ - not?: DatabaseProvisionModuleFilter; -} -export interface ConfigSecretsModuleFilter { +export interface MerkleStoreModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; /** Filter by the object’s `databaseId` field. */ @@ -3978,34 +4021,38 @@ export interface ConfigSecretsModuleFilter { publicSchemaName?: StringFilter; /** Filter by the object’s `privateSchemaName` field. */ privateSchemaName?: StringFilter; - /** Filter by the object’s `tableId` field. */ - tableId?: UUIDFilter; - /** Filter by the object’s `configDefinitionsTableId` field. */ - configDefinitionsTableId?: UUIDFilter; - /** Filter by the object’s `tableName` field. */ - tableName?: StringFilter; + /** Filter by the object’s `objectTableId` field. */ + objectTableId?: UUIDFilter; + /** Filter by the object’s `storeTableId` field. */ + storeTableId?: UUIDFilter; + /** Filter by the object’s `commitTableId` field. */ + commitTableId?: UUIDFilter; + /** Filter by the object’s `refTableId` field. */ + refTableId?: 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; /** 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 `hasConfig` field. */ - hasConfig?: BooleanFilter; + /** Filter by the object’s `functionPrefix` field. */ + functionPrefix?: StringFilter; + /** Filter by the object’s `permissionKey` field. */ + permissionKey?: StringFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; /** Checks for all expressions in this list. */ - and?: ConfigSecretsModuleFilter[]; + and?: MerkleStoreModuleFilter[]; /** Checks for any expressions in this list. */ - or?: ConfigSecretsModuleFilter[]; + or?: MerkleStoreModuleFilter[]; /** Negates the expression. */ - not?: ConfigSecretsModuleFilter; + not?: MerkleStoreModuleFilter; + /** Filter by the object’s `graphModules` relation. */ + graphModules?: MerkleStoreModuleToManyGraphModuleFilter; + /** `graphModules` exist. */ + graphModulesExist?: boolean; } export interface RateLimitMetersModuleFilter { /** Filter by the object’s `id` field. */ @@ -4257,6 +4304,50 @@ export interface InvitesModuleFilter { /** Negates the expression. */ not?: InvitesModuleFilter; } +export interface PrincipalAuthModuleFilter { + /** 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 `principalsTableId` field. */ + principalsTableId?: UUIDFilter; + /** Filter by the object’s `principalEntitiesTableId` field. */ + principalEntitiesTableId?: UUIDFilter; + /** Filter by the object’s `principalScopeOverridesTableId` field. */ + principalScopeOverridesTableId?: UUIDFilter; + /** Filter by the object’s `usersTableId` field. */ + usersTableId?: UUIDFilter; + /** Filter by the object’s `sessionsTableId` field. */ + sessionsTableId?: UUIDFilter; + /** Filter by the object’s `sessionCredentialsTableId` field. */ + sessionCredentialsTableId?: UUIDFilter; + /** Filter by the object’s `auditsTableId` field. */ + auditsTableId?: UUIDFilter; + /** Filter by the object’s `principalsTableName` field. */ + principalsTableName?: StringFilter; + /** Filter by the object’s `createPrincipalFunction` field. */ + createPrincipalFunction?: StringFilter; + /** Filter by the object’s `deletePrincipalFunction` field. */ + deletePrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgPrincipalFunction` field. */ + createOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `deleteOrgPrincipalFunction` field. */ + deleteOrgPrincipalFunction?: StringFilter; + /** Filter by the object’s `createOrgApiKeyFunction` field. */ + createOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `revokeOrgApiKeyFunction` field. */ + revokeOrgApiKeyFunction?: StringFilter; + /** Filter by the object’s `apiName` field. */ + apiName?: StringFilter; + /** Checks for all expressions in this list. */ + and?: PrincipalAuthModuleFilter[]; + /** Checks for any expressions in this list. */ + or?: PrincipalAuthModuleFilter[]; + /** Negates the expression. */ + not?: PrincipalAuthModuleFilter; +} export interface ComputeLogModuleFilter { /** Filter by the object’s `id` field. */ id?: UUIDFilter; @@ -6248,7 +6339,39 @@ export type SecureTableProvisionOrderBy = | 'POLICIES_DESC' | 'OUT_FIELDS_ASC' | 'OUT_FIELDS_DESC'; -export type MerkleStoreModuleOrderBy = +export type DatabaseProvisionModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_NAME_ASC' + | 'DATABASE_NAME_DESC' + | 'OWNER_ID_ASC' + | 'OWNER_ID_DESC' + | 'SUBDOMAIN_ASC' + | 'SUBDOMAIN_DESC' + | 'DOMAIN_ASC' + | 'DOMAIN_DESC' + | 'MODULES_ASC' + | 'MODULES_DESC' + | 'OPTIONS_ASC' + | 'OPTIONS_DESC' + | 'BOOTSTRAP_USER_ASC' + | 'BOOTSTRAP_USER_DESC' + | 'STATUS_ASC' + | 'STATUS_DESC' + | 'ERROR_MESSAGE_ASC' + | 'ERROR_MESSAGE_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC' + | 'UPDATED_AT_ASC' + | 'UPDATED_AT_DESC' + | 'COMPLETED_AT_ASC' + | 'COMPLETED_AT_DESC'; +export type ConfigSecretsModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' @@ -6264,26 +6387,28 @@ export type MerkleStoreModuleOrderBy = | 'PUBLIC_SCHEMA_NAME_DESC' | 'PRIVATE_SCHEMA_NAME_ASC' | 'PRIVATE_SCHEMA_NAME_DESC' - | 'OBJECT_TABLE_ID_ASC' - | 'OBJECT_TABLE_ID_DESC' - | 'STORE_TABLE_ID_ASC' - | 'STORE_TABLE_ID_DESC' - | 'COMMIT_TABLE_ID_ASC' - | 'COMMIT_TABLE_ID_DESC' - | 'REF_TABLE_ID_ASC' - | 'REF_TABLE_ID_DESC' - | 'PREFIX_ASC' - | 'PREFIX_DESC' + | 'TABLE_ID_ASC' + | 'TABLE_ID_DESC' + | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' + | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' + | 'TABLE_NAME_ASC' + | 'TABLE_NAME_DESC' | 'API_NAME_ASC' | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC' | 'SCOPE_ASC' | 'SCOPE_DESC' - | 'FUNCTION_PREFIX_ASC' - | 'FUNCTION_PREFIX_DESC' - | 'CREATED_AT_ASC' - | 'CREATED_AT_DESC'; + | 'PREFIX_ASC' + | 'PREFIX_DESC' + | 'ENTITY_TABLE_ID_ASC' + | 'ENTITY_TABLE_ID_DESC' + | 'POLICIES_ASC' + | 'POLICIES_DESC' + | 'PROVISIONS_ASC' + | 'PROVISIONS_DESC' + | 'HAS_CONFIG_ASC' + | 'HAS_CONFIG_DESC'; export type GraphModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6322,39 +6447,7 @@ export type GraphModuleOrderBy = | 'DEFAULT_PERMISSIONS_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC'; -export type DatabaseProvisionModuleOrderBy = - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC' - | 'ID_ASC' - | 'ID_DESC' - | 'DATABASE_NAME_ASC' - | 'DATABASE_NAME_DESC' - | 'OWNER_ID_ASC' - | 'OWNER_ID_DESC' - | 'SUBDOMAIN_ASC' - | 'SUBDOMAIN_DESC' - | 'DOMAIN_ASC' - | 'DOMAIN_DESC' - | 'MODULES_ASC' - | 'MODULES_DESC' - | 'OPTIONS_ASC' - | 'OPTIONS_DESC' - | 'BOOTSTRAP_USER_ASC' - | 'BOOTSTRAP_USER_DESC' - | 'STATUS_ASC' - | 'STATUS_DESC' - | 'ERROR_MESSAGE_ASC' - | 'ERROR_MESSAGE_DESC' - | 'DATABASE_ID_ASC' - | 'DATABASE_ID_DESC' - | 'CREATED_AT_ASC' - | 'CREATED_AT_DESC' - | 'UPDATED_AT_ASC' - | 'UPDATED_AT_DESC' - | 'COMPLETED_AT_ASC' - | 'COMPLETED_AT_DESC'; -export type ConfigSecretsModuleOrderBy = +export type MerkleStoreModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' @@ -6370,28 +6463,28 @@ export type ConfigSecretsModuleOrderBy = | 'PUBLIC_SCHEMA_NAME_DESC' | 'PRIVATE_SCHEMA_NAME_ASC' | 'PRIVATE_SCHEMA_NAME_DESC' - | 'TABLE_ID_ASC' - | 'TABLE_ID_DESC' - | 'CONFIG_DEFINITIONS_TABLE_ID_ASC' - | 'CONFIG_DEFINITIONS_TABLE_ID_DESC' - | 'TABLE_NAME_ASC' - | 'TABLE_NAME_DESC' + | 'OBJECT_TABLE_ID_ASC' + | 'OBJECT_TABLE_ID_DESC' + | 'STORE_TABLE_ID_ASC' + | 'STORE_TABLE_ID_DESC' + | 'COMMIT_TABLE_ID_ASC' + | 'COMMIT_TABLE_ID_DESC' + | 'REF_TABLE_ID_ASC' + | 'REF_TABLE_ID_DESC' + | 'PREFIX_ASC' + | 'PREFIX_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' - | 'HAS_CONFIG_ASC' - | 'HAS_CONFIG_DESC'; + | 'FUNCTION_PREFIX_ASC' + | 'FUNCTION_PREFIX_DESC' + | 'PERMISSION_KEY_ASC' + | 'PERMISSION_KEY_DESC' + | 'CREATED_AT_ASC' + | 'CREATED_AT_DESC'; export type RateLimitMetersModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -6618,6 +6711,46 @@ export type InvitesModuleOrderBy = | 'API_NAME_DESC' | 'PRIVATE_API_NAME_ASC' | 'PRIVATE_API_NAME_DESC'; +export type PrincipalAuthModuleOrderBy = + | 'NATURAL' + | 'PRIMARY_KEY_ASC' + | 'PRIMARY_KEY_DESC' + | 'ID_ASC' + | 'ID_DESC' + | 'DATABASE_ID_ASC' + | 'DATABASE_ID_DESC' + | 'SCHEMA_ID_ASC' + | 'SCHEMA_ID_DESC' + | 'PRINCIPALS_TABLE_ID_ASC' + | 'PRINCIPALS_TABLE_ID_DESC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_ASC' + | 'PRINCIPAL_ENTITIES_TABLE_ID_DESC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_ASC' + | 'PRINCIPAL_SCOPE_OVERRIDES_TABLE_ID_DESC' + | 'USERS_TABLE_ID_ASC' + | 'USERS_TABLE_ID_DESC' + | 'SESSIONS_TABLE_ID_ASC' + | 'SESSIONS_TABLE_ID_DESC' + | 'SESSION_CREDENTIALS_TABLE_ID_ASC' + | 'SESSION_CREDENTIALS_TABLE_ID_DESC' + | 'AUDITS_TABLE_ID_ASC' + | 'AUDITS_TABLE_ID_DESC' + | 'PRINCIPALS_TABLE_NAME_ASC' + | 'PRINCIPALS_TABLE_NAME_DESC' + | 'CREATE_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'CREATE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_ASC' + | 'DELETE_ORG_PRINCIPAL_FUNCTION_DESC' + | 'CREATE_ORG_API_KEY_FUNCTION_ASC' + | 'CREATE_ORG_API_KEY_FUNCTION_DESC' + | 'REVOKE_ORG_API_KEY_FUNCTION_ASC' + | 'REVOKE_ORG_API_KEY_FUNCTION_DESC' + | 'API_NAME_ASC' + | 'API_NAME_DESC'; export type ComputeLogModuleOrderBy = | 'NATURAL' | 'PRIMARY_KEY_ASC' @@ -8755,47 +8888,89 @@ export interface DeleteSecureTableProvisionInput { clientMutationId?: string; id: string; } -export interface CreateMerkleStoreModuleInput { +export interface CreateDatabaseProvisionModuleInput { clientMutationId?: string; - merkleStoreModule: { - databaseId: string; - schemaId?: string; + databaseProvisionModule: { + databaseName: string; + ownerId: string; + subdomain?: string; + domain: string; + modules?: Record; + options?: Record; + bootstrapUser?: boolean; + status?: string; + errorMessage?: string; + databaseId?: string; + completedAt?: string; + }; +} +export interface DatabaseProvisionModulePatch { + databaseName?: string | null; + ownerId?: string | null; + subdomain?: string | null; + domain?: string | null; + modules?: Record | null; + options?: Record | null; + bootstrapUser?: boolean | null; + status?: string | null; + errorMessage?: string | null; + databaseId?: string | null; + completedAt?: string | null; +} +export interface UpdateDatabaseProvisionModuleInput { + clientMutationId?: string; + id: string; + databaseProvisionModulePatch: DatabaseProvisionModulePatch; +} +export interface DeleteDatabaseProvisionModuleInput { + clientMutationId?: string; + id: string; +} +export interface CreateConfigSecretsModuleInput { + clientMutationId?: string; + configSecretsModule: { + databaseId: string; + schemaId?: string; privateSchemaId?: string; publicSchemaName?: string; privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; + tableId?: string; + configDefinitionsTableId?: string; + tableName?: string; apiName?: string; privateApiName?: string; scope?: string; - functionPrefix?: string; + prefix?: string; + entityTableId?: string; + policies?: Record; + provisions?: Record; + hasConfig?: boolean; }; } -export interface MerkleStoreModulePatch { +export interface ConfigSecretsModulePatch { databaseId?: string | null; schemaId?: string | null; privateSchemaId?: string | null; publicSchemaName?: string | null; privateSchemaName?: string | null; - objectTableId?: string | null; - storeTableId?: string | null; - commitTableId?: string | null; - refTableId?: string | null; - prefix?: string | null; + tableId?: string | null; + configDefinitionsTableId?: string | null; + tableName?: string | null; apiName?: string | null; privateApiName?: string | null; scope?: string | null; - functionPrefix?: string | null; + prefix?: string | null; + entityTableId?: string | null; + policies?: Record | null; + provisions?: Record | null; + hasConfig?: boolean | null; } -export interface UpdateMerkleStoreModuleInput { +export interface UpdateConfigSecretsModuleInput { clientMutationId?: string; id: string; - merkleStoreModulePatch: MerkleStoreModulePatch; + configSecretsModulePatch: ConfigSecretsModulePatch; } -export interface DeleteMerkleStoreModuleInput { +export interface DeleteConfigSecretsModuleInput { clientMutationId?: string; id: string; } @@ -8845,89 +9020,49 @@ export interface DeleteGraphModuleInput { clientMutationId?: string; id: string; } -export interface CreateDatabaseProvisionModuleInput { - clientMutationId?: string; - databaseProvisionModule: { - databaseName: string; - ownerId: string; - subdomain?: string; - domain: string; - modules?: Record; - options?: Record; - bootstrapUser?: boolean; - status?: string; - errorMessage?: string; - databaseId?: string; - completedAt?: string; - }; -} -export interface DatabaseProvisionModulePatch { - databaseName?: string | null; - ownerId?: string | null; - subdomain?: string | null; - domain?: string | null; - modules?: Record | null; - options?: Record | null; - bootstrapUser?: boolean | null; - status?: string | null; - errorMessage?: string | null; - databaseId?: string | null; - completedAt?: string | null; -} -export interface UpdateDatabaseProvisionModuleInput { - clientMutationId?: string; - id: string; - databaseProvisionModulePatch: DatabaseProvisionModulePatch; -} -export interface DeleteDatabaseProvisionModuleInput { - clientMutationId?: string; - id: string; -} -export interface CreateConfigSecretsModuleInput { +export interface CreateMerkleStoreModuleInput { clientMutationId?: string; - configSecretsModule: { + merkleStoreModule: { databaseId: string; schemaId?: string; privateSchemaId?: string; publicSchemaName?: string; privateSchemaName?: string; - tableId?: string; - configDefinitionsTableId?: string; - tableName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; apiName?: string; privateApiName?: string; scope?: string; - prefix?: string; - entityTableId?: string; - policies?: Record; - provisions?: Record; - hasConfig?: boolean; + functionPrefix?: string; + permissionKey?: string; }; } -export interface ConfigSecretsModulePatch { +export interface MerkleStoreModulePatch { databaseId?: string | null; schemaId?: string | null; privateSchemaId?: string | null; publicSchemaName?: string | null; privateSchemaName?: string | null; - tableId?: string | null; - configDefinitionsTableId?: string | null; - tableName?: string | null; + objectTableId?: string | null; + storeTableId?: string | null; + commitTableId?: string | null; + refTableId?: string | null; + prefix?: string | null; apiName?: string | null; privateApiName?: string | null; scope?: string | null; - prefix?: string | null; - entityTableId?: string | null; - policies?: Record | null; - provisions?: Record | null; - hasConfig?: boolean | null; + functionPrefix?: string | null; + permissionKey?: string | null; } -export interface UpdateConfigSecretsModuleInput { +export interface UpdateMerkleStoreModuleInput { clientMutationId?: string; id: string; - configSecretsModulePatch: ConfigSecretsModulePatch; + merkleStoreModulePatch: MerkleStoreModulePatch; } -export interface DeleteConfigSecretsModuleInput { +export interface DeleteMerkleStoreModuleInput { clientMutationId?: string; id: string; } @@ -9217,6 +9352,56 @@ export interface DeleteInvitesModuleInput { clientMutationId?: string; id: string; } +export interface CreatePrincipalAuthModuleInput { + clientMutationId?: string; + principalAuthModule: { + databaseId: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; + }; +} +export interface PrincipalAuthModulePatch { + databaseId?: string | null; + schemaId?: string | null; + principalsTableId?: string | null; + principalEntitiesTableId?: string | null; + principalScopeOverridesTableId?: string | null; + usersTableId?: string | null; + sessionsTableId?: string | null; + sessionCredentialsTableId?: string | null; + auditsTableId?: string | null; + principalsTableName?: string | null; + createPrincipalFunction?: string | null; + deletePrincipalFunction?: string | null; + createOrgPrincipalFunction?: string | null; + deleteOrgPrincipalFunction?: string | null; + createOrgApiKeyFunction?: string | null; + revokeOrgApiKeyFunction?: string | null; + apiName?: string | null; +} +export interface UpdatePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; + principalAuthModulePatch: PrincipalAuthModulePatch; +} +export interface DeletePrincipalAuthModuleInput { + clientMutationId?: string; + id: string; +} export interface CreateComputeLogModuleInput { clientMutationId?: string; computeLogModule: { @@ -11348,45 +11533,6 @@ export interface SecureTableProvisionInput { /** Output column populated by the trigger after field creation. Contains the UUIDs of the metaschema fields created on the target table by this provision row's nodes. NULL when nodes is empty or before the trigger runs. Callers should not set this directly. */ outFields?: string[]; } -/** An input for mutations affecting `MerkleStoreModule` */ -export interface MerkleStoreModuleInput { - id?: string; - databaseId: string; - schemaId?: string; - privateSchemaId?: string; - publicSchemaName?: string; - privateSchemaName?: string; - objectTableId?: string; - storeTableId?: string; - commitTableId?: string; - refTableId?: string; - prefix?: string; - apiName?: string; - privateApiName?: string; - scope?: string; - functionPrefix?: string; - createdAt?: string; -} -/** 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?: Record; - provisions?: Record; - defaultPermissions?: string[]; - createdAt?: string; -} /** An input for mutations affecting `DatabaseProvisionModule` */ export interface DatabaseProvisionModuleInput { id?: string; @@ -11433,6 +11579,46 @@ export interface ConfigSecretsModuleInput { provisions?: Record; hasConfig?: boolean; } +/** 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?: Record; + provisions?: Record; + defaultPermissions?: string[]; + createdAt?: string; +} +/** An input for mutations affecting `MerkleStoreModule` */ +export interface MerkleStoreModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + privateSchemaId?: string; + publicSchemaName?: string; + privateSchemaName?: string; + objectTableId?: string; + storeTableId?: string; + commitTableId?: string; + refTableId?: string; + prefix?: string; + apiName?: string; + privateApiName?: string; + scope?: string; + functionPrefix?: string; + permissionKey?: string; + createdAt?: string; +} /** An input for mutations affecting `RateLimitMetersModule` */ export interface RateLimitMetersModuleInput { id?: string; @@ -11550,7 +11736,28 @@ export interface InvitesModuleInput { prefix?: string; entityTableId?: string; apiName?: string; - privateApiName?: string; + privateApiName?: string; +} +/** An input for mutations affecting `PrincipalAuthModule` */ +export interface PrincipalAuthModuleInput { + id?: string; + databaseId: string; + schemaId?: string; + principalsTableId?: string; + principalEntitiesTableId?: string; + principalScopeOverridesTableId?: string; + usersTableId?: string; + sessionsTableId?: string; + sessionCredentialsTableId?: string; + auditsTableId?: string; + principalsTableName?: string; + createPrincipalFunction?: string; + deletePrincipalFunction?: string; + createOrgPrincipalFunction?: string; + deleteOrgPrincipalFunction?: string; + createOrgApiKeyFunction?: string; + revokeOrgApiKeyFunction?: string; + apiName?: string; } /** An input for mutations affecting `ComputeLogModule` */ export interface ComputeLogModuleInput { @@ -12970,6 +13177,8 @@ export interface MerkleStoreModuleFilter { scope?: StringFilter; /** Filter by the object’s `functionPrefix` field. */ functionPrefix?: StringFilter; + /** Filter by the object’s `permissionKey` field. */ + permissionKey?: StringFilter; /** Filter by the object’s `createdAt` field. */ createdAt?: DatetimeFilter; /** Checks for all expressions in this list. */ @@ -14248,96 +14457,6 @@ export type DeleteSecureTableProvisionPayloadSelect = { select: SecureTableProvisionEdgeSelect; }; }; -export interface CreateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was created by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type CreateMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface UpdateMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was updated by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type UpdateMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface DeleteMerkleStoreModulePayload { - clientMutationId?: string | null; - /** The `MerkleStoreModule` that was deleted by this mutation. */ - merkleStoreModule?: MerkleStoreModule | null; - merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; -} -export type DeleteMerkleStoreModulePayloadSelect = { - clientMutationId?: boolean; - merkleStoreModule?: { - select: MerkleStoreModuleSelect; - }; - merkleStoreModuleEdge?: { - select: MerkleStoreModuleEdgeSelect; - }; -}; -export interface CreateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was created by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type CreateGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; -export interface UpdateGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was updated by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type UpdateGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; -export interface DeleteGraphModulePayload { - clientMutationId?: string | null; - /** The `GraphModule` that was deleted by this mutation. */ - graphModule?: GraphModule | null; - graphModuleEdge?: GraphModuleEdge | null; -} -export type DeleteGraphModulePayloadSelect = { - clientMutationId?: boolean; - graphModule?: { - select: GraphModuleSelect; - }; - graphModuleEdge?: { - select: GraphModuleEdgeSelect; - }; -}; export interface CreateDatabaseProvisionModulePayload { clientMutationId?: string | null; /** The `DatabaseProvisionModule` that was created by this mutation. */ @@ -14428,6 +14547,96 @@ export type DeleteConfigSecretsModulePayloadSelect = { select: ConfigSecretsModuleEdgeSelect; }; }; +export interface CreateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was created by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type CreateGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface UpdateGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was updated by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type UpdateGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface DeleteGraphModulePayload { + clientMutationId?: string | null; + /** The `GraphModule` that was deleted by this mutation. */ + graphModule?: GraphModule | null; + graphModuleEdge?: GraphModuleEdge | null; +} +export type DeleteGraphModulePayloadSelect = { + clientMutationId?: boolean; + graphModule?: { + select: GraphModuleSelect; + }; + graphModuleEdge?: { + select: GraphModuleEdgeSelect; + }; +}; +export interface CreateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was created by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type CreateMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; +export interface UpdateMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was updated by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type UpdateMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; +export interface DeleteMerkleStoreModulePayload { + clientMutationId?: string | null; + /** The `MerkleStoreModule` that was deleted by this mutation. */ + merkleStoreModule?: MerkleStoreModule | null; + merkleStoreModuleEdge?: MerkleStoreModuleEdge | null; +} +export type DeleteMerkleStoreModulePayloadSelect = { + clientMutationId?: boolean; + merkleStoreModule?: { + select: MerkleStoreModuleSelect; + }; + merkleStoreModuleEdge?: { + select: MerkleStoreModuleEdgeSelect; + }; +}; export interface CreateRateLimitMetersModulePayload { clientMutationId?: string | null; /** The `RateLimitMetersModule` that was created by this mutation. */ @@ -14698,6 +14907,51 @@ export type DeleteInvitesModulePayloadSelect = { select: InvitesModuleEdgeSelect; }; }; +export interface CreatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was created by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type CreatePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; +export interface UpdatePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was updated by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type UpdatePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; +export interface DeletePrincipalAuthModulePayload { + clientMutationId?: string | null; + /** The `PrincipalAuthModule` that was deleted by this mutation. */ + principalAuthModule?: PrincipalAuthModule | null; + principalAuthModuleEdge?: PrincipalAuthModuleEdge | null; +} +export type DeletePrincipalAuthModulePayloadSelect = { + clientMutationId?: boolean; + principalAuthModule?: { + select: PrincipalAuthModuleSelect; + }; + principalAuthModuleEdge?: { + select: PrincipalAuthModuleEdgeSelect; + }; +}; export interface CreateComputeLogModulePayload { clientMutationId?: string | null; /** The `ComputeLogModule` that was created by this mutation. */ @@ -16065,30 +16319,6 @@ export type SecureTableProvisionEdgeSelect = { select: SecureTableProvisionSelect; }; }; -/** A `MerkleStoreModule` edge in the connection. */ -export interface MerkleStoreModuleEdge { - cursor?: string | null; - /** The `MerkleStoreModule` at the end of the edge. */ - node?: MerkleStoreModule | null; -} -export type MerkleStoreModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: MerkleStoreModuleSelect; - }; -}; -/** A `GraphModule` edge in the connection. */ -export interface GraphModuleEdge { - cursor?: string | null; - /** The `GraphModule` at the end of the edge. */ - node?: GraphModule | null; -} -export type GraphModuleEdgeSelect = { - cursor?: boolean; - node?: { - select: GraphModuleSelect; - }; -}; /** A `DatabaseProvisionModule` edge in the connection. */ export interface DatabaseProvisionModuleEdge { cursor?: string | null; @@ -16113,6 +16343,30 @@ export type ConfigSecretsModuleEdgeSelect = { select: ConfigSecretsModuleSelect; }; }; +/** A `GraphModule` edge in the connection. */ +export interface GraphModuleEdge { + cursor?: string | null; + /** The `GraphModule` at the end of the edge. */ + node?: GraphModule | null; +} +export type GraphModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: GraphModuleSelect; + }; +}; +/** A `MerkleStoreModule` edge in the connection. */ +export interface MerkleStoreModuleEdge { + cursor?: string | null; + /** The `MerkleStoreModule` at the end of the edge. */ + node?: MerkleStoreModule | null; +} +export type MerkleStoreModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: MerkleStoreModuleSelect; + }; +}; /** A `RateLimitMetersModule` edge in the connection. */ export interface RateLimitMetersModuleEdge { cursor?: string | null; @@ -16185,6 +16439,18 @@ export type InvitesModuleEdgeSelect = { select: InvitesModuleSelect; }; }; +/** A `PrincipalAuthModule` edge in the connection. */ +export interface PrincipalAuthModuleEdge { + cursor?: string | null; + /** The `PrincipalAuthModule` at the end of the edge. */ + node?: PrincipalAuthModule | null; +} +export type PrincipalAuthModuleEdgeSelect = { + cursor?: boolean; + node?: { + select: PrincipalAuthModuleSelect; + }; +}; /** A `ComputeLogModule` edge in the connection. */ export interface ComputeLogModuleEdge { cursor?: string | null; diff --git a/sdk/constructive-sdk/src/modules/orm/models/index.ts b/sdk/constructive-sdk/src/modules/orm/models/index.ts index 2ff305f2fc..df6b328d8a 100644 --- a/sdk/constructive-sdk/src/modules/orm/models/index.ts +++ b/sdk/constructive-sdk/src/modules/orm/models/index.ts @@ -29,16 +29,17 @@ export { BlueprintConstructionModel } from './blueprintConstruction'; export { CryptoAuthModuleModel } from './cryptoAuthModule'; export { SessionsModuleModel } from './sessionsModule'; export { SecureTableProvisionModel } from './secureTableProvision'; -export { MerkleStoreModuleModel } from './merkleStoreModule'; -export { GraphModuleModel } from './graphModule'; export { DatabaseProvisionModuleModel } from './databaseProvisionModule'; export { ConfigSecretsModuleModel } from './configSecretsModule'; +export { GraphModuleModel } from './graphModule'; +export { MerkleStoreModuleModel } from './merkleStoreModule'; export { RateLimitMetersModuleModel } from './rateLimitMetersModule'; export { RealtimeModuleModel } from './realtimeModule'; export { WebauthnAuthModuleModel } from './webauthnAuthModule'; export { FunctionInvocationModuleModel } from './functionInvocationModule'; export { FunctionModuleModel } from './functionModule'; export { InvitesModuleModel } from './invitesModule'; +export { PrincipalAuthModuleModel } from './principalAuthModule'; export { ComputeLogModuleModel } from './computeLogModule'; export { InferenceLogModuleModel } from './inferenceLogModule'; export { NamespaceModuleModel } from './namespaceModule'; diff --git a/sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts b/sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts new file mode 100644 index 0000000000..c0e9d913d3 --- /dev/null +++ b/sdk/constructive-sdk/src/modules/orm/models/principalAuthModule.ts @@ -0,0 +1,245 @@ +/** + * PrincipalAuthModule 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 { + PrincipalAuthModule, + PrincipalAuthModuleWithRelations, + PrincipalAuthModuleSelect, + PrincipalAuthModuleFilter, + PrincipalAuthModuleOrderBy, + CreatePrincipalAuthModuleInput, + UpdatePrincipalAuthModuleInput, + PrincipalAuthModulePatch, +} from '../input-types'; +import { connectionFieldsMap } from '../input-types'; +export class PrincipalAuthModuleModel { + constructor(private client: OrmClient) {} + findMany( + args: FindManyArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModules: ConnectionResult>; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + 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, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModules', + document, + variables, + }); + } + findFirst( + args: FindFirstArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindFirstDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: args?.where, + orderBy: args?.orderBy as string[] | undefined, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', + document, + variables, + transform: (data: { + principalAuthModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), + }); + } + findOne( + args: { + id: string; + select: S; + } & StrictSelect + ): QueryBuilder<{ + principalAuthModule: InferSelectResult | null; + }> { + const { document, variables } = buildFindManyDocument( + 'PrincipalAuthModule', + 'principalAuthModules', + args.select, + { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, + 'PrincipalAuthModuleFilter', + 'PrincipalAuthModuleOrderBy', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PrincipalAuthModule', + fieldName: 'principalAuthModule', + document, + variables, + transform: (data: { + principalAuthModules?: { + nodes?: InferSelectResult[]; + }; + }) => ({ + principalAuthModule: data.principalAuthModules?.nodes?.[0] ?? null, + }), + }); + } + create( + args: CreateArgs & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + createPrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildCreateDocument( + 'PrincipalAuthModule', + 'createPrincipalAuthModule', + 'principalAuthModule', + args.select, + args.data, + 'CreatePrincipalAuthModuleInput', + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'createPrincipalAuthModule', + document, + variables, + }); + } + update( + args: UpdateArgs< + S, + { + id: string; + }, + PrincipalAuthModulePatch + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + updatePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildUpdateByPkDocument( + 'PrincipalAuthModule', + 'updatePrincipalAuthModule', + 'principalAuthModule', + args.select, + args.where.id, + args.data, + 'UpdatePrincipalAuthModuleInput', + 'id', + 'principalAuthModulePatch', + connectionFieldsMap, + undefined + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'updatePrincipalAuthModule', + document, + variables, + }); + } + delete( + args: DeleteArgs< + { + id: string; + }, + S + > & { + select: S; + } & StrictSelect + ): QueryBuilder<{ + deletePrincipalAuthModule: { + principalAuthModule: InferSelectResult; + }; + }> { + const { document, variables } = buildDeleteByPkDocument( + 'PrincipalAuthModule', + 'deletePrincipalAuthModule', + 'principalAuthModule', + { + id: args.where.id, + }, + 'DeletePrincipalAuthModuleInput', + args.select, + connectionFieldsMap + ); + return new QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PrincipalAuthModule', + fieldName: 'deletePrincipalAuthModule', + document, + variables, + }); + } +}